/* ============================================================
   components.css — All reusable UI components
   ============================================================ */

/* ── Page header ── */
.page-header {
    margin-bottom: var(--space-6);
}

.page-header__title {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--color-text);
    line-height: 1.25;
}

.page-header__subtitle {
    margin-top: var(--space-1);
    font-size: 0.875rem;
    color: var(--color-text-muted);
}

/* ── Metric grid ── */
.metric-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: var(--space-4);
    margin-bottom: var(--space-6);
}

@media (min-width: 640px) {
    .metric-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (min-width: 1280px) {
    .metric-grid {
        grid-template-columns: repeat(4, 1fr);
    }

    .metric-grid--2 {
        grid-template-columns: repeat(2, 1fr);
    }

    .metric-grid--3 {
        grid-template-columns: repeat(3, 1fr);
    }
}

/* ── Metric card ── */
.metric-card {
    display: flex;
    align-items: flex-start;
    gap: var(--space-4);
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    padding: var(--space-4) var(--space-5);
    box-shadow: var(--shadow-sm);
}

.metric-card__icon {
    flex-shrink: 0;
    width: 40px;
    height: 40px;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
}

.metric-card__body {
    min-width: 0;
    flex: 1;
}

.metric-card__label {
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--color-text-muted);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.metric-card__value {
    margin-top: var(--space-1);
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--color-text);
    font-variant-numeric: tabular-nums;
}

/* Accent modifiers */
.metric-card--blue   .metric-card__icon { background: var(--color-accent-blue-bg);   color: var(--color-accent-blue-fg); }
.metric-card--green  .metric-card__icon { background: var(--color-accent-green-bg);  color: var(--color-accent-green-fg); }
.metric-card--yellow .metric-card__icon { background: var(--color-accent-yellow-bg); color: var(--color-accent-yellow-fg); }
.metric-card--purple .metric-card__icon { background: var(--color-accent-purple-bg); color: var(--color-accent-purple-fg); }
.metric-card--rose   .metric-card__icon { background: var(--color-accent-rose-bg);   color: var(--color-accent-rose-fg); }
.metric-card--indigo .metric-card__icon { background: var(--color-accent-indigo-bg); color: var(--color-accent-indigo-fg); }
.metric-card--teal   .metric-card__icon { background: var(--color-accent-teal-bg);   color: var(--color-accent-teal-fg); }

.metric-card__subtitle {
    margin-top: var(--space-1);
    font-size: 0.75rem;
    color: var(--color-text-muted);
    opacity: 0.75;
}

/* Delta indicator inside a metric card value */
.metric-card__delta {
    font-size: 0.75rem;
    font-weight: 600;
    margin-left: 0.35rem;
    opacity: 0.8;
}
.metric-card__delta--up   { color: #16a34a; }
.metric-card__delta--down { color: #e11d48; }

/* Per-metric CSV download link (owner Reports page). Quiet until the card is hovered
   or the link is focused, so seven download links never compete with the numbers. */
.metric-card__csv {
    display: inline-block;
    margin-top: var(--space-2);
    font-size: 0.7rem;
    font-weight: 600;
    letter-spacing: 0.02em;
    color: var(--color-text-muted);
    text-decoration: none;
    opacity: 0.55;
    transition: opacity 0.15s ease, color 0.15s ease;
}
.metric-card:hover .metric-card__csv,
.metric-card__csv:hover,
.metric-card__csv:focus-visible {
    opacity: 1;
    color: var(--color-primary);
    text-decoration: underline;
}

/* ── Content surface (card) ── */
.surface {
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    overflow: hidden;
}

.surface__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: var(--space-4) var(--space-5);
    border-bottom: 1px solid var(--color-border);
}

.surface__header-title {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--color-text-muted);
}
.surface__header-subtitle {
    font-size: 0.875rem;
    font-weight: 400;
    color: var(--color-text-muted);
}

.surface__body {
    padding: var(--space-5) var(--space-6);
}

.surface__body--centered {
    text-align: center;
    padding: var(--space-10) var(--space-6);
}

.surface__body--centered h2 {
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--color-text);
    margin-bottom: var(--space-2);
}

.surface__body--centered p {
    font-size: 0.875rem;
    color: var(--color-text-muted);
    max-width: 320px;
    margin-inline: auto;
}

.surface__empty-icon {
    font-size: 2.5rem;
    margin-bottom: var(--space-4);
}

/* ── Data table ── */
.table-wrapper {
    overflow-x: auto;
}

.table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.875rem;
    color: var(--color-text-muted);
}

.table thead tr {
    background: #f9fafb;
}

.table th {
    padding: var(--space-3) var(--space-5);
    text-align: left;
    font-size: 0.75rem;
    font-weight: 500;
    color: var(--color-text-subtle);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    white-space: nowrap;
}

.table td {
    padding: var(--space-3) var(--space-5);
    border-top: 1px solid var(--color-border);
}

.table tbody tr:hover {
    background: #f9fafb;
    transition: background var(--transition);
}

.table__empty {
    text-align: center;
    color: var(--color-text-subtle);
    padding: var(--space-8) var(--space-5) !important;
}

.table__cell--primary {
    font-weight: 500;
    color: var(--color-text);
}

.table__actions {
    display: flex;
    align-items: center;
    gap: var(--space-2);
}

.table__actions-separator {
    color: var(--color-border);
    user-select: none;
}

/* ── Capacity dot ── */
.capacity-cell {
    display: inline-flex;
    align-items: center;
    gap: var(--space-2);
    white-space: nowrap;
}

.capacity-dot {
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    flex-shrink: 0;
}

.capacity-dot--open        { background: #22c55e; }
.capacity-dot--almost-full { background: #f59e0b; }
.capacity-dot--full        { background: #ef4444; }
.capacity-dot--cancelled   { background: #9ca3af; }

/* ── Status badges ── */
.badge {
    display: inline-flex;
    align-items: center;
    padding: 2px var(--space-2);
    border-radius: 9999px;
    font-size: 0.7rem;
    font-weight: 600;
    letter-spacing: 0.02em;
    white-space: nowrap;
}

.badge--open        { background: #dcfce7; color: #15803d; }
.badge--in-progress { background: #dbeafe; color: #1d4ed8; }
.badge--ended       { background: #f3f4f6; color: #6b7280; }
.badge--cancelled   { background: #fee2e2; color: #b91c1c; }
/* Money the studio is still owed. Referenced by the member purchases page since dunning
   shipped, but never defined here — those pills rendered as bare uncoloured text. */
.badge--past-due    { background: #fde2e1; color: #b42318; }

/* ── Membership status badges ── */
.badge--active    { background: #dcfce7; color: #15803d; }
.badge--pending   { background: #fffbeb; color: #ca8a04; }
.badge--suspended { background: #fee2e2; color: #b91c1c; }

/* ── Member avatar (initials circle) ── */
.member-avatar {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: var(--color-border);
    color: var(--color-text-muted);
    font-size: 0.6875rem;
    font-weight: 600;
    flex-shrink: 0;
}

/* ── Member name cell (avatar + name/email stack) ── */
.member-name-cell {
    display: flex;
    align-items: center;
    gap: var(--space-3);
}

.member-email {
    display: block;
    font-size: 0.75rem;
    color: var(--color-text-muted);
    font-weight: 400;
}

/* ── Plan chips (owner Users list: live memberships and passes per member) ── */
.plan-chips {
    display: flex;
    flex-direction: column;
    gap: var(--space-1);
    align-items: flex-start;
}

.plan-chips__empty {
    color: var(--color-text-subtle);
}

.plan-chip {
    display: inline-flex;
    align-items: center;
    gap: var(--space-2);
    max-width: 15rem;
    padding: 4px var(--space-2);
    border: 1px solid var(--color-border);
    border-left-width: 3px;
    border-radius: var(--radius-md);
    /* The page background token reads as a subtle inset against the white card in light theme,
       and as a slightly darker chip against the raised surface in dark theme. */
    background: var(--color-bg);
}

.plan-chip__dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    flex-shrink: 0;
}

.plan-chip__text {
    display: flex;
    flex-direction: column;
    min-width: 0;
    line-height: 1.3;
}

.plan-chip__name {
    font-size: 0.8125rem;
    font-weight: 600;
    color: var(--color-text);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.plan-chip__meta {
    font-size: 0.6875rem;
    color: var(--color-text-muted);
    white-space: nowrap;
}

/* One colour per state, matching the status-badge vocabulary used elsewhere. */
.plan-chip--active  { border-left-color: #22c55e; }
.plan-chip--active  .plan-chip__dot { background: #22c55e; }
.plan-chip--paused  { border-left-color: #f59e0b; }
.plan-chip--paused  .plan-chip__dot { background: #f59e0b; }
.plan-chip--failed  { border-left-color: #ef4444; }
.plan-chip--failed  .plan-chip__dot { background: #ef4444; }
.plan-chip--ending  { border-left-color: #9ca3af; }
.plan-chip--ending  .plan-chip__dot { background: #9ca3af; }
.plan-chip--pass    { border-left-color: #6366f1; }
.plan-chip--pass    .plan-chip__dot { background: #6366f1; }

/* ── Action menu (⋮ kebab dropdown for table rows) ──
   Behaviour lives in templates/dashboard/_partials/_action_menu_script.html.twig; include that
   partial once on any page using these classes. Pages may add their own item modifiers, but the
   base belongs here — this shipped as three near-identical copies before it was extracted. */
.action-menu-trigger {
    background: none;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    cursor: pointer;
    font-size: 1.1rem;
    line-height: 1;
    padding: 2px 10px;
    color: var(--color-text-muted);
    transition: background var(--transition);
}

.action-menu-trigger:hover { background: var(--color-bg); }

/* Moved into <body> by JS and positioned in viewport coordinates, so no ancestor can clip it. */
.action-menu {
    display: none;
    position: fixed;
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.13);
    min-width: 210px;
    z-index: 9999;
    padding: 6px 0;
}

.action-menu.is-open { display: block; }

.action-menu__item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 0 14px;
}

.action-menu__item + .action-menu__item { border-top: 1px solid var(--color-border); }

.action-menu__item a,
.action-menu__item button {
    background: none;
    border: none;
    cursor: pointer;
    display: block;
    width: 100%;
    text-align: left;
    padding: 9px 0;
    font-size: 0.875rem;
    color: var(--color-text);
    text-decoration: none;
    white-space: nowrap;
    font-family: inherit;
}

.action-menu__item a:hover,
.action-menu__item button:hover { color: var(--g, #2a7ab8); }

/* A POST action (Remove, Revoke, …) is a form in the menu; it must not add its own box. */
.action-menu__item form { margin: 0; width: 100%; }

.action-menu__item--danger button,
.action-menu__item--danger button:hover { color: #b42318; }

/* An action that exists but is closed right now: shown with its reason in `title`, never hidden,
   so the owner learns why instead of hunting for a missing entry. */
.action-menu__item--disabled {
    padding: 9px 14px;
    font-size: 0.875rem;
    color: var(--color-text-subtle);
    cursor: not-allowed;
}

/* ── Screen-reader-only text ── */
.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    margin: -1px;
    padding: 0;
    overflow: hidden;
    clip: rect(0 0 0 0);
    clip-path: inset(50%);
    white-space: nowrap;
    border: 0;
}

/* ── Past-session row (grey text) ── */
.session-row--past td {
    color: #9ca3af;
}

.session-row--past .badge {
    opacity: 0.85;
}

/* ── Flash messages ── */
.flash {
    margin-bottom: var(--space-4);
    padding: var(--space-3);
    border-radius: var(--radius-md);
    font-size: 0.875rem;
    border: 1px solid;
}

.flash--error   { background: var(--flash-error-bg);   color: var(--flash-error-text);   border-color: var(--flash-error-border); }
.flash--success { background: var(--flash-success-bg); color: var(--flash-success-text); border-color: var(--flash-success-border); }
.flash--warning { background: var(--flash-warning-bg); color: var(--flash-warning-text); border-color: var(--flash-warning-border); }
.flash--info    { background: var(--flash-info-bg);    color: var(--flash-info-text);    border-color: var(--flash-info-border); }
.flash__action-link {
    margin-left: 0.5rem;
    font-weight: 700;
    text-decoration: underline;
    color: inherit;
    white-space: nowrap;
}

/* ── Buttons ── */
.btn {
    display: inline-flex;
    align-items: center;
    gap: var(--space-2);
    padding: var(--space-2) var(--space-3);
    border-radius: var(--radius-md);
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    transition: background var(--transition), color var(--transition);
    text-decoration: none;
    border: none;
    white-space: nowrap;
}

.btn--primary {
    background: var(--color-primary);
    color: var(--color-on-primary, #ffffff);
}

.btn--primary:hover {
    background: var(--color-primary-hover);
}

.btn--ghost {
    background: transparent;
    color: var(--color-text-muted);
}

.btn--ghost:hover {
    color: var(--color-text);
}

/* A blocked action renders disabled with its reason in `title` (note 16) — it must also LOOK
   inactive, or a click that does nothing reads as broken (check-in before its window opens).
   Not while the dashboard submit spinner holds the button: that is "working", not "unavailable"
   (layout.html.twig sets data-original-html for exactly that state). */
.btn:disabled:not([data-original-html]) {
    background: var(--color-border);
    color: var(--color-text-subtle);
    cursor: not-allowed;
}

.btn--ghost:disabled:not([data-original-html]) {
    background: transparent;
}

/* Full-width variant */
.btn--full {
    width: 100%;
    justify-content: center;
}

/* Submit spinner */
.btn-spinner {
    display: inline-block;
    width: 0.82em;
    height: 0.82em;
    border: 2px solid currentColor;
    border-right-color: transparent;
    border-radius: 50%;
    animation: btn-spin 0.55s linear infinite;
    vertical-align: middle;
    margin-right: 0.3em;
    flex-shrink: 0;
}

@keyframes btn-spin {
    to { transform: rotate(360deg); }
}

/* ── Week group (collapsible <details> blocks) ── */
.week-group { border: 1px solid var(--color-border, #e5e7eb); border-radius: 8px; margin-bottom: 12px; overflow: hidden; }
.week-group__summary { display: flex; align-items: center; gap: 10px; padding: 12px 16px; cursor: pointer; list-style: none; background: var(--color-surface-subtle, #f9fafb); user-select: none; }
.week-group__summary::-webkit-details-marker { display: none; }
.week-group__summary:hover { background: var(--color-surface-hover, #f3f4f6); }
.week-group__chevron { display: inline-flex; transition: transform 0.18s ease; color: var(--color-text-muted, #9ca3af); flex-shrink: 0; }
details[open] .week-group__chevron { transform: rotate(90deg); }
.week-group__title { font-weight: 600; font-size: 0.9rem; color: var(--color-text, #111827); }
.week-group__range { font-size: 0.8rem; color: var(--color-text-muted, #9ca3af); }
.week-group__count { margin-left: auto; font-size: 0.78rem; color: var(--color-text-muted, #9ca3af); white-space: nowrap; }
.week-group .table-wrapper { border-top: 1px solid var(--color-border, #e5e7eb); margin: 0; }
.week-group .table { margin: 0; border-radius: 0; }

/* ── Inline action links (table rows) ── */
.action-link {
    font-size: 0.75rem;
    font-weight: 500;
    text-decoration: none;
    transition: color var(--transition);
    background: none;
    border: none;
    padding: 0;
    cursor: pointer;
    line-height: inherit;
}

.action-link--edit          { color: #2563eb; }
.action-link--edit:hover    { color: #1d4ed8; }
.action-link--cancel        { color: #d97706; min-width: 3rem; text-align: center; }
.action-link--cancel:hover  { color: #b45309; }
.action-link--delete        { color: #ef4444; min-width: 3rem; text-align: center; }
.action-link--delete:hover  { color: #b91c1c; }
.action-link--disabled      { color: var(--color-text-subtle); cursor: default; min-width: 3rem; text-align: center; }
.action-link--reactivate        { color: #16a34a; min-width: 3rem; text-align: center; }
.action-link--reactivate:hover  { color: #15803d; }
.action-link--duplicate         { color: #6b7280; }
.action-link--duplicate:hover   { color: #374151; }
.action-link--publish       { color: #16a34a; }
.action-link--publish:hover { color: #15803d; }
.action-link--warning       { color: #d97706; }
.action-link--warning:hover { color: #b45309; }
.action-link--muted         { color: var(--color-text-muted, #6b7280); }
.action-link--muted:hover   { color: var(--color-text, #111827); }

.table__name-link            { color: inherit; text-decoration: none; font-weight: 600; }
.table__name-link:hover      { text-decoration: underline; }

.spots-dot           { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: .35rem; vertical-align: middle; flex-shrink: 0; }
.spots-dot--green    { background: #16a34a; }
.spots-dot--yellow   { background: #d97706; }
.spots-dot--red      { background: #ef4444; }

.detail-back-link            { display: inline-flex; align-items: center; gap: .35rem; color: var(--color-text-muted); font-size: .875rem; text-decoration: none; margin-bottom: 1.5rem; }
.detail-back-link:hover      { color: var(--color-text); }

/* ── Forms ── */
.form {
    display: flex;
    flex-direction: column;
    gap: var(--space-5);
    padding: var(--space-5) var(--space-6);
}

.form__group {
    display: flex;
    flex-direction: column;
    gap: var(--space-1);
}

.form__row {
    display: grid;
    grid-template-columns: 1fr;
    gap: var(--space-4);
}

@media (min-width: 640px) {
    .form__row {
        grid-template-columns: 1fr 1fr;
    }
}

.form__label {
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--color-text-muted);
}

.form__required {
    color: #ef4444;
}

.form__tooltip {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1rem;
    height: 1rem;
    border-radius: 50%;
    background: var(--color-border);
    color: var(--color-text-muted);
    font-size: 0.625rem;
    font-weight: 700;
    line-height: 1;
    cursor: default;
    vertical-align: middle;
    margin-left: 0.25rem;
}

.form__tooltip::after {
    content: attr(data-tooltip);
    position: absolute;
    bottom: calc(100% + 6px);
    left: 50%;
    transform: translateX(-50%);
    background: var(--color-text);
    color: var(--color-surface);
    font-size: 0.75rem;
    font-weight: 400;
    line-height: 1.4;
    padding: 0.4rem 0.6rem;
    border-radius: var(--radius-md);
    white-space: normal;
    width: 220px;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.15s ease;
    z-index: 10;
}

.form__tooltip:hover::after,
.form__tooltip:focus::after {
    opacity: 1;
}

.form__input {
    display: block;
    width: 100%;
    padding: var(--space-2) var(--space-3);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    font-size: 0.875rem;
    color: var(--color-text);
    background: var(--color-surface);
    transition: border-color var(--transition), box-shadow var(--transition);
}

.form__input:focus {
    outline: none;
    border-color: #6b7280;
    box-shadow: 0 0 0 2px rgba(107, 114, 128, 0.2);
}

.form__input::placeholder {
    color: var(--color-text-subtle);
}

textarea.form__input {
    resize: vertical;
}

.form__fieldset-label {
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--color-text-muted);
    margin-bottom: var(--space-2);
    display: block;
}

.form__checkbox-group {
    display: flex;
    flex-direction: column;
    gap: var(--space-2);
    padding-left: var(--space-1);
}

.form__radio-group {
    display: flex;
    gap: var(--space-4);
    flex-wrap: wrap;
    margin-top: var(--space-1);
}

.form__radio-label {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    font-size: 0.875rem;
    color: var(--color-text-muted);
    cursor: pointer;
}

.form__radio-label input[type="radio"] {
    width: 16px;
    height: 16px;
    cursor: pointer;
    accent-color: var(--color-primary);
    flex-shrink: 0;
}

.form__checkbox-label {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    font-size: 0.875rem;
    color: var(--color-text-muted);
    cursor: pointer;
}

.form__checkbox-label input[type="checkbox"] {
    width: 16px;
    height: 16px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--color-border);
    cursor: pointer;
    accent-color: var(--color-primary);
    flex-shrink: 0;
}

.form__actions {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    padding-top: var(--space-2);
    border-top: 1px solid var(--color-border);
}

/* ── Variant rows ── */
.form__variants {
    display: flex;
    flex-direction: column;
    gap: var(--space-2);
    margin-top: var(--space-3);
}

.form__variant-row {
    display: grid;
    grid-template-columns: 1fr 1fr auto;
    gap: var(--space-2);
    align-items: end;
}

@media (max-width: 600px) {
    .form__variant-row {
        grid-template-columns: 1fr;
    }
}

/* ── Filter toolbar ── */
.filter-toolbar {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    gap: var(--space-3);
    padding: var(--space-3) var(--space-4);
    background: #f9fafb;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    margin-bottom: var(--space-5);
}

.filter-toolbar__group {
    display: flex;
    flex-direction: column;
    gap: 4px;
    flex: 0 0 auto;
}

.filter-toolbar__group--search {
    flex: 1 1 200px;
    min-width: 160px;
}

.filter-toolbar__label {
    font-size: 0.6875rem;
    font-weight: 500;
    letter-spacing: 0.03em;
    color: var(--color-text-subtle);
    text-transform: uppercase;
    line-height: 1;
}

.filter-toolbar__control {
    height: 34px;
    padding: 0 var(--space-3);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    background: #ffffff;
    font-size: 0.8125rem;
    color: var(--color-text);
    transition: border-color var(--transition);
    min-width: 0;
}

.filter-toolbar__control:focus {
    outline: none;
    border-color: #9ca3af;
    background: #ffffff;
}

.filter-toolbar__control::placeholder {
    color: var(--color-text-subtle);
}

.filter-toolbar__search-wrap {
    position: relative;
    display: flex;
    align-items: center;
}

.filter-toolbar__search-wrap .filter-toolbar__control {
    width: 100%;
    padding-left: 2.125rem;
}

.filter-toolbar__search-icon {
    position: absolute;
    left: var(--space-3);
    color: var(--color-text-subtle);
    pointer-events: none;
    display: flex;
    align-items: center;
}

.filter-toolbar__actions {
    display: flex;
    align-items: flex-end;
    gap: var(--space-2);
    flex-shrink: 0;
    margin-left: auto;
    padding-left: var(--space-2);
    border-left: 1px solid var(--color-border);
}

@media (max-width: 767px) {
    .filter-toolbar__actions {
        margin-left: 0;
        padding-left: 0;
        border-left: none;
        width: 100%;
        padding-top: var(--space-2);
        border-top: 1px solid var(--color-border);
    }
}

/* ── Alert banners ─────────────────────────────────────────── */
.alert {
    padding: 12px 16px;
    border-radius: var(--radius-md);
    font-size: 0.875rem;
}
.alert--info {
    background: #eff6ff;
    border: 1px solid #bfdbfe;
    color: #1e40af;
}
.alert--success {
    background: #ecfdf5;
    border: 1px solid #a7f3d0;
    color: #065f46;
}
.alert--warning {
    background: #fffbeb;
    border: 1px solid #fde68a;
    color: #92400e;
}
.alert--error {
    background: #fef2f2;
    border: 1px solid #fecaca;
    color: #991b1b;
}

/* The Day / Needs check-in tabs at the top of the Check-in page (front_desk/check_in/list.html.twig);
   the count is amber like the Not taken / not marked badges it counts. */
.check-in-tabs { padding: 0 var(--space-5); margin-bottom: 0; }
.check-in-tabs__count {
    display: inline-block; min-width: 1.4em; margin-left: 4px; padding: 0 6px;
    border-radius: 99px; background: #fffbeb; color: #ca8a04; font-size: 0.75rem; font-weight: 600; text-align: center;
}

/* The one notice above a check-in roster (_shared/check_in/_attendees.html.twig), inset to line up
   with the surface header above it. */
.check-in__notice {
    margin: var(--space-4) var(--space-5);
}

/* ── Plan cards ─────────────────────────────────────────────── */
.plan-cards {
    display: grid;
    grid-template-columns: 1fr;
    gap: var(--space-4);
    padding: var(--space-4) var(--space-5) var(--space-5);
}

@media (min-width: 640px) {
    .plan-cards { grid-template-columns: repeat(2, 1fr); }
}

@media (min-width: 1024px) {
    .plan-cards { grid-template-columns: repeat(3, 1fr); }
}

.plan-cards__empty {
    padding: var(--space-6) var(--space-5);
    color: var(--color-text-muted);
    font-size: 0.875rem;
    text-align: center;
}

.plan-card {
    display: flex;
    flex-direction: column;
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    overflow: hidden;
}

.plan-card__head {
    padding: var(--space-4) var(--space-5);
    flex: 1;
}

.plan-card__meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-2);
    margin-bottom: var(--space-2);
}

.plan-card__type-badge {
    display: inline-block;
    font-size: 0.7rem;
    font-weight: 600;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    padding: 2px 8px;
    border-radius: 999px;
}

.plan-card__type-badge--one-off {
    background: var(--color-accent-blue-bg, #dbeafe);
    color: var(--color-accent-blue-fg, #1d4ed8);
}

.plan-card__type-badge--recurring {
    background: var(--color-accent-green-bg, #dcfce7);
    color: var(--color-accent-green-fg, #15803d);
}

.plan-card__name {
    font-size: 1rem;
    font-weight: 700;
    color: var(--color-text);
    margin: 0 0 var(--space-1);
    line-height: 1.3;
}

.plan-card__desc {
    font-size: 0.8125rem;
    color: var(--color-text-muted);
    margin: 0 0 var(--space-1);
    line-height: 1.5;
}

.plan-card__bullets {
    margin: var(--space-1) 0 0;
    padding: 0;
    list-style: none;
    font-size: 0.8125rem;
    color: var(--color-text-muted);
    line-height: 1.6;
}

.plan-card__bullets li {
    display: flex;
    align-items: baseline;
    gap: 6px;
    margin-bottom: 2px;
}

.plan-card__bullets li::before {
    content: '✓';
    flex-shrink: 0;
    font-size: 0.75rem;
    color: var(--color-accent-green-fg, #15803d);
    font-weight: 600;
}

.plan-card__details {
    list-style: none;
    margin: 0;
    padding: var(--space-3) var(--space-5);
    border-top: 1px solid var(--color-border);
    border-bottom: 1px solid var(--color-border);
    display: flex;
    flex-direction: column;
    gap: var(--space-2);
}

.plan-card__detail {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    font-size: 0.8125rem;
    color: var(--color-text-muted);
}

.plan-card__detail-icon {
    font-size: 0.875rem;
    flex-shrink: 0;
}

.plan-card__footer {
    padding: var(--space-4) var(--space-5);
    display: flex;
    flex-direction: column;
    gap: var(--space-3);
}

.plan-card__price {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--color-text);
    line-height: 1;
}

.plan-card__form {
    display: flex;
    flex-direction: column;
    gap: var(--space-2);
}

.plan-card__hint {
    margin: 0;
    font-size: 0.8125rem;
    color: var(--color-text-muted);
}

.plan-card__select {
    font-size: 0.875rem;
}

/* ── Plan page tabs ──────────────────────────────────────────────────── */
.ptab-nav {
    display: flex;
    padding: 0 16px;
    border-bottom: 1px solid var(--color-border);
}

.ptab-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 12px 16px;
    border: none;
    border-bottom: 2px solid transparent;
    background: none;
    color: var(--color-text-muted);
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    white-space: nowrap;
    margin-bottom: -1px;
    transition: color var(--transition), border-color var(--transition);
}

.ptab-btn:hover { color: var(--color-text); }

.ptab-btn--active {
    color: var(--color-accent-blue-fg);
    border-bottom-color: var(--color-accent-blue-fg);
}

.ptab-badge {
    display: inline-flex;
    align-items: center;
    padding: 1px 7px;
    border-radius: 20px;
    font-size: 0.7rem;
    font-weight: 700;
    line-height: 1.6;
}

.ptab-badge--ok   { background: var(--color-accent-teal-bg);   color: var(--color-accent-teal-fg); }
.ptab-badge--warn { background: var(--color-accent-yellow-bg); color: var(--color-accent-yellow-fg); }
.ptab-badge--count {
    background: var(--color-bg);
    color: var(--color-text-muted);
    border: 1px solid var(--color-border);
}

.ptab-panel            { display: none; }
.ptab-panel--active    { display: block; }

/* My Plan empty state */
.ptab-empty {
    padding: 48px 24px;
    text-align: center;
}
.ptab-empty__icon  { font-size: 2.5rem; margin-bottom: 12px; }
.ptab-empty__title {
    font-size: 1rem;
    font-weight: 600;
    color: var(--color-text);
    margin: 0 0 6px;
}
.ptab-empty__sub {
    color: var(--color-text-muted);
    font-size: 0.875rem;
    margin: 0 0 20px;
}

/* Exhausted alert */
.ptab-exhausted-alert {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 12px 16px;
    background: var(--color-accent-yellow-bg);
    border-left: 3px solid var(--color-accent-yellow-fg);
    color: var(--color-accent-yellow-fg);
    font-size: 0.875rem;
    font-weight: 500;
}

/* Purchase history */
.purchase-history { padding: 16px; display: flex; flex-direction: column; gap: 8px; }

.purch-card {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 14px 16px;
    background: var(--color-bg);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
}

.purch-card__type {
    flex: 0 0 auto;
    min-width: 90px;
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .06em;
    color: var(--color-text-muted);
}

.purch-card__info   { flex: 1 1 auto; min-width: 0; }
.purch-card__name   { font-size: 0.9rem; font-weight: 600; color: var(--color-text); }
.purch-card__date   { font-size: 0.8rem; color: var(--color-text-muted); }
.purch-card__credits { font-size: 0.78rem; color: var(--color-text-subtle); margin-top: 2px; }

.purch-card__right {
    flex: 0 0 auto;
    display: flex;
    align-items: center;
    gap: 10px;
}

.purch-card__amount {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--color-text);
}

.purch-card__vat-note {
    font-size: 0.75rem;
    color: var(--color-text-muted);
    display: block;
    margin-top: 2px;
}

.purch-card__invoice-link {
    font-size: 0.75rem;
    color: var(--color-primary, #6366f1);
    display: block;
    margin-top: 4px;
    text-decoration: none;
}
.purch-card__invoice-link:hover { text-decoration: underline; }

@media (max-width: 480px) {
    .purch-card { flex-wrap: wrap; }
    .purch-card__type { min-width: auto; }
}

/* ── Plans section divider ── */
.plans-section + .plans-section {
    border-top: 1px solid var(--color-border);
    margin-top: var(--space-6);
    padding-top: var(--space-6);
}

.plans-section__header {
    padding: var(--space-4) var(--space-5) var(--space-2);
}

.plans-section__title {
    font-size: 1rem;
    font-weight: 700;
    color: var(--color-text);
    margin: 0 0 4px;
}

.plans-section__sub {
    font-size: 0.82rem;
    color: var(--color-text-muted);
    margin: 0;
}

/* ── My Plan — active plan cards ── */
.mplan-cards {
    display: grid;
    grid-template-columns: 1fr;
    gap: var(--space-4);
    padding: var(--space-2) var(--space-5) var(--space-5);
}

/* Passes are shown as small boxes (like "Available plans"), not full-width
   rows — memberships stay full-width hero cards. The third column starts later
   than on .plan-cards (1280 instead of 1024): a pass card carries a meter and a
   stats grid, and at 1024 the sidebar leaves each of three cards ~210px, which
   forces every stat onto its own row. */
@media (min-width: 640px) {
    .mplan-cards--compact { grid-template-columns: repeat(2, 1fr); }
}

@media (min-width: 1280px) {
    .mplan-cards--compact { grid-template-columns: repeat(3, 1fr); }
}

.mplan-cards--compact .mplan-card__name { font-size: 1.05rem; }
.mplan-cards--compact .mplan-card__hero { padding: var(--space-3) var(--space-4); }

.mplan-card {
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    overflow: hidden;
}

.mplan-card--hero { box-shadow: var(--shadow-md); }

.mplan-card__hero {
    position: relative;
    padding: var(--space-4) var(--space-5);
    background: var(--color-surface);
    background: color-mix(in srgb, var(--color-primary) 6%, var(--color-surface));
    border-bottom: 1px solid var(--color-border);
}

.mplan-card__hero::before {
    content: "";
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 4px;
    background: var(--color-primary);
}

.mplan-card__toprow {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-2);
    margin-bottom: var(--space-2);
}

.mplan-eyebrow {
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.09em;
    text-transform: uppercase;
    color: var(--color-primary);
}

.mplan-card__name {
    font-size: 1.4rem;
    font-weight: 700;
    line-height: 1.2;
    color: var(--color-text);
    margin: 0;
    text-wrap: balance;
}

.mplan-chip-renew {
    display: inline-block;
    margin-top: var(--space-3);
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--color-text-muted);
    padding: 4px 10px;
    border: 1px solid var(--color-border);
    border-radius: 999px;
}

.mplan-meter {
    padding: var(--space-4) var(--space-5);
    border-bottom: 1px solid var(--color-border);
}

.mplan-meter__top {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: var(--space-2);
    margin-bottom: var(--space-2);
}

.mplan-meter__count {
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--color-text);
    font-variant-numeric: tabular-nums;
}

.mplan-meter__label {
    font-size: 0.78rem;
    color: var(--color-text-muted);
}

.mplan-meter__track {
    height: 10px;
    border-radius: 999px;
    overflow: hidden;
    background: var(--color-accent-green-bg);
}

.mplan-meter__fill {
    height: 100%;
    border-radius: 999px;
    background: var(--color-accent-green-fg);
    transform-origin: left;
    animation: mplan-grow 0.9s cubic-bezier(0.22, 0.61, 0.36, 1) both;
}

.mplan-meter--warn .mplan-meter__track { background: var(--color-accent-yellow-bg); }
.mplan-meter--warn .mplan-meter__fill  { background: var(--color-accent-yellow-fg); }
.mplan-meter--crit .mplan-meter__track { background: var(--color-accent-rose-bg); }
.mplan-meter--crit .mplan-meter__fill  { background: var(--color-accent-rose-fg); }

@keyframes mplan-grow {
    from { transform: scaleX(0); }
    to   { transform: scaleX(1); }
}

@media (prefers-reduced-motion: reduce) {
    .mplan-meter__fill { animation: none; }
}

/* auto-fit, not repeat(3, 1fr): a pass card is only ~210-350px wide inside
   .mplan-cards--compact, so three rigid columns overflowed a card that clips
   (.mplan-card has overflow: hidden) and the third stat ("Paid") was cut off.
   A viewport media query cannot fix that — the viewport is wide, the CARD is
   narrow — so the column count has to come from the available space instead.
   Separators are the 1px grid gap showing the track colour through, which
   survives any number of columns; a border-left on the sibling would draw a
   stray line at the start of every wrapped row. */
.mplan-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    overflow: hidden;
}

/* Separators are drawn on every cell and pulled 1px out of the container, so the
   leading edges are clipped by the overflow above. A `+ .mplan-stat` border-left
   cannot do this once the row wraps: it would draw a stray line at the start of
   the second row, and a grid-gap-as-border would paint the unused cell of a
   2-column/3-item layout as a grey block. */
.mplan-stat {
    padding: var(--space-4) var(--space-5);
    border-top: 1px solid var(--color-border);
    border-left: 1px solid var(--color-border);
    margin-top: -1px;
    margin-left: -1px;
}

.mplan-stat__label {
    font-size: 0.64rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--color-text-subtle);
    margin-bottom: 5px;
}

.mplan-stat__value {
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--color-text);
    font-variant-numeric: tabular-nums;
}

.mplan-stat__sub {
    font-size: 0.75rem;
    color: var(--color-text-muted);
    font-weight: 500;
    margin-top: 2px;
}

/* ── Membership billing schedule (Bsport-style key/value list) ── */
.mplan-facts {
    margin: 0;
    padding: var(--space-2) var(--space-5);
}

.mplan-fact {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: var(--space-4);
    padding: var(--space-3) 0;
}

.mplan-fact + .mplan-fact { border-top: 1px solid var(--color-border); }

.mplan-fact__label {
    font-size: 0.64rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--color-text-subtle);
    flex: 0 0 auto;
}

.mplan-fact__value {
    margin: 0;
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--color-text);
    text-align: right;
    font-variant-numeric: tabular-nums;
}

.mplan-fact__sub {
    font-size: 0.75rem;
    font-weight: 500;
    color: var(--color-text-muted);
    margin-left: 6px;
}

.mplan-card__foot {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-3);
    padding: var(--space-3) var(--space-5);
    border-top: 1px solid var(--color-border);
}

.mplan-foot-note {
    font-size: 0.76rem;
    color: var(--color-text-subtle);
}

.mplan-cancel-link {
    background: none;
    border: none;
    cursor: pointer;
    padding: 6px 2px;
    font: inherit;
    font-size: 0.83rem;
    font-weight: 600;
    color: var(--color-text-muted);
    border-bottom: 1px solid transparent;
    transition: color 0.15s, border-color 0.15s;
}

.mplan-cancel-link:hover {
    color: var(--color-accent-rose-fg);
    border-bottom-color: var(--color-accent-rose-fg);
}

.mplan-card--exhausted { border-style: dashed; }
.mplan-card--exhausted .mplan-card__hero { background: var(--color-surface); }
.mplan-card--exhausted .mplan-card__hero::before { background: var(--color-accent-rose-fg); }
.mplan-card--exhausted .mplan-card__name,
.mplan-card--exhausted .mplan-eyebrow { opacity: 0.6; }

.mplan-exhausted-cta { padding: var(--space-4) var(--space-5); }
.mplan-exhausted-cta p {
    margin: 0 0 var(--space-3);
    font-size: 0.85rem;
    color: var(--color-text-muted);
}

/* ── Tab bar ── */
.tab-bar {
    display: flex;
    gap: 0;
    border-bottom: 2px solid var(--color-border, #e5e7eb);
    margin-bottom: var(--space-5, 20px);
}

.tab-bar__item {
    padding: 10px 20px;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--color-text-muted, #6b7280);
    text-decoration: none;
    border-bottom: 2px solid transparent;
    margin-bottom: -2px;
    transition: color 0.15s, border-color 0.15s;
}

.tab-bar__item:hover {
    color: var(--color-text, #111827);
}

.tab-bar__item--active {
    color: var(--color-primary, #6366f1);
    border-bottom-color: var(--color-primary, #6366f1);
}

/* ── Back to top ──
   Floating, icon-only scroll-to-top button. Rendered by
   templates/_shared/_back_to_top.html.twig, which toggles `.is-visible`.
   z-index sits below the mobile sidebar (25) and its overlay (20) so an open drawer covers it. */
.back-to-top {
    position: fixed;
    right: var(--space-4, 16px);
    bottom: var(--space-4, 16px);
    z-index: 15;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2.75rem;
    height: 2.75rem;
    padding: 0;
    border: 1px solid var(--color-border, #e5e7eb);
    border-radius: 9999px;
    background: var(--color-surface, #ffffff);
    color: var(--color-text-muted, #6b7280);
    box-shadow: var(--shadow-md, 0 4px 6px rgba(0, 0, 0, 0.07));
    cursor: pointer;

    /* Hidden by default: `visibility` (not `display`) so the fade can run in both directions, and
       so the button is out of the tab order while it is invisible. */
    opacity: 0;
    visibility: hidden;
    transform: translateY(8px);
    transition: opacity 0.2s ease, transform 0.2s ease, visibility 0.2s, color 0.15s, border-color 0.15s;
}

@media (min-width: 640px) {
    .back-to-top {
        right: var(--space-6, 24px);
        bottom: var(--space-6, 24px);
    }
}

.back-to-top.is-visible {
    opacity: 1;
    visibility: visible;
    transform: none;
}

.back-to-top:hover {
    color: var(--color-text, #111827);
    border-color: var(--color-text-subtle, #9ca3af);
}

.back-to-top:focus-visible {
    outline: 2px solid var(--color-primary, #6366f1);
    outline-offset: 2px;
}

@media (prefers-reduced-motion: reduce) {
    .back-to-top {
        transition: opacity 0.2s ease, visibility 0.2s;
        transform: none;
    }
}

/* ── Day calendar strip ──
   Horizontal day chips above a session list. Rendered by templates/_shared/_day_strip.html.twig
   and shared by the member Browse Sessions page and the public /schedule page, so nothing here may
   assume a table, a <details> group, or the dashboard shell. */
.day-strip {
    display: flex;
    align-items: stretch;
    gap: 8px;
    margin: 0 0 20px;
    padding: 10px 12px;
    background: var(--color-surface, #fff);
    border: 1px solid var(--color-border, #e5e7eb);
    border-radius: 12px;
}

.day-strip__arrow {
    flex: 0 0 auto;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    border-radius: 8px;
    border: 1px solid var(--color-border, #e5e7eb);
    background: var(--color-surface, #fff);
    color: var(--color-text, #111827);
    cursor: pointer;
    transition: background 0.15s, border-color 0.15s, opacity 0.15s;
}

.day-strip__arrow:hover:not(:disabled) {
    background: var(--color-surface-subtle, #f9fafb);
    border-color: var(--color-text-muted, #6b7280);
}

.day-strip__arrow:disabled {
    opacity: 0.35;
    cursor: default;
}

.day-strip__track {
    display: flex;
    align-items: center;
    gap: 8px;
    flex: 1;
    overflow-x: auto;
    scroll-behavior: smooth;
    scrollbar-width: none;
}

.day-strip__track::-webkit-scrollbar {
    display: none;
}

.day-strip__day {
    flex: 0 0 auto;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 14px;
    border-radius: 999px;
    border: 1px solid var(--color-border, #e5e7eb);
    background: var(--color-surface, #fff);
    color: var(--color-text, #111827);
    font-size: 0.8125rem;
    font-weight: 500;
    white-space: nowrap;
    cursor: pointer;
    transition: background 0.15s, border-color 0.15s, color 0.15s;
}

.day-strip__day:hover {
    background: var(--color-surface-subtle, #f9fafb);
    border-color: var(--color-text-muted, #6b7280);
}

.day-strip__count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 18px;
    height: 18px;
    padding: 0 5px;
    border-radius: 999px;
    background: var(--color-surface-subtle, #f3f4f6);
    color: var(--color-text-muted, #6b7280);
    font-size: 0.6875rem;
    font-weight: 600;
}

.day-strip__day[aria-pressed="true"] {
    background: var(--color-primary, #111827);
    border-color: var(--color-primary, #111827);
    color: #fff;
}

.day-strip__day[aria-pressed="true"] .day-strip__count {
    background: rgba(255, 255, 255, 0.22);
    color: #fff;
}

/* ── Selected-day highlight ──
   Temporary by design: three quick blinks, then a long fade back to nothing. Nothing is left on
   the element afterwards — the class is stripped on animationend.
   A table row is animated through its <td> children, because a <tr> background is painted under
   the cells and would not be visible; every other kind of entry (the public schedule's cards)
   animates itself. */
.table tr.is-day-flash > td {
    animation: day-flash 2800ms ease-out 1;
}

/* Same blink, but the "off" frames restore an opaque surface instead of `transparent`: a card sits
   on the page background, so blinking it to transparent reads as the card vanishing rather than as
   a highlight. A <td> genuinely wants transparent — its row paints behind it. */
.is-day-flash:not(tr) {
    animation: day-flash-surface 2800ms ease-out 1;
}

@keyframes day-flash {
    0%   { background: rgba(37, 99, 235, 0.30); box-shadow: inset 3px 0 0 0 var(--color-primary, #2563eb); }
    8%   { background: transparent;             box-shadow: inset 3px 0 0 0 transparent; }
    16%  { background: rgba(37, 99, 235, 0.30); box-shadow: inset 3px 0 0 0 var(--color-primary, #2563eb); }
    24%  { background: transparent;             box-shadow: inset 3px 0 0 0 transparent; }
    32%  { background: rgba(37, 99, 235, 0.30); box-shadow: inset 3px 0 0 0 var(--color-primary, #2563eb); }
    100% { background: transparent;             box-shadow: inset 3px 0 0 0 transparent; }
}

@keyframes day-flash-surface {
    0%   { background: rgba(37, 99, 235, 0.30);  box-shadow: inset 3px 0 0 0 var(--color-primary, #2563eb); }
    8%   { background: var(--color-surface, #fff); box-shadow: inset 3px 0 0 0 transparent; }
    16%  { background: rgba(37, 99, 235, 0.30);  box-shadow: inset 3px 0 0 0 var(--color-primary, #2563eb); }
    24%  { background: var(--color-surface, #fff); box-shadow: inset 3px 0 0 0 transparent; }
    32%  { background: rgba(37, 99, 235, 0.30);  box-shadow: inset 3px 0 0 0 var(--color-primary, #2563eb); }
    100% { background: var(--color-surface, #fff); box-shadow: inset 3px 0 0 0 transparent; }
}

@media (prefers-reduced-motion: reduce) {
    .day-strip__track {
        scroll-behavior: auto;
    }

    /* Keep the feedback, drop the blinking: a single long fade. */
    .table tr.is-day-flash > td {
        animation: day-fade 2800ms ease-out 1;
    }

    .is-day-flash:not(tr) {
        animation: day-fade-surface 2800ms ease-out 1;
    }

    @keyframes day-fade {
        0%   { background: rgba(37, 99, 235, 0.30); }
        100% { background: transparent; }
    }

    @keyframes day-fade-surface {
        0%   { background: rgba(37, 99, 235, 0.30); }
        100% { background: var(--color-surface, #fff); }
    }
}

/* ── Studio contact card ──
   The member's one way to reach their studio from inside the product (P0 #1/#3). Rendered on
   authenticated tenant pages only — never on the public schedule, where a live email address would
   be harvested. Each row is a label, the value, and its actions; the actions wrap under the value
   on a narrow screen rather than shrinking, because a tap target that shrinks is a tap target that
   gets missed. */
.studio-contact {
    background: var(--color-surface, #fff);
    border: 1px solid var(--color-border, #e5e7eb);
    border-radius: 12px;
    padding: 18px 20px;
    /* Centred, and narrower than the page it sits under: this is a reference block, not a table,
       and a full-width card reads as another data surface. `auto` does nothing until a max-width
       constrains it — see the media query below. */
    margin: 24px auto 0;
}

/* Half width on a desktop, full width on a phone. The `max()` floor is load-bearing: a row is a
   label, a value and two buttons, so below ~420px the actions wrap under the email address and the
   card starts looking broken. On a narrow window 50% would cross that floor long before the media
   query stops applying. */
@media (min-width: 900px) {
    .studio-contact {
        max-width: max(420px, 50%);
    }
}

.studio-contact__head { display: flex; align-items: flex-start; gap: 12px; margin-bottom: 14px; }
.studio-contact__icon { font-size: 1.4rem; line-height: 1.2; }
.studio-contact__title { margin: 0; font-size: 1rem; font-weight: 600; }
.studio-contact__desc { margin: 2px 0 0; font-size: 0.875rem; color: var(--color-text-muted, #6b7280); }

.studio-contact__rows { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }

.studio-contact__row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px 12px;
}

.studio-contact__label {
    min-width: 72px;
    font-size: 0.8125rem;
    font-weight: 600;
    color: var(--color-text-muted, #6b7280);
}

.studio-contact__value {
    flex: 1;
    min-width: 180px;
    font-size: 0.9375rem;
    color: var(--color-text, #111827);
    /* A long address must not push the buttons off a phone screen. */
    overflow-wrap: anywhere;
}

.studio-contact__actions { display: flex; gap: 8px; flex-wrap: wrap; }

.studio-contact__empty,
.studio-contact__address {
    margin: 12px 0 0;
    font-size: 0.875rem;
    color: var(--color-text-muted, #6b7280);
}

.studio-contact__address .studio-contact__label { display: inline-block; }
