/* SignalPath CRM Sandbox — Salesforce-flavoured but deliberately simplified. */

:root {
    --cs-ink: #1c2536;
    --cs-muted: #5a6577;
    --cs-line: #dfe4ec;
    --cs-surface: #ffffff;
    --cs-wash: #f4f6fa;
    --cs-brand: #1a5fb4;
    --cs-brand-soft: #e8f0fb;
    --cs-good: #1f7a4d;
    --cs-good-soft: #e6f4ec;
    --cs-warn: #9a6508;
    --cs-warn-soft: #fdf3e0;
    --cs-bad: #a32b2b;
    --cs-bad-soft: #fbeceb;
}

/* ---------------------------------------------------------------- case brief */

.cs-case {
    padding: 0;
    margin-bottom: 1rem;
    border-left: 4px solid var(--cs-brand);
}

.cs-case__summary {
    cursor: pointer;
    padding: 1rem 1.25rem;
    font-size: 0.95rem;
    color: var(--cs-ink);
    line-height: 1.5;
}

.cs-case__summary::-webkit-details-marker { display: none; }

.cs-case__tag {
    display: inline-block;
    margin-right: 0.5rem;
    padding: 0.15rem 0.5rem;
    border-radius: 4px;
    background: var(--cs-brand-soft);
    color: var(--cs-brand);
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.cs-case__more {
    color: var(--cs-brand);
    font-weight: 600;
    white-space: nowrap;
}

.cs-case[open] .cs-case__more { display: none; }

.cs-case__body {
    padding: 0 1.25rem 1.25rem;
    border-top: 1px solid var(--cs-line);
    padding-top: 1rem;
}

.cs-case__facts {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
    gap: 0.9rem;
    margin: 1rem 0;
}

.cs-case__facts > div {
    background: var(--cs-wash);
    border-radius: 6px;
    padding: 0.75rem 0.85rem;
    font-size: 0.86rem;
    line-height: 1.5;
}

.cs-case__label {
    display: block;
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    color: var(--cs-muted);
    margin-bottom: 0.3rem;
}

.cs-case__questions {
    font-size: 0.88rem;
    line-height: 1.6;
    padding: 0.85rem 1rem;
    background: var(--cs-brand-soft);
    border-radius: 6px;
    margin: 0;
}

.cs-case__heading {
    margin: 1.25rem 0 0.3rem;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    color: var(--cs-muted);
}

.cs-case__intro {
    margin: 0 0 0.6rem;
    font-size: 0.83rem;
    font-style: italic;
    color: var(--cs-muted);
}

.cs-case__roster {
    list-style: none;
    margin: 0 0 1.1rem;
    padding: 0;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 0.6rem;
}

.cs-case__roster li {
    font-size: 0.85rem;
    line-height: 1.5;
    padding: 0.6rem 0.75rem;
    border-left: 3px solid var(--cs-line);
    background: var(--cs-wash);
    border-radius: 0 6px 6px 0;
}

.cs-case__warning {
    background: var(--cs-warn-soft);
    border-radius: 6px;
    padding: 0.8rem 1rem;
    margin-bottom: 1rem;
}

.cs-case__warning p {
    margin: 0.35rem 0 0;
    font-size: 0.85rem;
    line-height: 1.55;
}

/* ------------------------------------------------------------------ toolbar */

.cs-toolbar {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    gap: 1rem;
    padding: 1rem 1.25rem;
    margin-bottom: 1rem;
}

.cs-control {
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
}

.cs-control label {
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--cs-muted);
}

.cs-control select {
    min-width: 150px;
    padding: 0.45rem 0.6rem;
    border: 1px solid var(--cs-line);
    border-radius: 6px;
    background: var(--cs-surface);
    font-size: 0.9rem;
    color: var(--cs-ink);
}

.cs-toolbar__asof {
    margin: 0 0 0 auto;
    font-size: 0.78rem;
    color: var(--cs-muted);
    max-width: 24rem;
    line-height: 1.45;
}

/* --------------------------------------------------------------------- tabs */

.cs-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 0.25rem;
    border-bottom: 2px solid var(--cs-line);
    margin-bottom: 1.25rem;
}

.cs-tab {
    appearance: none;
    border: none;
    background: none;
    padding: 0.65rem 1.1rem;
    font-size: 0.92rem;
    font-weight: 600;
    color: var(--cs-muted);
    cursor: pointer;
    border-bottom: 3px solid transparent;
    margin-bottom: -2px;
    border-radius: 6px 6px 0 0;
}

.cs-tab:hover { background: var(--cs-wash); color: var(--cs-ink); }

.cs-tab[aria-selected="true"] {
    color: var(--cs-brand);
    border-bottom-color: var(--cs-brand);
}

.cs-tab:focus-visible { outline: 2px solid var(--cs-brand); outline-offset: 2px; }

/* -------------------------------------------------------------------- panels */

.cs-panel { padding: 1.25rem; margin-bottom: 1.25rem; }

.cs-panel h2 {
    margin: 0 0 0.75rem;
    font-size: 1.05rem;
    color: var(--cs-ink);
}

.cs-panel__head {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    margin-bottom: 0.75rem;
}

.cs-panel__head h2 { margin: 0; }

.cs-lede {
    margin: 0 0 0.9rem;
    font-size: 0.88rem;
    line-height: 1.55;
    color: var(--cs-muted);
    max-width: 60ch;
}

.cs-note {
    margin: 0.8rem 0 0;
    font-size: 0.8rem;
    line-height: 1.55;
    color: var(--cs-muted);
    max-width: 78ch;
}

/* ---------------------------------------------------------------------- KPIs */

.cs-kpis {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
    gap: 0.85rem;
    margin-bottom: 1.25rem;
}

.cs-kpi {
    background: var(--cs-surface);
    border: 1px solid var(--cs-line);
    border-radius: 8px;
    padding: 0.9rem 1rem;
}

.cs-kpi__label {
    display: block;
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    color: var(--cs-muted);
    margin-bottom: 0.35rem;
}

.cs-kpi__value {
    display: block;
    font-size: 1.55rem;
    font-weight: 700;
    color: var(--cs-ink);
    line-height: 1.1;
}

.cs-kpi__sub {
    display: block;
    margin-top: 0.3rem;
    font-size: 0.76rem;
    color: var(--cs-muted);
    line-height: 1.4;
}

.cs-kpi--good .cs-kpi__value { color: var(--cs-good); }
.cs-kpi--warn .cs-kpi__value { color: var(--cs-warn); }
.cs-kpi--bad .cs-kpi__value { color: var(--cs-bad); }

/* -------------------------------------------------------------------- tables */

.cs-table__scroll {
    overflow-x: auto;
    /* Without this the table's nowrap cells force the flex/grid parent wider than the card and the
       last column is clipped with no scrollbar to reveal it. */
    max-width: 100%;
    min-width: 0;
    scrollbar-width: thin;
}

.cs-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.87rem;
}

/* Long account names wrap rather than widening the whole table. */
.cs-cell--wrap {
    white-space: normal;
    min-width: 11rem;
    max-width: 18rem;
}

.cs-cell--flags {
    white-space: normal;
    min-width: 9rem;
    text-align: left;
}

.cs-cell--flags .cs-chip { margin: 0 0.2rem 0.2rem 0; }

.cs-sort {
    appearance: none;
    border: none;
    background: none;
    padding: 0;
    margin: 0;
    font: inherit;
    color: inherit;
    letter-spacing: inherit;
    text-transform: inherit;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
}

.cs-sort:hover { color: var(--cs-brand); }
.cs-sort:focus-visible { outline: 2px solid var(--cs-brand); outline-offset: 2px; }
.cs-sort.is-active { color: var(--cs-brand); }

.cs-sort__arrow { font-size: 0.7em; opacity: 0.55; }
.cs-sort.is-active .cs-sort__arrow { opacity: 1; }

.cs-table th,
.cs-table td {
    padding: 0.6rem 0.7rem;
    text-align: right;
    border-bottom: 1px solid var(--cs-line);
    white-space: nowrap;
}

.cs-table th:first-child,
.cs-table td:first-child { text-align: left; }

.cs-table thead th {
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--cs-muted);
    border-bottom: 2px solid var(--cs-line);
    vertical-align: bottom;
}

.cs-table tbody tr:hover { background: var(--cs-wash); }

.cs-table td.cs-num--bad { color: var(--cs-bad); font-weight: 600; }
.cs-table td.cs-num--good { color: var(--cs-good); font-weight: 600; }

.cs-rowlink {
    appearance: none;
    border: none;
    background: none;
    padding: 0;
    font: inherit;
    color: var(--cs-brand);
    font-weight: 600;
    cursor: pointer;
    text-align: left;
}

.cs-rowlink:hover { text-decoration: underline; }
.cs-rowlink:focus-visible { outline: 2px solid var(--cs-brand); outline-offset: 2px; }

/* The info affordance on a metric header, matching the sandbox house pattern. */
.info-icon {
    appearance: none;
    border: none;
    background: none;
    padding: 0;
    margin-left: 0.3rem;
    font: inherit;
    font-size: 0.78rem;
    line-height: 1;
    color: var(--cs-brand);
    cursor: help;
    text-transform: none;
    letter-spacing: 0;
}

.info-icon:focus-visible { outline: 2px solid var(--cs-brand); outline-offset: 2px; }

/* ------------------------------------------------------------ column picker */

.cs-columns { position: relative; }

.cs-columns > summary {
    cursor: pointer;
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--cs-brand);
    padding: 0.35rem 0.6rem;
    border: 1px solid var(--cs-line);
    border-radius: 6px;
    list-style: none;
}

.cs-columns > summary::-webkit-details-marker { display: none; }

.cs-columns__body {
    position: absolute;
    right: 0;
    z-index: 20;
    margin-top: 0.35rem;
    min-width: 240px;
    max-height: 320px;
    overflow-y: auto;
    padding: 0.75rem;
    background: var(--cs-surface);
    border: 1px solid var(--cs-line);
    border-radius: 8px;
    box-shadow: 0 8px 24px rgba(28, 37, 54, 0.14);
}

.cs-check {
    display: flex;
    align-items: flex-start;
    gap: 0.45rem;
    font-size: 0.84rem;
    line-height: 1.4;
    padding: 0.25rem 0;
    cursor: pointer;
}

.cs-check input { margin-top: 0.15rem; }

/* -------------------------------------------------------------------- funnel */

.cs-funnel { display: flex; flex-direction: column; gap: 0.5rem; }

.cs-funnel__row {
    display: grid;
    grid-template-columns: 8.5rem 1fr 9rem;
    align-items: center;
    gap: 0.75rem;
}

.cs-funnel__label { font-size: 0.85rem; font-weight: 600; color: var(--cs-ink); }

.cs-funnel__track {
    background: var(--cs-wash);
    border-radius: 4px;
    height: 1.6rem;
    overflow: hidden;
}

.cs-funnel__bar {
    height: 100%;
    background: var(--cs-brand);
    border-radius: 4px;
}

.cs-funnel__row--worst .cs-funnel__bar { background: var(--cs-bad); }

.cs-funnel__stat { font-size: 0.8rem; color: var(--cs-muted); text-align: right; }

/* --------------------------------------------------------------------- board */

.cs-board {
    display: grid;
    grid-template-columns: repeat(5, minmax(170px, 1fr));
    gap: 0.75rem;
    overflow-x: auto;
}

.cs-col {
    background: var(--cs-wash);
    border-radius: 8px;
    padding: 0.6rem;
    min-width: 170px;
}

.cs-col__head { margin-bottom: 0.55rem; }

.cs-col__name {
    display: block;
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--cs-ink);
}

.cs-col__meta { display: block; font-size: 0.74rem; color: var(--cs-muted); margin-top: 0.15rem; }

.cs-deal {
    display: block;
    width: 100%;
    text-align: left;
    background: var(--cs-surface);
    border: 1px solid var(--cs-line);
    border-radius: 6px;
    padding: 0.5rem 0.6rem;
    margin-bottom: 0.45rem;
    cursor: pointer;
    font: inherit;
}

.cs-deal:hover { border-color: var(--cs-brand); }
.cs-deal:focus-visible { outline: 2px solid var(--cs-brand); outline-offset: 1px; }

.cs-deal--stalled { border-left: 3px solid var(--cs-bad); }

.cs-deal__name {
    display: block;
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--cs-ink);
    white-space: normal;
    line-height: 1.3;
}

.cs-deal__meta { display: block; font-size: 0.73rem; color: var(--cs-muted); margin-top: 0.25rem; }

.cs-col__more { font-size: 0.74rem; color: var(--cs-muted); margin: 0.3rem 0 0; }

/* --------------------------------------------------------------------- chips */

.cs-chip {
    display: inline-block;
    padding: 0.1rem 0.4rem;
    border-radius: 4px;
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.03em;
    text-transform: uppercase;
}

.cs-chip--bad { background: var(--cs-bad-soft); color: var(--cs-bad); }
.cs-chip--warn { background: var(--cs-warn-soft); color: var(--cs-warn); }
.cs-chip--good { background: var(--cs-good-soft); color: var(--cs-good); }
.cs-chip--neutral { background: var(--cs-wash); color: var(--cs-muted); }

/* --------------------------------------------------------------------- aging */

.cs-aging { display: flex; flex-direction: column; gap: 0.5rem; }

.cs-aging__row {
    display: grid;
    grid-template-columns: 7.5rem 1fr 11rem;
    align-items: center;
    gap: 0.75rem;
}

.cs-aging__label { font-size: 0.84rem; color: var(--cs-ink); }

.cs-aging__track { background: var(--cs-wash); border-radius: 4px; height: 1.4rem; overflow: hidden; }

.cs-aging__bar { height: 100%; background: var(--cs-brand); }

.cs-aging__stat { font-size: 0.79rem; color: var(--cs-muted); text-align: right; }

/* --------------------------------------------------------------- scorecards */

.cs-scorecards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1rem;
    margin-bottom: 1.25rem;
}

.cs-scorecard {
    background: var(--cs-surface);
    border: 1px solid var(--cs-line);
    border-radius: 8px;
    padding: 1rem 1.1rem;
}

.cs-scorecard__head {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 0.5rem;
    margin-bottom: 0.2rem;
}

.cs-scorecard__name { margin: 0; font-size: 1rem; color: var(--cs-ink); }

.cs-scorecard__title { font-size: 0.76rem; color: var(--cs-muted); margin: 0 0 0.75rem; }

.cs-scorecard__group {
    margin-top: 0.85rem;
    padding-top: 0.7rem;
    border-top: 1px solid var(--cs-line);
}

.cs-scorecard__grouplabel {
    display: block;
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    color: var(--cs-muted);
    margin-bottom: 0.45rem;
}

.cs-stat {
    display: flex;
    justify-content: space-between;
    gap: 0.75rem;
    font-size: 0.85rem;
    padding: 0.2rem 0;
}

.cs-stat__label { color: var(--cs-muted); }
.cs-stat__value { font-weight: 600; color: var(--cs-ink); }
.cs-stat__value--bad { color: var(--cs-bad); }
.cs-stat__value--good { color: var(--cs-good); }

.cs-scorecard__reading {
    margin: 0.85rem 0 0;
    font-size: 0.81rem;
    line-height: 1.5;
    color: var(--cs-ink);
    background: var(--cs-wash);
    border-radius: 6px;
    padding: 0.6rem 0.7rem;
}

/* ------------------------------------------------------------------- compare */

.cs-compare {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.9rem;
}

.cs-compare label { font-size: 0.85rem; color: var(--cs-muted); }

.cs-compare select {
    padding: 0.4rem 0.55rem;
    border: 1px solid var(--cs-line);
    border-radius: 6px;
    font-size: 0.88rem;
    background: var(--cs-surface);
    color: var(--cs-ink);
}

.cs-compare__out {
    font-size: 0.9rem;
    line-height: 1.6;
    padding: 0.9rem 1rem;
    border-radius: 6px;
    background: var(--cs-wash);
    border-left: 4px solid var(--cs-muted);
}

.cs-compare__out.is-resolved { border-left-color: var(--cs-good); background: var(--cs-good-soft); }
.cs-compare__out.is-unresolved { border-left-color: var(--cs-warn); background: var(--cs-warn-soft); }

.cs-compare__rates {
    display: flex;
    flex-wrap: wrap;
    gap: 1.25rem;
    margin-top: 0.6rem;
    font-size: 0.82rem;
    color: var(--cs-muted);
}

/* ------------------------------------------------------------------ my week */

.cs-budget {
    margin: 0;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--cs-ink);
    background: var(--cs-wash);
    border-radius: 6px;
    padding: 0.4rem 0.7rem;
}

.cs-budget--over { background: var(--cs-bad-soft); color: var(--cs-bad); }

.cs-table--week td { vertical-align: top; }

.cs-table--week td:last-child { white-space: normal; }

.cs-hours {
    width: 4.5rem;
    padding: 0.35rem 0.4rem;
    border: 1px solid var(--cs-line);
    border-radius: 6px;
    font-size: 0.88rem;
    text-align: right;
    color: var(--cs-ink);
}

.cs-hours:focus-visible { outline: 2px solid var(--cs-brand); outline-offset: 1px; }

.cs-week__nondeal { background: var(--cs-brand-soft); }
.cs-week__nondeal:hover { background: var(--cs-brand-soft); }

.cs-week__name { display: block; font-weight: 600; color: var(--cs-ink); white-space: normal; }

.cs-week__blurb {
    display: block;
    margin-top: 0.2rem;
    font-size: 0.76rem;
    font-weight: 400;
    color: var(--cs-muted);
    white-space: normal;
}

.cs-week__reason {
    font-size: 0.82rem;
    line-height: 1.5;
    color: var(--cs-muted);
    max-width: 34rem;
}

.cs-week__actions {
    display: flex;
    gap: 0.6rem;
    margin-top: 1rem;
}

.cs-btn {
    appearance: none;
    border: 1px solid var(--cs-brand);
    background: var(--cs-brand);
    color: #fff;
    font: inherit;
    font-size: 0.88rem;
    font-weight: 600;
    padding: 0.55rem 1.1rem;
    border-radius: 6px;
    cursor: pointer;
}

.cs-btn:hover { filter: brightness(1.08); }
.cs-btn:focus-visible { outline: 2px solid var(--cs-ink); outline-offset: 2px; }
.cs-btn:disabled { opacity: 0.5; cursor: not-allowed; }

.cs-btn--ghost { background: none; color: var(--cs-brand); }

.cs-findings { display: flex; flex-direction: column; gap: 0.7rem; margin-top: 1rem; }

.cs-finding {
    border-left: 4px solid var(--cs-muted);
    border-radius: 6px;
    padding: 0.75rem 0.9rem;
    background: var(--cs-wash);
}

.cs-finding--bad { border-left-color: var(--cs-bad); background: var(--cs-bad-soft); }
.cs-finding--warn { border-left-color: var(--cs-warn); background: var(--cs-warn-soft); }
.cs-finding--good { border-left-color: var(--cs-good); background: var(--cs-good-soft); }

.cs-finding__title { margin: 0 0 0.3rem; font-size: 0.92rem; color: var(--cs-ink); }

.cs-finding__detail { margin: 0; font-size: 0.85rem; line-height: 1.55; color: var(--cs-ink); }

/* ------------------------------------------------------------- coaching plan */

.cs-plan__reps {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1rem;
}

.cs-plan__rep {
    border: 1px solid var(--cs-line);
    border-radius: 8px;
    padding: 0.9rem 1rem;
}

.cs-plan__name { margin: 0 0 0.6rem; font-size: 1rem; color: var(--cs-ink); }

.cs-plan__signals {
    padding-bottom: 0.7rem;
    margin-bottom: 0.7rem;
    border-bottom: 1px solid var(--cs-line);
}

.cs-plan__choice label {
    display: block;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--cs-muted);
    margin-bottom: 0.3rem;
}

.cs-plan__select {
    width: 100%;
    padding: 0.45rem 0.6rem;
    border: 1px solid var(--cs-line);
    border-radius: 6px;
    background: var(--cs-surface);
    font-size: 0.87rem;
    color: var(--cs-ink);
}

.cs-plan__hint {
    margin: 0.4rem 0 0;
    font-size: 0.78rem;
    line-height: 1.45;
    color: var(--cs-muted);
    min-height: 1.2rem;
}

.cs-plan__deals {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 0.3rem 1rem;
}

.cs-plan__deal { align-items: flex-start; }

.cs-plan__evidence {
    margin: 0.6rem 0 0;
    padding-left: 1.1rem;
    font-size: 0.8rem;
    line-height: 1.5;
    color: var(--cs-ink);
}

/* ------------------------------------------------------------------- charts */

.cs-chartgrid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1rem;
    margin-bottom: 1.25rem;
}

.cs-chart {
    margin: 0;
    background: var(--cs-surface);
    border: 1px solid var(--cs-line);
    border-radius: 8px;
    padding: 0.9rem 1rem 1rem;
}

.cs-chart__title {
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.03em;
    text-transform: uppercase;
    color: var(--cs-muted);
    margin-bottom: 0.7rem;
}

.cs-chart__note {
    margin: 0.65rem 0 0;
    font-size: 0.76rem;
    line-height: 1.5;
    color: var(--cs-muted);
}

/* The palette lives here and nowhere else, so a bar and its number cannot drift apart. */
.cs-fill--brand { fill: var(--cs-brand); background: var(--cs-brand); }
.cs-fill--good { fill: var(--cs-good); background: var(--cs-good); }
.cs-fill--warn { fill: var(--cs-warn); background: var(--cs-warn); }
.cs-fill--bad { fill: var(--cs-bad); background: var(--cs-bad); }
.cs-fill--muted { fill: #aab3c0; background: #aab3c0; }

/* --- progress toward a target --- */

.cs-chart--progress svg { width: 100%; height: 2.6rem; display: block; }

.cs-chart__track { fill: var(--cs-wash); }

.cs-chart__pace {
    stroke: var(--cs-ink);
    stroke-width: 0.6;
    stroke-dasharray: 1.6 1.2;
}

.cs-chart__target { stroke: var(--cs-ink); stroke-width: 0.8; }

/* --- columns --- */

.cs-chart--columns svg { width: 100%; height: 5.5rem; display: block; }

.cs-chart__col.is-current { opacity: 0.75; }

.cs-chart__axis {
    display: flex;
    margin-top: 0.35rem;
    gap: 2px;
}

.cs-chart__tick {
    flex: 1 1 0;
    min-width: 0;
    text-align: center;
    display: flex;
    flex-direction: column;
    gap: 0.1rem;
}

.cs-chart__ticklabel {
    font-size: 0.66rem;
    color: var(--cs-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.cs-chart__tickvalue {
    font-size: 0.64rem;
    font-weight: 600;
    color: var(--cs-ink);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.cs-chart__tick.is-current .cs-chart__ticklabel,
.cs-chart__tick.is-current .cs-chart__tickvalue { color: var(--cs-warn); font-weight: 700; }

/* --- donut --- */

.cs-chart__donutbody {
    display: flex;
    align-items: center;
    gap: 1rem;
    flex-wrap: wrap;
}

.cs-chart__donutsvg { width: 7.5rem; height: 7.5rem; flex: none; }

.cs-chart__ring { fill: none; stroke: var(--cs-wash); stroke-width: 8; }

.cs-chart__center {
    font-size: 5px;
    font-weight: 700;
    fill: var(--cs-ink);
}

.cs-chart__centersub { font-size: 2.6px; fill: var(--cs-muted); }

/* --- legend --- */

.cs-legend {
    list-style: none;
    margin: 0.7rem 0 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    flex: 1 1 8rem;
    min-width: 0;
}

.cs-chart--donut .cs-legend { margin-top: 0; }

.cs-legend__item {
    display: flex;
    align-items: baseline;
    gap: 0.45rem;
    font-size: 0.78rem;
}

.cs-legend__swatch {
    width: 0.6rem;
    height: 0.6rem;
    border-radius: 2px;
    flex: none;
}

.cs-legend__label { color: var(--cs-muted); flex: 1 1 auto; min-width: 0; }

.cs-legend__value { font-weight: 600; color: var(--cs-ink); white-space: nowrap; }

/* --- ranked bars --- */

.cs-ranked { display: flex; flex-direction: column; gap: 0.4rem; }

.cs-ranked__row {
    display: grid;
    grid-template-columns: minmax(5rem, 9rem) 1fr minmax(4rem, auto);
    align-items: center;
    gap: 0.6rem;
}

.cs-ranked__label {
    font-size: 0.79rem;
    color: var(--cs-ink);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.cs-ranked__track {
    background: var(--cs-wash);
    border-radius: 3px;
    height: 0.85rem;
    overflow: hidden;
}

.cs-ranked__bar { display: block; height: 100%; border-radius: 3px; }

.cs-ranked__value {
    font-size: 0.76rem;
    font-weight: 600;
    color: var(--cs-ink);
    text-align: right;
    white-space: nowrap;
}

/* --- territory map --- */

.cs-mapcard__body {
    display: grid;
    grid-template-columns: minmax(260px, 0.9fr) minmax(280px, 1.1fr);
    gap: 1.25rem;
    align-items: start;
}

.cs-mapcard__side { min-width: 0; }

.cs-mapcard .cs-chart {
    border: none;
    padding: 0;
    background: none;
}

.cs-travel { margin-top: 1rem; }

.cs-travel .cs-chart__title { margin-bottom: 0.45rem; }

.cs-table--compact th,
.cs-table--compact td { padding: 0.4rem 0.5rem; font-size: 0.8rem; }

@media (max-width: 860px) {
    .cs-mapcard__body { grid-template-columns: 1fr; }
}

/* One hue per rep. Kept distinguishable in the common forms of colour blindness, and never the
   only signal: the map's tooltips and legend carry the same information as text. */
.cs-fill--rep0 { fill: #1a5fb4; background: #1a5fb4; }
.cs-fill--rep1 { fill: #b8860b; background: #b8860b; }
.cs-fill--rep2 { fill: #1f7a4d; background: #1f7a4d; }
.cs-fill--rep3 { fill: #8b3a8b; background: #8b3a8b; }

/* `color` is set alongside `stroke` so the patch fill can inherit it via currentColor. */
.cs-stroke--rep0 { stroke: #1a5fb4; color: #1a5fb4; }
.cs-stroke--rep1 { stroke: #b8860b; color: #b8860b; }
.cs-stroke--rep2 { stroke: #1f7a4d; color: #1f7a4d; }
.cs-stroke--rep3 { stroke: #8b3a8b; color: #8b3a8b; }
.cs-stroke--brand { stroke: var(--cs-brand); color: var(--cs-brand); }
.cs-stroke--muted { stroke: #aab3c0; color: #aab3c0; }

.cs-chart--map .cs-map {
    width: 100%;
    height: auto;
    max-height: 62vh;
    display: block;
    background: #f7f9fc;
    border: 1px solid var(--cs-line);
    border-radius: 6px;
}

.cs-map__state {
    fill: #eef2f8;
    stroke: #c3ccda;
    stroke-width: 0.22;
    stroke-linejoin: round;
}

.cs-map__base {
    stroke: #fff;
    stroke-width: 0.35;
    fill-opacity: 1;
}

.cs-map__patch {
    fill: currentColor;
    fill-opacity: 0.07;
    stroke-width: 0.35;
    stroke-dasharray: 1.4 1;
    stroke-opacity: 0.7;
}

.cs-map__dot { fill-opacity: 0.82; stroke: #fff; stroke-width: 0.3; }

.cs-map__label {
    font-size: 2.1px;
    fill: var(--cs-ink);
    font-weight: 600;
    paint-order: stroke;
    stroke: #fff;
    stroke-width: 0.5px;
}

/* -------------------------------------------------------------------- drawer */

.cs-drawer {
    position: fixed;
    inset: 0;
    z-index: 9000;
    background: rgba(28, 37, 54, 0.45);
    display: flex;
    justify-content: flex-end;
}

.cs-drawer[hidden] { display: none; }

.cs-drawer__panel {
    width: min(560px, 100%);
    height: 100%;
    background: var(--cs-surface);
    overflow-y: auto;
    box-shadow: -8px 0 24px rgba(28, 37, 54, 0.2);
}

.cs-drawer__head {
    position: sticky;
    top: 0;
    background: var(--cs-surface);
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 0.75rem;
    padding: 1.1rem 1.25rem 0.85rem;
    border-bottom: 1px solid var(--cs-line);
}

.cs-drawer__head h2 { margin: 0; font-size: 1.02rem; line-height: 1.35; color: var(--cs-ink); }

.cs-drawer__close {
    appearance: none;
    border: none;
    background: none;
    font-size: 1.6rem;
    line-height: 1;
    color: var(--cs-muted);
    cursor: pointer;
    padding: 0 0.25rem;
}

.cs-drawer__close:hover { color: var(--cs-ink); }
.cs-drawer__close:focus-visible { outline: 2px solid var(--cs-brand); outline-offset: 2px; }

.cs-drawer__body { padding: 1.1rem 1.25rem 2rem; }

.cs-drawer__section { margin-bottom: 1.35rem; }

.cs-drawer__section h3 {
    margin: 0 0 0.5rem;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    color: var(--cs-muted);
}

.cs-timeline { list-style: none; margin: 0; padding: 0; }

.cs-timeline li {
    display: grid;
    grid-template-columns: 6.5rem 1fr;
    gap: 0.6rem;
    padding: 0.35rem 0;
    border-bottom: 1px solid var(--cs-line);
    font-size: 0.83rem;
}

.cs-timeline__when { color: var(--cs-muted); }

.cs-empty {
    font-size: 0.85rem;
    color: var(--cs-muted);
    padding: 1rem 0;
    margin: 0;
}

@media (max-width: 760px) {
    .cs-board { grid-template-columns: repeat(5, 170px); }
    .cs-funnel__row { grid-template-columns: 6.5rem 1fr; }
    .cs-funnel__stat { grid-column: 1 / -1; text-align: left; }
    .cs-toolbar__asof { margin-left: 0; }
}

@media print {
    .cs-tabs, .cs-toolbar, .cs-columns, .cs-drawer { display: none; }
}
