/*
 * Sprint Enterprise Technology — base stylesheet
 *
 * Drop-in CSS for any Sprint web surface. Include after tokens.css:
 *
 *   <link rel="stylesheet" href="tokens.css">
 *   <link rel="stylesheet" href="sprint.css">
 *
 * Optionally append a product theme:
 *
 *   <link rel="stylesheet" href="sprint-finio.css">
 *
 * Or scope a theme to a region:
 *
 *   <section data-theme="fastrak"> ... </section>
 */

/* ----- Modern reset ----- */
*,
*::before,
*::after {
    box-sizing: border-box;
}

* {
    margin: 0;
}

html {
    -webkit-text-size-adjust: 100%;
    text-size-adjust: 100%;
}

body {
    min-height: 100vh;
    font-family: var(--font-family-base);
    font-size: var(--font-size-base);
    line-height: var(--line-height-base);
    color: var(--color-text);
    background-color: var(--color-background);
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
}

img,
picture,
video,
canvas,
svg {
    display: block;
    max-width: 100%;
}

input,
button,
textarea,
select {
    font: inherit;
    color: inherit;
}

/* ----- Headings ----- */
h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-family-heading);
    font-weight: var(--font-weight-bold);
    line-height: var(--line-height-tight);
    color: var(--color-text);
}

h1 { font-size: var(--font-size-3xl); }
h2 { font-size: var(--font-size-2xl); }
h3 { font-size: var(--font-size-xl); }
h4 { font-size: var(--font-size-lg); font-weight: var(--font-weight-semibold); }
h5 { font-size: var(--font-size-md); font-weight: var(--font-weight-semibold); }
h6 {
    font-size: var(--font-size-sm);
    font-weight: var(--font-weight-semibold);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

/* ----- Block text ----- */
p {
    line-height: var(--line-height-base);
    max-width: 70ch;
}

small {
    font-size: var(--font-size-sm);
}

strong, b {
    font-weight: var(--font-weight-semibold);
}

/* ----- Links ----- */
a {
    color: var(--color-link);
    text-decoration: underline;
    text-underline-offset: 0.15em;
    transition: color var(--transition-fast);
}

a:hover {
    color: var(--color-link-hover);
}

a:focus-visible {
    outline: none;
    box-shadow: var(--focus-ring);
    border-radius: var(--radius-sm);
}

/* ----- Lists ----- */
ul, ol {
    padding-left: var(--space-5);
    line-height: var(--line-height-base);
}

li + li {
    margin-top: var(--space-1);
}

/* ----- Code ----- */
code, kbd, samp, pre {
    font-family: "SFMono-Regular", "Consolas", "Liberation Mono", monospace;
    font-size: 0.9em;
}

code {
    background-color: var(--color-surface-alt);
    padding: 0.1em 0.35em;
    border-radius: var(--radius-sm);
}

pre {
    background-color: var(--color-surface-alt);
    padding: var(--space-4);
    border-radius: var(--radius-md);
    overflow-x: auto;
    line-height: var(--line-height-snug);
}

pre code {
    background: none;
    padding: 0;
}

/* ----- Horizontal rule ----- */
hr {
    border: none;
    border-top: var(--border-default);
    margin: var(--space-5) 0;
}

/* ----- Container ----- */
.sprint-container {
    width: 100%;
    max-width: var(--container-max);
    margin-inline: auto;
    padding-inline: var(--space-5);
}

/* ----- Buttons ----- */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-2);
    font-family: var(--font-family-base);
    font-size: var(--font-size-base);
    font-weight: var(--font-weight-semibold);
    line-height: 1;
    padding: var(--space-3) var(--space-5);
    border: var(--border-width) solid transparent;
    border-radius: var(--radius-md);
    background-color: transparent;
    color: var(--color-text);
    cursor: pointer;
    text-decoration: none;
    transition:
        background-color var(--transition-fast),
        border-color var(--transition-fast),
        color var(--transition-fast);
}

.btn:focus-visible {
    outline: none;
    box-shadow: var(--focus-ring);
}

.btn:disabled,
.btn[aria-disabled="true"] {
    opacity: 0.55;
    cursor: not-allowed;
}

/*
 * Primary CTA — the only place lime green should appear.
 * One per screen, ideally. See brand-guidelines.md §2.4.
 */
.btn-primary {
    background-color: var(--color-cta);
    color: var(--color-cta-text);
    border-color: var(--color-cta);
}

.btn-primary:hover:not(:disabled) {
    background-color: var(--color-cta-hover);
    border-color: var(--color-cta-hover);
    color: var(--color-text-inverse);
}

/*
 * Secondary CTA — the supporting action that sits beside the primary CTA
 * (e.g. "Export CSV" next to "Sync from Transact"). Lime as an *outline*
 * only; the lime *fill* stays reserved for the single primary CTA. See
 * brand-guidelines.md § rule 1.
 */
.btn-secondary {
    background-color: transparent;
    color: var(--color-text);
    border-color: var(--color-cta);
}

.btn-secondary:hover:not(:disabled) {
    background-color: var(--color-surface-alt);
    border-color: var(--color-cta-hover);
}

.btn-tertiary {
    background-color: transparent;
    color: var(--color-link);
    border-color: transparent;
    padding-inline: var(--space-2);
}

.btn-tertiary:hover:not(:disabled) {
    color: var(--color-link-hover);
    background-color: var(--color-surface-alt);
}

.btn-danger {
    background-color: var(--color-danger);
    color: var(--color-text-inverse);
    border-color: var(--color-danger);
}

.btn-danger:hover:not(:disabled) {
    background-color: #B53A3A;
    border-color: #B53A3A;
}

/* ----- Forms ----- */
.form-field {
    display: flex;
    flex-direction: column;
    gap: var(--space-2);
    margin-bottom: var(--space-4);
}

.form-label {
    font-size: var(--font-size-sm);
    font-weight: var(--font-weight-semibold);
    color: var(--color-text);
}

.form-control {
    width: 100%;
    padding: var(--space-3) var(--space-3);
    font-size: var(--font-size-base);
    color: var(--color-text);
    background-color: var(--color-surface);
    border: var(--border-width) solid var(--color-border);
    border-radius: var(--radius-md);
    transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}

.form-control:focus {
    outline: none;
    border-color: var(--color-accent);
    box-shadow: var(--focus-ring);
}

.form-control:disabled {
    background-color: var(--color-surface-alt);
    cursor: not-allowed;
}

.form-help {
    font-size: var(--font-size-sm);
    color: var(--color-text-muted);
}

.form-error {
    font-size: var(--font-size-sm);
    color: var(--color-danger);
}

/* ----- Cards ----- */
.card {
    background-color: var(--color-surface);
    border: var(--border-default);
    border-radius: var(--radius-lg);
    padding: var(--space-5);
    box-shadow: var(--shadow-sm);
}

.card-title {
    font-size: var(--font-size-lg);
    font-weight: var(--font-weight-semibold);
    margin-bottom: var(--space-2);
}

.card-body > * + * {
    margin-top: var(--space-3);
}

/* ----- Alerts ----- */
/* Always pair the colour with an icon or label — accessibility §4. */
.alert {
    display: flex;
    gap: var(--space-3);
    padding: var(--space-4);
    border: var(--border-width) solid transparent;
    border-left-width: 4px;
    border-radius: var(--radius-md);
    background-color: var(--color-surface-alt);
}

.alert-success { border-left-color: var(--color-success); }
.alert-warning { border-left-color: var(--color-warning); }
.alert-danger  { border-left-color: var(--color-danger);  }
.alert-info    { border-left-color: var(--sprint-blue);   }

/* ----- Tables ----- */
.table {
    width: 100%;
    border-collapse: collapse;
    font-size: var(--font-size-sm);
}

.table th,
.table td {
    text-align: left;
    padding: var(--space-3) var(--space-4);
    border-bottom: var(--border-default);
}

.table th {
    font-weight: var(--font-weight-semibold);
    background-color: var(--color-surface-alt);
}

.table tbody tr:hover {
    background-color: var(--color-surface-alt);
}

/*
 * ----- Badges -----
 * A status badge reads as a label, not a button: a neutral pill with
 * charcoal title-case text. Colour is carried by an optional leading dot,
 * never a solid fill (that read as a button). The text label always states
 * the meaning, so the dot only reinforces it — never colour alone (§ rule 5).
 *
 * The dot defaults to charcoal — the neutral / "platform" colour. Override it
 * for a specific platform identity by setting --badge-dot inline, e.g.
 * style="--badge-dot: #2F5D8C" for intelliflo's brand blue. The status
 * modifiers below set --badge-dot to the function colours.
 */
.badge {
    display: inline-flex;
    align-items: center;
    gap: var(--space-2);
    font-size: var(--font-size-xs);
    font-weight: var(--font-weight-semibold);
    padding: var(--space-1) var(--space-3);
    border-radius: var(--radius-pill);
    background-color: var(--color-surface-alt);
    color: var(--color-text);
}

.badge-dot {
    width: 0.5rem;
    height: 0.5rem;
    border-radius: var(--radius-pill);
    background-color: var(--badge-dot, var(--color-text));   /* charcoal in light, light in dark */
    flex-shrink: 0;
}

.badge-success { --badge-dot: var(--color-success); }
.badge-warning { --badge-dot: var(--color-warning); }
.badge-danger  { --badge-dot: var(--color-danger); }

/* ----- Switch (toggle) ----- */
.switch {
    display: inline-flex;
    align-items: center;
    gap: var(--space-3);
    cursor: pointer;
    user-select: none;
}

.switch input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.switch-track {
    position: relative;
    display: inline-block;
    width: 40px;
    height: 22px;
    background-color: var(--sprint-grey-300);
    border-radius: var(--radius-pill);
    transition: background-color var(--transition-fast);
}

.switch-thumb {
    position: absolute;
    top: 2px;
    left: 2px;
    width: 18px;
    height: 18px;
    background-color: var(--color-surface);
    border-radius: 50%;
    box-shadow: var(--shadow-sm);
    transition: transform var(--transition-fast);
}

.switch input:checked + .switch-track {
    background-color: var(--color-accent);
}

.switch input:checked + .switch-track .switch-thumb {
    transform: translateX(18px);
}

.switch input:focus-visible + .switch-track {
    box-shadow: var(--focus-ring);
}

.switch input:disabled + .switch-track {
    opacity: 0.5;
    cursor: not-allowed;
}

/* ----- Checkbox (custom) ----- */
.checkbox,
.radio {
    display: inline-flex;
    align-items: center;
    gap: var(--space-3);
    cursor: pointer;
    user-select: none;
}

.checkbox input,
.radio input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.checkbox-control,
.radio-control {
    position: relative;
    display: inline-block;
    width: 18px;
    height: 18px;
    background-color: var(--color-surface);
    border: var(--border-width) solid var(--color-border);
    transition: background-color var(--transition-fast), border-color var(--transition-fast);
    flex-shrink: 0;
}

.checkbox-control { border-radius: var(--radius-sm); }
.radio-control    { border-radius: 50%; }

.checkbox input:checked + .checkbox-control,
.radio input:checked + .radio-control {
    background-color: var(--color-accent);
    border-color: var(--color-accent);
}

/* Checkbox tick */
.checkbox input:checked + .checkbox-control::after {
    content: "";
    position: absolute;
    top: 1px;
    left: 5px;
    width: 5px;
    height: 10px;
    border: solid var(--color-text-inverse);
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
}

/* Radio inner dot */
.radio input:checked + .radio-control::after {
    content: "";
    position: absolute;
    top: 4px;
    left: 4px;
    width: 8px;
    height: 8px;
    background-color: var(--color-text-inverse);
    border-radius: 50%;
}

.checkbox input:focus-visible + .checkbox-control,
.radio input:focus-visible + .radio-control {
    box-shadow: var(--focus-ring);
}

.checkbox input:disabled ~ *,
.radio input:disabled ~ * {
    opacity: 0.5;
    cursor: not-allowed;
}

/* ----- Tabs ----- */
.tabs {
    display: flex;
    gap: var(--space-1);
    border-bottom: var(--border-default);
    margin-bottom: var(--space-4);
}

.tab {
    appearance: none;
    background: none;
    border: none;
    padding: var(--space-3) var(--space-4);
    font-family: var(--font-family-base);
    font-size: var(--font-size-base);
    font-weight: var(--font-weight-semibold);
    color: var(--color-text-muted);
    cursor: pointer;
    border-bottom: 2px solid transparent;
    margin-bottom: -1px;
    transition: color var(--transition-fast), border-color var(--transition-fast);
}

.tab:hover {
    color: var(--color-text);
}

.tab[aria-selected="true"],
.tab.active {
    color: var(--color-text);
    border-bottom-color: var(--color-accent);
}

.tab:focus-visible {
    outline: none;
    box-shadow: var(--focus-ring);
    border-radius: var(--radius-sm);
}

.tab-panel {
    padding: var(--space-4) 0;
}

/* ----- Breadcrumbs ----- */
.breadcrumbs {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: var(--space-2);
    font-size: var(--font-size-sm);
    color: var(--color-text-muted);
}

.breadcrumbs a {
    color: var(--color-text-muted);
    text-decoration: none;
}

.breadcrumbs a:hover {
    color: var(--color-link-hover);
    text-decoration: underline;
}

.breadcrumbs [aria-current="page"] {
    color: var(--color-text);
    font-weight: var(--font-weight-semibold);
}

.breadcrumb-separator {
    color: var(--sprint-grey-300);
    user-select: none;
}

/* ----- Pagination ----- */
.pagination {
    display: inline-flex;
    align-items: center;
    gap: var(--space-1);
}

.page-btn {
    appearance: none;
    background: var(--color-surface);
    border: var(--border-default);
    color: var(--color-text);
    font-family: var(--font-family-base);
    font-size: var(--font-size-sm);
    font-weight: var(--font-weight-semibold);
    min-width: 36px;
    height: 36px;
    padding: 0 var(--space-2);
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: background-color var(--transition-fast), border-color var(--transition-fast);
}

.page-btn:hover:not(:disabled):not([aria-current="page"]) {
    background-color: var(--color-surface-alt);
    border-color: var(--sprint-grey-300);
}

.page-btn[aria-current="page"] {
    background-color: var(--color-accent);
    border-color: var(--color-accent);
    color: var(--color-text-inverse);
    cursor: default;
}

.page-btn:focus-visible {
    outline: none;
    box-shadow: var(--focus-ring);
}

.page-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.page-ellipsis {
    color: var(--color-text-muted);
    padding: 0 var(--space-1);
}

/* ----- Progress bar ----- */
.progress {
    width: 100%;
    height: 8px;
    background-color: var(--color-surface-alt);
    border-radius: var(--radius-pill);
    overflow: hidden;
}

.progress-bar {
    height: 100%;
    background-color: var(--color-accent);
    border-radius: inherit;
    transition: width var(--transition-base);
}

.progress-bar.success { background-color: var(--color-success); }
.progress-bar.warning { background-color: var(--color-warning); }
.progress-bar.danger  { background-color: var(--color-danger);  }

/*
 * Optional text around a progress bar. Caption sits above ("Processing…"),
 * the meta row below carries count and percentage ("1 of 2" / "50%"). Both
 * are muted small text so the bar stays the focus.
 */
.progress-label {
    display: block;
    margin-bottom: var(--space-2);
    font-size: var(--font-size-sm);
    color: var(--color-text-muted);
}

.progress-meta {
    display: flex;
    justify-content: space-between;
    margin-top: var(--space-2);
    font-size: var(--font-size-sm);
    color: var(--color-text-muted);
}

/* ----- Spinner ----- */
.spinner {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 2px solid var(--color-border);
    border-top-color: var(--color-accent);
    border-radius: 50%;
    animation: sprint-spin 600ms linear infinite;
}

.spinner.lg { width: 40px; height: 40px; border-width: 3px; }
.spinner.sm { width: 14px; height: 14px; border-width: 2px; }

@keyframes sprint-spin {
    to { transform: rotate(360deg); }
}

/* ----- Chip ----- */
/* A small interactive value pill. Distinct from .badge — chips hold a value
   (often selected from a list) and can be removed; badges convey status. */
.chip {
    display: inline-flex;
    align-items: center;
    gap: var(--space-2);
    padding: var(--space-1) var(--space-3);
    background-color: var(--color-surface-alt);
    border: var(--border-default);
    border-radius: var(--radius-pill);
    font-size: var(--font-size-sm);
    color: var(--color-text);
    line-height: 1.4;
}

.chip-remove {
    appearance: none;
    background: none;
    border: none;
    padding: 0;
    width: 18px;
    height: 18px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    color: var(--color-text-muted);
    font-size: 16px;
    line-height: 1;
    cursor: pointer;
    transition: background-color var(--transition-fast), color var(--transition-fast);
}

.chip-remove:hover {
    background-color: var(--sprint-grey-300);
    color: var(--color-text);
}

.chip-remove:focus-visible {
    outline: none;
    box-shadow: var(--focus-ring);
}

/* ----- Multiselect ----- */
.multiselect {
    border: var(--border-default);
    border-radius: var(--radius-md);
    background-color: var(--color-surface);
    overflow: hidden;
}

.multiselect-chips {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-2);
    padding: var(--space-3);
    border-bottom: var(--border-default);
    min-height: 52px;
    background-color: var(--color-surface-alt);
}

.multiselect-chips:empty::before {
    content: attr(data-empty);
    color: var(--color-text-muted);
    font-size: var(--font-size-sm);
}

.multiselect-search {
    display: block;
    width: 100%;
    padding: var(--space-3);
    border: none;
    border-bottom: var(--border-default);
    background-color: var(--color-surface);
    color: var(--color-text);
    font-family: var(--font-family-base);
    font-size: var(--font-size-base);
}

.multiselect-search:focus {
    outline: none;
    border-bottom-color: var(--color-accent);
}

.multiselect-options {
    max-height: 220px;
    overflow-y: auto;
    padding: var(--space-2);
}

.multiselect-options .checkbox {
    display: flex;
    width: 100%;
    padding: var(--space-2) var(--space-3);
    border-radius: var(--radius-sm);
    transition: background-color var(--transition-fast);
}

.multiselect-options .checkbox:hover {
    background-color: var(--color-surface-alt);
}

/* ----- Tooltip (CSS-only via data-tooltip) ----- */
.tooltip-host {
    position: relative;
    display: inline-block;
    cursor: help;
    border-bottom: 1px dotted var(--color-text-muted);
}

.tooltip-host::after,
.tooltip-host::before {
    position: absolute;
    bottom: calc(100% + 8px);
    left: 50%;
    opacity: 0;
    pointer-events: none;
    transition: opacity var(--transition-fast);
}

.tooltip-host::after {
    content: attr(data-tooltip);
    transform: translateX(-50%);
    padding: var(--space-2) var(--space-3);
    background-color: var(--sprint-charcoal);
    color: var(--color-text-inverse);
    font-size: var(--font-size-xs);
    font-weight: var(--font-weight-regular);
    line-height: 1.4;
    border-radius: var(--radius-md);
    white-space: nowrap;
    max-width: 240px;
    z-index: 10;
}

.tooltip-host::before {
    content: "";
    transform: translateX(-50%);
    border: 4px solid transparent;
    border-top-color: var(--sprint-charcoal);
    bottom: calc(100% + 4px);
}

.tooltip-host:hover::after,
.tooltip-host:hover::before,
.tooltip-host:focus-visible::after,
.tooltip-host:focus-visible::before {
    opacity: 1;
}

/* ----- Utility: visually-hidden (accessibility) ----- */
.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/*
 * ----- App bar -----
 * The charcoal top bar: product logo + page title in white. An optional
 * context sub-banner below it carries record context (Client / Plan) and
 * uses the product accent — this is product-identity chrome, the one place
 * the accent legitimately fills a banner (neutral widget headers stay
 * charcoal; see brand-guidelines.md).
 */
.app-bar {
    display: flex;
    align-items: center;
    gap: var(--space-5);
    padding: var(--space-3) var(--space-5);
    background-color: var(--sprint-charcoal);
    /* Fixed white, not --color-text-inverse: the bar is charcoal in every theme
       (including dark mode), so its foreground must not flip with the theme. */
    color: var(--sprint-white);
    border-radius: 0;   /* full-bleed chrome — square corners, never rounded */
}

.app-bar-logo {
    display: flex;
    align-items: center;
    flex-shrink: 0;
}

.app-bar-logo img { display: block; height: 32px; }

.app-bar-title {
    margin: 0;
    font-size: var(--font-size-lg);
    font-weight: var(--font-weight-semibold);
    color: var(--sprint-white);
}

/* Right-aligned actions / account area */
.app-bar-actions { margin-left: auto; display: flex; align-items: center; gap: var(--space-3); }

.app-bar-context {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-2) var(--space-5);
    padding: var(--space-2) var(--space-5);
    background-color: var(--color-accent);
    color: var(--sprint-white);
    font-size: var(--font-size-sm);
}

.app-bar-context strong { font-weight: var(--font-weight-semibold); }

/*
 * App bar nav — categorised dropdown menus for section navigation. The CSS is
 * presentational; wire the open/close behaviour with a disclosure script (see
 * the snippet in the style guide) or your framework's menu (MudMenu for
 * Blazor). Buttons are fixed white because they sit on the charcoal bar.
 */
.app-nav {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-1);
}

.nav-menu { position: relative; }

.nav-menu-button {
    appearance: none;
    background: transparent;
    border: none;
    color: var(--sprint-white);
    font: inherit;
    font-size: var(--font-size-sm);
    font-weight: var(--font-weight-medium);
    display: inline-flex;
    align-items: center;
    gap: var(--space-1);
    padding: var(--space-2) var(--space-3);
    border-radius: var(--radius-md);
    cursor: pointer;
    white-space: nowrap;
    transition: background-color var(--transition-fast);
}

.nav-menu-button:hover,
.nav-menu-button[aria-expanded="true"] { background-color: rgba(255, 255, 255, 0.12); }
.nav-menu-button:focus-visible { outline: none; box-shadow: var(--focus-ring); }

.nav-caret { font-size: 0.7em; transition: transform var(--transition-fast); }
.nav-caret::before { content: "\25BE"; }   /* down triangle via CSS escape — encoding-safe */
.nav-menu-button[aria-expanded="true"] .nav-caret { transform: rotate(180deg); }

.nav-menu-panel {
    position: absolute;
    top: calc(100% + var(--space-1));
    left: 0;
    min-width: 190px;
    display: none;
    flex-direction: column;
    padding: var(--space-2);
    background-color: var(--color-surface);
    border: var(--border-default);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
    z-index: 50;
}

.nav-menu-panel[data-open="true"] { display: flex; }

.nav-menu-panel a {
    display: block;
    padding: var(--space-2) var(--space-3);
    border-radius: var(--radius-sm);
    font-size: var(--font-size-sm);
    text-decoration: none;
    color: var(--color-text);
    white-space: nowrap;
}

.nav-menu-panel a:hover { background-color: var(--color-surface-alt); }

/*
 * ----- Calendar -----
 * Presentational only — the date grid is static markup. Wire month
 * navigation, selection and date logic with your framework's date picker
 * (see the modal note: rendering logic is framework territory).
 *
 * The year banner is charcoal (neutral widget chrome, not the product
 * accent) and deliberately shallow. The selected day is marked with a ring,
 * not a fill — meaning never rests on colour alone (§ rule 5).
 */
.calendar {
    background-color: var(--color-surface);
    border: var(--border-default);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    overflow: hidden;
    max-width: 760px;
}

.calendar-banner {
    padding: var(--space-2) var(--space-5);
    background-color: var(--sprint-charcoal);
    color: var(--color-text-inverse);
    font-weight: var(--font-weight-semibold);
}

.calendar-months {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-6);
    padding: var(--space-5);
}

.calendar-month { flex: 1 1 280px; }

/* Prev / centred label / next — empty slots keep the label centred. */
.calendar-month-header {
    display: grid;
    grid-template-columns: 28px 1fr 28px;
    align-items: center;
    margin-bottom: var(--space-4);
    font-weight: var(--font-weight-medium);
}

.calendar-month-label { text-align: center; }

.calendar-nav {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border: none;
    border-radius: var(--radius-md);
    background-color: transparent;
    color: var(--color-text);
    cursor: pointer;
    transition: background-color var(--transition-fast);
}

.calendar-nav:hover:not(:disabled) { background-color: var(--color-surface-alt); }
.calendar-nav:focus-visible { outline: none; box-shadow: var(--focus-ring); }

.calendar-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: var(--space-1);
    text-align: center;
}

.calendar-weekday {
    font-size: var(--font-size-xs);
    color: var(--color-text-muted);
    padding-bottom: var(--space-2);
}

.calendar-day {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    margin: 0 auto;
    border: 2px solid transparent;
    border-radius: var(--radius-pill);
    font-size: var(--font-size-sm);
    color: var(--color-text);
    background: none;
    cursor: pointer;
    transition: background-color var(--transition-fast);
}

.calendar-day:hover:not(:disabled):not(.is-selected) { background-color: var(--color-surface-alt); }
.calendar-day:focus-visible { outline: none; box-shadow: var(--focus-ring); }

/* Selected — charcoal ring, not a fill. */
.calendar-day.is-selected {
    border-color: var(--sprint-charcoal);
    font-weight: var(--font-weight-semibold);
}

.calendar-day.is-muted { color: var(--color-text-muted); }
.calendar-day:disabled { color: var(--color-text-muted); cursor: not-allowed; }

/* ----- Reduced motion ----- */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}
