/* blueButler AutoDoc Call List
   Colours follow the blueC CompactSignIn theme (navy #1C3262, white, greys).
   Built for WCAG 2.2 AA: text 4.5:1, controls and focus rings 3:1, targets at least 24px,
   visible focus, reflow to 320px, no colour-only meaning, reduced motion respected.
   Scoping: every class starts with ads- and every rule sits under .ads (set by CallListApp), so nothing
   leaks into the Oqtane theme. Colours, radii and shadows are custom properties on .ads, below; sections
   follow the screen from top to bottom.
   Light and dark follow the operating system's setting (prefers-color-scheme): the dark values of the
   same properties are in the dark block near the end, and color-scheme makes the browser's own parts
   (date picker, recording player, checkbox, scrollbars) follow too. */

.ads {
    color-scheme: light dark;
    --ads-navy: #1C3262;
    --ads-navy-hover: #172a53;
    --ads-navy-active: #14244a;
    --ads-navy-tint: #e9eef7;
    /* Back to Calls at the end of the review: muted gold, a darker gold on hover (navy text 6.1:1). */
    --ads-back: #e5bf6b;
    --ads-back-hover: #d9b05a;
    /* Navy as a text and focus-ring colour; the header keeps --ads-navy as its background. */
    --ads-accent: #1C3262;
    /* Action colours: the blueButler logo blue for the main action, a light tint of it for row
       actions, blue text on white for the rest. White on #2160D8 is 5.6:1. */
    --ads-action: #2160D8;
    --ads-action-hover: #1a4cb0;
    --ads-action-active: #163f94;
    --ads-action-text: #1a4cb0;
    --ads-tonal: #e8f0fe;
    --ads-tonal-hover: #d6e4fd;
    --ads-tonal-border: #c9d8f6;
    --ads-outline-border: #b7c4d9;
    --ads-navy-tint-strong: #d3dcec;
    --ads-focus-on-navy: #8fb4ff;
    --ads-canvas: #f4f6fa;
    --ads-surface: #ffffff;
    --ads-text: #172033;
    --ads-text-muted: #4e5a6b;
    --ads-border: #dce2eb;
    --ads-border-control: #7b879a;
    --ads-error: #a8251c;
    --ads-error-bg: #fdf1f0;
    --ads-error-border: #e2a29c;
    --ads-warning: #7a4600;
    --ads-warning-bg: #fff6e3;
    --ads-warning-border: #e5bf6b;
    --ads-success: #1b6638;
    --ads-success-bg: #eef8f1;
    --ads-success-border: #9ccfad;
    --ads-info: #1C3262;
    --ads-info-bg: #eef2f9;
    --ads-info-border: #b3c1da;
    --ads-live: #1b6638;
    --ads-radius: 10px;
    --ads-radius-sm: 6px;
    --ads-shadow: 0 1px 2px rgba(16, 24, 40, .06), 0 1px 3px rgba(16, 24, 40, .05);

    box-sizing: border-box;
    width: 100%;
    max-width: 640px;
    margin: 0 auto;
    background: var(--ads-canvas);
    color: var(--ads-text);
    font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    font-size: .875rem;
    line-height: 1.45;
    interpolate-size: allow-keywords; /* lets disclosures animate to their natural height */
    border: 1px solid var(--ads-border);
    border-radius: var(--ads-radius);
    overflow: hidden;
}

.ads *, .ads *::before, .ads *::after { box-sizing: inherit; }
/* Resets use :where() so they never outrank the component styles below. */
.ads :where(p, h2, h3, h4, dl, dd, ul, fieldset) { margin: 0; }
.ads :where(ul) { padding: 0; list-style: none; }
.ads :where(button, input, select) { font: inherit; color: inherit; }

.ads :focus-visible { outline: 2px solid var(--ads-accent); outline-offset: 2px; }
.ads [tabindex="-1"]:focus { outline: none; }

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

.ads-icon { flex: none; width: 1rem; height: 1rem; }
.ads-icon--flip { transform: rotate(180deg); }

/* ---- Header ------------------------------------------------------------------------------ */

.ads-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding: 6px 10px;
    background: var(--ads-navy);
    color: #fff;
}
.ads-header :focus-visible { outline-color: var(--ads-focus-on-navy); }

.ads-brand { display: flex; align-items: center; gap: 8px; min-width: 0; }
.ads-brand-mark {
    flex: none; width: 26px; height: 26px;
    background: url("icon.png") center / contain no-repeat;
}
/* Stacked like the extension's logo: small "blueButler" above a larger "AutoDoc". */
.ads-brand-text { display: flex; flex-direction: column; line-height: 1.05; min-width: 0; white-space: nowrap; }
.ads-brand-name { font-size: .75rem; font-weight: 700; color: #fff; }
.ads-brand-blue { color: #01A7FF; } /* logo blue; 4.7:1 on the navy header */
.ads-brand-product { font-size: 1.0625rem; font-weight: 700; }

.ads-header-tools { display: flex; align-items: center; gap: 6px; flex: none; }

.ads-ext {
    display: inline-flex; align-items: center; gap: 6px;
    padding: 3px 9px; border-radius: 999px;
    background: rgba(255, 255, 255, .12);
    font-size: .6875rem; font-weight: 500; color: rgba(255, 255, 255, .72); white-space: nowrap;
}
.ads-ext-dot { width: 8px; height: 8px; border-radius: 50%; background: #c3cad6; }
.ads-ext--connected .ads-ext-dot { background: #6fdc9b; }
.ads-ext--outdated .ads-ext-dot, .ads-ext--noreply .ads-ext-dot { background: #ffc400; }
a.ads-ext { text-decoration: none; }
a.ads-ext:hover { background: rgba(255, 255, 255, .2); color: #fff; text-decoration: underline; }


/* ---- Layout ------------------------------------------------------------------------------ */

.ads-body { display: flex; flex-direction: column; gap: 12px; padding: 8px; }

.ads-card {
    background: var(--ads-surface);
    border: 1px solid var(--ads-border);
    border-radius: var(--ads-radius);
    box-shadow: var(--ads-shadow);
    padding: 10px;
    display: flex; flex-direction: column; gap: 6px;
}
.ads-card h3 { font-size: .9375rem; font-weight: 700; color: var(--ads-text); padding: 0; }
.ads-card-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }

.ads-eyebrow {
    font-size: .75rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase;
    color: var(--ads-text-muted);
}

.ads-section-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.ads-section-title { display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; min-width: 0; }
.ads-section-title h2 { font-size: 1rem; font-weight: 700; }
.ads-section-count { font-size: .8125rem; color: var(--ads-text-muted); }

.ads-hint { font-size: .8125rem; color: var(--ads-text-muted); }
.ads-hint + .ads-btn { margin-top: 6px; } /* a button after a hint gets room to breathe */
.ads-prose { white-space: pre-wrap; overflow-wrap: anywhere; }
.ads-subhead { font-size: .8125rem; font-weight: 700; color: var(--ads-text); margin-top: 4px; }

/* ---- Buttons ----------------------------------------------------------------------------- */

.ads-btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 6px;
    min-height: 36px; padding: 0 14px;
    border: 1px solid transparent; border-radius: var(--ads-radius-sm);
    font-size: .8125rem; font-weight: 600; line-height: 1.2; text-align: center;
    cursor: pointer; text-decoration: none;
    transition: background-color .15s ease, border-color .15s ease;
}
.ads-btn--sm { min-height: 32px; padding: 0 7px; gap: 4px; font-size: .78125rem; }
.ads-btn--sm .ads-icon { width: .9375rem; height: .9375rem; }
.ads-btn--block { width: 100%; }

.ads-btn--primary { background: var(--ads-action); border-color: var(--ads-action); color: #fff; }
.ads-btn--primary:hover { background: var(--ads-action-hover); border-color: var(--ads-action-hover); }
.ads-btn--primary:active { background: var(--ads-action-active); border-color: var(--ads-action-active); }

/* Medium emphasis: the action repeated on every call row. */
.ads-btn--tonal { background: var(--ads-tonal); border-color: var(--ads-tonal-border); color: var(--ads-action-text); }
.ads-btn--tonal:hover { background: var(--ads-tonal-hover); }
.ads-btn--tonal:active { background: var(--ads-tonal-border); }

.ads-btn--secondary { background: var(--ads-surface); border-color: var(--ads-outline-border); color: var(--ads-action-text); }
.ads-btn--secondary:hover { background: var(--ads-tonal); border-color: var(--ads-tonal-border); }

.ads-btn--ghost { background: transparent; color: var(--ads-action-text); }
.ads-btn--ghost:hover { background: var(--ads-tonal); }

.ads-btn--danger { background: var(--ads-surface); border-color: var(--ads-error-border); color: var(--ads-error); }
.ads-btn--danger:hover { background: var(--ads-error-bg); }

.ads-btn[aria-disabled="true"], .ads-btn:disabled { cursor: not-allowed; opacity: .6; }
.ads-btn:disabled { background: var(--ads-canvas); border-color: var(--ads-border); color: var(--ads-text-muted); }

/* Needs the bB extension: greyed out but still focusable; clicking explains why. */
.ads-btn.ads-btn--unavailable { background: var(--ads-canvas); border-color: var(--ads-border); color: var(--ads-text-muted); opacity: 1; }
.ads-btn.ads-btn--unavailable:hover { background: var(--ads-canvas); }

.ads-link-btn {
    display: inline-flex; align-items: center; min-height: 28px; padding: 0 4px;
    border: 0; background: none; color: var(--ads-action-text);
    font-size: .8125rem; font-weight: 600; text-decoration: underline; text-underline-offset: 2px;
    cursor: pointer;
}

/* Back to the list. Calls at the top of the review is navy with white text (12.5:1). Back to Calls at
   its end is large and in its own colour, so it stands out from the blue actions: muted gold in light,
   the light brand blue in dark, both with navy text (7.1:1 and 6.0:1). */
.ads-btn--navy { background: var(--ads-navy); border-color: var(--ads-navy); color: #fff; }
.ads-btn--navy:hover { background: var(--ads-navy-hover); border-color: var(--ads-navy-hover); }
.ads-btn--navy:active { background: var(--ads-navy-active); border-color: var(--ads-navy-active); }
.ads-btn--back { background: var(--ads-back); border-color: var(--ads-back); color: var(--ads-navy); }
.ads-btn--back:hover { background: var(--ads-back-hover); border-color: var(--ads-back-hover); }
.ads-btn--lg { min-height: 44px; font-size: .9375rem; }
.ads-btn--lg .ads-icon { width: 1.125rem; height: 1.125rem; }
.ads-review-top { display: flex; align-items: center; justify-content: space-between; gap: 4px 8px; flex-wrap: wrap; }
.ads-review-ref { display: inline-flex; align-items: center; gap: 4px; }

.ads-actions { display: flex; flex-wrap: wrap; gap: 6px; }

.ads-count {
    display: inline-flex; align-items: center; justify-content: center;
    min-width: 20px; height: 20px; padding: 0 6px; border-radius: 999px;
    background: var(--ads-action); color: #fff; font-size: .75rem; font-weight: 700;
}

.ads-spinner {
    display: inline-block; flex: none;
    width: 14px; height: 14px;
    border: 2px solid currentColor; border-right-color: transparent; border-radius: 50%;
    animation: ads-spin .8s linear infinite;
}
.ads-icon--spin { animation: ads-spin .8s linear infinite; }
@keyframes ads-spin { to { transform: rotate(360deg); } }

/* ---- Current call -------------------------------------------------------------------------- */

.ads-live {
    background: var(--ads-surface);
    border: 1px solid var(--ads-border);
    border-radius: var(--ads-radius);
    box-shadow: var(--ads-shadow);
    padding: 8px 10px;
    display: flex; flex-direction: column; gap: 6px;
}
.ads-live--active { border-color: var(--ads-success-border); border-left: 4px solid var(--ads-live); }
.ads-live-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; flex-wrap: wrap; }
.ads-live-titles { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.ads-live-empty-text { font-size: .8125rem; color: var(--ads-text-muted); }
.ads-live-state {
    display: inline-flex; align-items: center; gap: 6px;
    font-size: .75rem; font-weight: 700; color: var(--ads-live);
}
.ads-live-dot {
    width: 8px; height: 8px; border-radius: 50%; background: var(--ads-live);
    box-shadow: 0 0 0 0 color-mix(in srgb, var(--ads-live) 50%, transparent);
    animation: ads-pulse 1.6s ease-out 3; /* three pulses, under five seconds (WCAG 2.2.2) */
}
@keyframes ads-pulse {
    0% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--ads-live) 50%, transparent); }
    100% { box-shadow: 0 0 0 8px color-mix(in srgb, var(--ads-live) 0%, transparent); }
}

/* ---- Filter ------------------------------------------------------------------------------- */

.ads-filter { display: flex; flex-direction: column; }
.ads-filter-row { display: flex; align-items: center; gap: 8px; }
.ads-select.ads-select--date {
    flex: 1 1 auto; width: auto; min-width: 0;
    min-height: 32px; padding-left: 34px; font-weight: 600; color: var(--ads-accent);
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%231C3262' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='3.5' y='5' width='17' height='15.5' rx='2'/%3E%3Cline x1='3.5' y1='10' x2='20.5' y2='10'/%3E%3Cline x1='8' y1='3' x2='8' y2='7'/%3E%3Cline x1='16' y1='3' x2='16' y2='7'/%3E%3C/svg%3E"), url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%231C3262' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
    background-position: left 11px center, right 12px center;
    background-size: 15px 15px, 13px 13px;
}

.ads-filter-toggle { flex: none; }
.ads-filter-toggle[aria-expanded="true"] { background: var(--ads-tonal); border-color: var(--ads-action); }

/* Slides open and closed. Closed content is inert and hidden from assistive tech. */
.ads-collapse {
    display: grid; grid-template-rows: 0fr; opacity: 0;
    transition: grid-template-rows .22s ease, opacity .18s ease;
}
.ads-collapse.is-open { grid-template-rows: 1fr; opacity: 1; }
.ads-collapse-inner { min-height: 0; overflow: hidden; visibility: hidden; transition: visibility 0s linear .22s; }
.ads-collapse.is-open > .ads-collapse-inner { visibility: visible; transition: visibility 0s; }

.ads-filter-panel {
    margin-top: 8px;
    background: var(--ads-surface);
    border: 1px solid var(--ads-border);
    border-radius: var(--ads-radius);
    box-shadow: var(--ads-shadow);
    padding: 10px;
}

.ads-form { display: flex; flex-direction: column; gap: 10px; }
.ads-field { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.ads-field > label, .ads-fieldset > legend { font-size: .78125rem; font-weight: 600; color: var(--ads-text); }
.ads-fieldset { border: 0; padding: 0; margin: 0; min-width: 0; }
.ads-fieldset > legend { padding: 0; margin-bottom: 4px; }
.ads-form > .ads-fieldset > legend { margin-bottom: 2px; }
.ads-form > .ads-fieldset .ads-field > label { font-weight: 500; color: var(--ads-text-muted); }
.ads-field-pair { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 10px; }
.ads-segmented { white-space: nowrap; }

.ads-input, .ads-select {
    width: 100%; min-height: 34px; padding: 5px 10px;
    border: 1px solid var(--ads-border-control); border-radius: var(--ads-radius-sm);
    background-color: var(--ads-surface); color: var(--ads-text);
}

/* Our own chevron, 12px in from the edge, instead of the browser's arrow tight against the border. */
.ads-select {
    -webkit-appearance: none; appearance: none;
    padding-right: 34px; cursor: pointer;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%231C3262' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    background-size: 13px 13px;
    text-overflow: ellipsis;
}
.ads-input[type="date"] { padding-right: 8px; }
.ads-input[type="date"]::-webkit-calendar-picker-indicator { margin: 0 2px 0 8px; cursor: pointer; }

/* Chrome (the extension's browser): the open list matches the module and slides open.
   Other browsers keep their own list. */
@supports (appearance: base-select) {
    .ads-select, .ads-select::picker(select) { appearance: base-select; }
    .ads-select::picker-icon { display: none; }
    .ads-select::picker(select) {
        margin-block: 4px;
        padding: 4px;
        border: 1px solid var(--ads-border);
        border-radius: 8px;
        background: var(--ads-surface);
        box-shadow: 0 10px 28px rgba(16, 24, 40, .16), 0 2px 6px rgba(16, 24, 40, .08);
        opacity: 1; transform: translateY(0);
        transition: opacity .16s ease, transform .16s ease, display .16s allow-discrete, overlay .16s allow-discrete;
    }
    .ads-select:not(:open)::picker(select) { opacity: 0; transform: translateY(-6px); }
    @starting-style {
        .ads-select:open::picker(select) { opacity: 0; transform: translateY(-6px); }
    }
    .ads-select option {
        padding: 6px 10px; border-radius: 6px;
        font-size: .8125rem; font-weight: 500; color: var(--ads-text); cursor: pointer;
    }
    .ads-select option:hover { background: var(--ads-navy-tint); }
    .ads-select option:focus-visible { outline: 2px solid var(--ads-accent); outline-offset: -2px; }
    .ads-select option:checked { font-weight: 700; color: var(--ads-accent); }
    .ads-select option::checkmark { color: var(--ads-accent); }
}
.ads-input:focus-visible, .ads-select:focus-visible { outline: 2px solid var(--ads-accent); outline-offset: 1px; border-color: var(--ads-accent); }
.ads-input[aria-invalid="true"] { border-color: var(--ads-error); border-width: 2px; }

.ads-input-unit { display: flex; align-items: center; gap: 8px; }
.ads-input-unit .ads-input { flex: 1 1 auto; min-width: 0; }
.ads-unit { font-size: .8125rem; color: var(--ads-text-muted); }

.ads-field-error { display: flex; align-items: flex-start; gap: 6px; font-size: .8125rem; font-weight: 600; color: var(--ads-error); }
.ads-field-error .ads-icon { margin-top: 1px; }

.ads-segmented { align-self: flex-start; display: inline-flex; flex-wrap: nowrap; border: 1px solid var(--ads-outline-border); border-radius: var(--ads-radius-sm); overflow: hidden; }
.ads-segmented-input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.ads-segmented-label {
    display: inline-flex; align-items: center; min-height: 34px; padding: 0 14px;
    font-size: .8125rem; font-weight: 600; color: var(--ads-action-text); cursor: pointer;
    border-right: 1px solid var(--ads-outline-border);
}
.ads-segmented-label:last-of-type { border-right: 0; }
.ads-segmented-label:hover { background: var(--ads-tonal); }
.ads-segmented-input:checked + .ads-segmented-label { background: var(--ads-action); color: #fff; }
.ads-segmented-input:focus-visible + .ads-segmented-label { outline: 2px solid var(--ads-accent); outline-offset: -4px; box-shadow: inset 0 0 0 4px var(--ads-surface); }

.ads-filter-actions {
    display: flex; align-items: center; justify-content: space-between; gap: 8px;
    margin-top: 2px; padding-top: 10px; border-top: 1px solid var(--ads-border);
}

.ads-applied { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-top: 8px; }
.ads-applied-chip {
    display: inline-flex; align-items: center; gap: 4px;
    min-height: 28px; padding: 0 6px 0 10px;
    border: 1px solid var(--ads-info-border); border-radius: 999px;
    background: var(--ads-tonal); color: var(--ads-action-text);
    font-size: .8125rem; font-weight: 600; cursor: pointer;
}
.ads-applied-chip:hover { background: var(--ads-tonal-hover); }
.ads-applied-chip .ads-icon { width: .875rem; height: .875rem; }

/* ---- Call list ------------------------------------------------------------------------------ */

.ads-list { display: flex; flex-direction: column; gap: 10px; }
.ads-list-body { position: relative; }
.ads-list-body.ads-is-loading .ads-calls { opacity: .45; pointer-events: none; }

.ads-calls { display: flex; flex-direction: column; gap: 10px; }

.ads-call {
    background: var(--ads-surface);
    border: 1px solid var(--ads-border);
    border-radius: var(--ads-radius);
    box-shadow: var(--ads-shadow);
    padding: 8px 10px;
    display: flex; flex-direction: column; gap: 5px;
}
.ads-call:hover { border-color: var(--ads-navy-tint-strong); }
.ads-call-head { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; }
.ads-call-title { display: flex; align-items: center; flex-wrap: wrap; gap: 2px 6px; min-width: 0; }
.ads-call-name { font-size: .9375rem; font-weight: 700; overflow-wrap: anywhere; }
.ads-call-ref { font-size: .75rem; color: var(--ads-text-muted); font-variant-numeric: tabular-nums; }
.ads-copy-btn {
    display: inline-flex; align-items: center; justify-content: center;
    width: 24px; height: 24px; margin-left: -4px; padding: 0;
    border: 0; border-radius: var(--ads-radius-sm); background: transparent;
    color: var(--ads-text-muted); cursor: pointer;
}
.ads-copy-btn .ads-icon { width: .875rem; height: .875rem; }
.ads-copy-btn:hover { background: var(--ads-tonal); color: var(--ads-action-text); }
.ads-call-time { flex: none; font-size: .75rem; color: var(--ads-text-muted); white-space: nowrap; }

.ads-call-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 2px 6px; font-size: .8125rem; color: var(--ads-text-muted); }
.ads-dir { display: inline-flex; align-items: center; gap: 4px; }
.ads-dir .ads-icon { width: .875rem; height: .875rem; }
.ads-sep { color: var(--ads-border-control); }

.ads-badge {
    display: inline-flex; align-items: center; gap: 4px;
    padding: 1px 8px; border-radius: 999px;
    border: 1px solid var(--ads-border);
    background: var(--ads-canvas); color: var(--ads-text-muted);
    font-size: .75rem; font-weight: 600; white-space: nowrap;
}
.ads-badge .ads-icon { width: .75rem; height: .75rem; }
.ads-badge--success { background: var(--ads-success-bg); border-color: var(--ads-success-border); color: var(--ads-success); }
.ads-badge--warning { background: var(--ads-warning-bg); border-color: var(--ads-warning-border); color: var(--ads-warning); }

.ads-progress {
    display: flex; align-items: center; gap: 8px;
    padding: 6px 10px; border-radius: var(--ads-radius-sm);
    background: var(--ads-info-bg); color: var(--ads-info);
    font-size: .8125rem;
}
.ads-progress--waiting .ads-icon { flex: none; }

.ads-loading {
    display: flex; align-items: center; justify-content: center; gap: 8px;
    min-height: 120px; color: var(--ads-text-muted);
}
.ads-empty {
    display: flex; flex-direction: column; align-items: flex-start; gap: 6px;
    padding: 16px; border: 1px dashed var(--ads-border-control); border-radius: var(--ads-radius);
    background: var(--ads-surface);
}
.ads-card.ads-empty { border-style: dashed; box-shadow: none; }
.ads-empty-title { font-weight: 700; }
.ads-empty-text { color: var(--ads-text-muted); font-size: .8125rem; }

.ads-pager { display: flex; align-items: center; justify-content: space-between; gap: 8px 6px; flex-wrap: wrap; }
.ads-pager-pages { display: flex; justify-content: center; gap: 4px; flex: 1 0 100%; }
.ads-page {
    min-width: 32px; min-height: 32px; padding: 0 8px;
    border: 1px solid var(--ads-border-control); border-radius: var(--ads-radius-sm);
    background: var(--ads-surface); color: var(--ads-action-text); font-weight: 600; cursor: pointer;
}
.ads-page:hover { background: var(--ads-tonal); }
.ads-page--current { background: var(--ads-action); border-color: var(--ads-action); color: #fff; }
.ads-page--current:hover { color: var(--ads-action-text); }
.ads-page-gap { min-width: 20px; display: flex; align-items: flex-end; justify-content: center; color: var(--ads-text-muted); font-weight: 600; }

/* ---- Review ------------------------------------------------------------------------------- */

.ads-review { display: flex; flex-direction: column; gap: 12px; }

.ads-disclosure summary {
    display: flex; align-items: center; justify-content: space-between;
    min-height: 32px; font-weight: 700; cursor: pointer; list-style: none;
    border-radius: var(--ads-radius-sm);
}
.ads-disclosure summary::-webkit-details-marker { display: none; }
.ads-disclosure-icon { transform: rotate(-90deg); transition: transform .2s ease; }
.ads-disclosure[open] .ads-disclosure-icon { transform: rotate(90deg); }
/* Slides open and closed (Chrome); other browsers open instantly. */
.ads-disclosure::details-content {
    block-size: 0; overflow: clip;
    transition: block-size .22s ease, content-visibility .22s allow-discrete;
}
.ads-disclosure[open]::details-content { block-size: auto; }
.ads-transcript {
    max-height: 280px; overflow-y: auto;
    padding: 10px; border-radius: var(--ads-radius-sm);
    background: var(--ads-canvas); border: 1px solid var(--ads-border);
    white-space: pre-wrap; overflow-wrap: anywhere; font-size: .8125rem;
}

.ads-recording { margin-top: 2px; }
.ads-audio { display: block; width: 100%; height: 40px; }
/* ---- Save to Epic: two-line action rows ---------------------------------------------------- */
/* Icon tile, then the label with what it does underneath, left-aligned. The blue row is the main
   action; the transcript option is joined to the recording row it changes. */

.ads-action-list { display: flex; flex-direction: column; gap: 14px; }
.ads-action-group { display: flex; flex-direction: column; gap: 8px; }
.ads-action-group-title { font-size: .8125rem; font-weight: 700; color: var(--ads-text); }

.ads-action {
    display: grid; grid-template-columns: 32px minmax(0, 1fr); column-gap: 10px; align-items: start;
    width: 100%; padding: 10px 12px; text-align: left;
    background: var(--ads-surface); color: var(--ads-text);
    border: 1px solid var(--ads-outline-border); border-radius: var(--ads-radius);
    font: inherit; cursor: pointer;
}
.ads-action:hover { background: var(--ads-tonal); border-color: var(--ads-tonal-border); }
.ads-action-icon {
    display: grid; place-items: center; width: 32px; height: 32px; border-radius: 8px;
    background: var(--ads-tonal); color: var(--ads-action-text);
}
.ads-action-icon .ads-icon { width: 18px; height: 18px; }
.ads-action-text { display: flex; flex-direction: column; gap: 2px; padding-top: 1px; }
.ads-action-title { font-size: .875rem; font-weight: 650; line-height: 1.3; color: var(--ads-action-text); overflow-wrap: anywhere; }
.ads-action-desc { font-size: .78125rem; line-height: 1.35; color: var(--ads-text-muted); }

.ads-action--primary { background: var(--ads-action); border-color: var(--ads-action); }
.ads-action--primary:hover { background: var(--ads-action-hover); border-color: var(--ads-action-hover); }
.ads-action--primary .ads-action-icon { background: rgba(255, 255, 255, .18); color: #fff; }
.ads-action--primary .ads-action-title { color: #fff; }
.ads-action--primary .ads-action-desc { color: #e9effb; } /* 4.9:1 on the blue */

/* Busy elsewhere (another Epic action running): dimmed, still explains on click. */
.ads-action[aria-disabled="true"] { cursor: not-allowed; opacity: .6; }
/* The action that is running stays at full strength, with its spinner in the tile. */
.ads-action[aria-busy="true"] { cursor: progress; opacity: 1; }
/* Needs the extension, a recording or a transcript: greyed, at full opacity so it stays readable. */
.ads-action.ads-action--unavailable, .ads-action.ads-action--unavailable:hover {
    background: var(--ads-canvas); border-color: var(--ads-border); opacity: 1;
}
.ads-action--unavailable .ads-action-icon { background: var(--ads-border); color: var(--ads-text-muted); }
.ads-action--unavailable .ads-action-title, .ads-action--unavailable .ads-action-desc { color: var(--ads-text-muted); }

/* An action with its option: one bordered unit, the option indented under the label. */
.ads-action-set { border: 1px solid var(--ads-outline-border); border-radius: var(--ads-radius); overflow: hidden; }
.ads-action-set > .ads-action { border: 0; border-radius: 0; }
.ads-action-option {
    display: flex; align-items: center; gap: 8px; min-height: 36px; padding: 6px 12px 6px 54px;
    border-top: 1px solid var(--ads-border); background: var(--ads-surface);
    font-size: .8125rem; color: var(--ads-text); cursor: pointer;
}
.ads-action-option input { flex: none; width: 16px; height: 16px; margin: 0; accent-color: var(--ads-action); }
.ads-action-option:has(input:disabled) { color: var(--ads-text-muted); cursor: default; }
.ads-action-set--unavailable { border-color: var(--ads-border); }
.ads-action-set--unavailable .ads-action-option { background: var(--ads-canvas); }

/* Client card: Epic has a different client open than the call's. Nothing is sent until the agent
   decides, so it is the loudest thing on the screen: a red frame, a question as the title, both
   clients side by side, and the safe choice as the filled button. */
.ads-client-check {
    display: flex; flex-direction: column; gap: 10px; padding: 12px;
    background: var(--ads-error-bg); border: 2px solid var(--ads-error); border-radius: var(--ads-radius);
}
.ads-client-check-title { display: flex; align-items: center; gap: 8px; font-size: 1rem; font-weight: 700; line-height: 1.3; color: var(--ads-error); }
.ads-client-check-title .ads-icon { flex: none; width: 20px; height: 20px; }
.ads-client-check-codes {
    display: grid; gap: 8px; margin: 0; padding: 10px 12px;
    background: var(--ads-surface); border: 1px solid var(--ads-error-border); border-radius: var(--ads-radius-sm);
}
.ads-client-check-codes > div { display: grid; grid-template-columns: 6.5em minmax(0, 1fr); gap: 8px; align-items: baseline; }
.ads-client-check-codes dt { font-size: .78125rem; color: var(--ads-text-muted); }
.ads-client-check-codes dd { margin: 0; font-size: .875rem; font-weight: 700; color: var(--ads-text); overflow-wrap: anywhere; }
.ads-client-check-code { display: block; font-weight: 600; color: var(--ads-text-muted); }
.ads-client-check-help { font-size: .8125rem; line-height: 1.35; color: var(--ads-text); }
.ads-client-check-actions { display: flex; flex-direction: column; gap: 8px; }


/* ---- Notes (one line, nothing to dismiss; the next action clears them) --------------------- */

.ads-note {
    display: flex; align-items: flex-start; gap: 6px;
    padding: 4px 8px; border-radius: var(--ads-radius-sm);
    border-left: 3px solid;
    font-size: .8125rem; line-height: 1.35;
}
.ads-note-icon { flex: none; width: .9375rem; height: .9375rem; margin-top: 1px; }
.ads-note-body { min-width: 0; overflow-wrap: anywhere; color: var(--ads-text); }
.ads-note-body strong { font-weight: 700; }

.ads-note--error { background: var(--ads-error-bg); border-left-color: var(--ads-error); }
.ads-note--error .ads-note-icon, .ads-note--error .ads-note-title { color: var(--ads-error); }
.ads-note--warning { background: var(--ads-warning-bg); border-left-color: var(--ads-warning); }
.ads-note--warning .ads-note-icon, .ads-note--warning .ads-note-title { color: var(--ads-warning); }
.ads-note--success { background: var(--ads-success-bg); border-left-color: var(--ads-success); }
.ads-note--success .ads-note-icon, .ads-note--success .ads-note-title { color: var(--ads-success); }
.ads-note--info { background: var(--ads-info-bg); border-left-color: var(--ads-info); }
.ads-note--info .ads-note-icon, .ads-note--info .ads-note-title { color: var(--ads-info); }

/* ---- Narrow side panels and user preferences ---------------------------------------------- */

@media (max-width: 360px) {
    .ads-body { padding: 6px; }
    .ads-header { flex-wrap: wrap; }
    .ads-call-head { flex-direction: column; gap: 0; }
}

/* Dark: the same properties, set when the operating system is set to dark. The canvas and surface are
   Bootstrap 5.3's dark page and raised colours (#212529, #2b3035), which the CompactSignIn theme shows
   around the module in dark mode. The navy header, the filled blue actions with white text (5.6:1)
   and the action hover colours stay as in light. Text is at least 5.4:1 on every background it sits
   on, and focus rings and input borders at least 4.3:1. */
@media (prefers-color-scheme: dark) {
    .ads {
        --ads-navy-tint: #2f3b52;
        --ads-navy-tint-strong: #56627a;
        --ads-back: #8fb4ff;
        --ads-back-hover: #b5ceff;
        --ads-accent: #8fb4ff;
        --ads-action-text: #8fb4ff;
        --ads-tonal: #1e2c47;
        --ads-tonal-hover: #253658;
        --ads-tonal-border: #34497a;
        --ads-outline-border: #56627a;
        --ads-canvas: #212529;
        --ads-surface: #2b3035;
        --ads-text: #e9ecef;
        --ads-text-muted: #adb5bd;
        --ads-border: #424951;
        --ads-border-control: #8a94a3;
        --ads-error: #ff8f85;
        --ads-error-bg: #3b2224;
        --ads-error-border: #9b4a44;
        --ads-warning: #f3c066;
        --ads-warning-bg: #3a3020;
        --ads-warning-border: #8a6a2a;
        --ads-success: #75d69a;
        --ads-success-bg: #1d3527;
        --ads-success-border: #3a7a52;
        --ads-info: #b4c8ef;
        --ads-info-bg: #253045;
        --ads-info-border: #46597c;
        --ads-live: #75d69a;
        --ads-shadow: 0 1px 2px rgba(0, 0, 0, .35), 0 1px 3px rgba(0, 0, 0, .25);
    }
    /* The dropdown icons are images, which can't read a property: the same icons in the dark accent. */
    .ads-select {
        background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%238fb4ff' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
    }
    .ads-select.ads-select--date {
        background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%238fb4ff' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='3.5' y='5' width='17' height='15.5' rx='2'/%3E%3Cline x1='3.5' y1='10' x2='20.5' y2='10'/%3E%3Cline x1='8' y1='3' x2='8' y2='7'/%3E%3Cline x1='16' y1='3' x2='16' y2='7'/%3E%3C/svg%3E"), url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%238fb4ff' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
    }
}

@media (prefers-reduced-motion: reduce) {
    .ads .ads-spinner, .ads .ads-icon--spin, .ads .ads-live-dot { animation: none; }
    .ads .ads-btn, .ads .ads-disclosure-icon, .ads .ads-collapse, .ads .ads-collapse-inner,
    .ads .ads-disclosure::details-content, .ads .ads-select::picker(select) { transition: none; }
}

@media (forced-colors: active) {
    .ads-page--current, .ads-segmented-input:checked + .ads-segmented-label { forced-color-adjust: none; background: Highlight; color: HighlightText; }
    .ads-note { border-left-color: CanvasText; }
}
