/* ============================================================
   SolScheduler — Global CSS (sol- prefixed, no scoping needed)
   All classes prefixed with sol-scheduler- to avoid conflicts.
   Uses design tokens from SolsticioUI Core.
   ============================================================ */

/* ─────────────────────────────────────────────────────────────────
   UNLAYERED coexistence guards — see sol-grid.css for rationale.
   ───────────────────────────────────────────────────────────────── */
button.sol-scheduler-toolbar-btn {
    border: 1px solid var(--sol-border, #E2E5EC);
    border-radius: var(--sol-radius-action);
    background: var(--sol-bg-base, #FFFFFF);
    color: var(--sol-text-primary, #1A1D27);
    font-family: inherit;
    cursor: pointer;
}

button.sol-scheduler-toolbar-btn--active {
    background: var(--sol-accent, #4F7FFF);
    color: var(--sol-on-accent);
    border-color: var(--sol-accent, #4F7FFF);
}

@layer solsticio-components {


/* === Scheduler Container === */
.sol-scheduler {
    box-sizing: border-box;
    position: relative;
    display: flex;
    flex-direction: column;
    border: 1px solid var(--sol-card-border);
    border-radius: var(--sol-radius-card);
    box-shadow: var(--sol-elev-card);
    overflow: hidden;
    background: var(--sol-bg-base, #FFFFFF);
    font-family: var(--sol-font-family, system-ui, sans-serif);
    font-size: var(--sol-font-size-base, 13px);
    color: var(--sol-text-primary, #1A1D27);
}

.sol-scheduler-body {
    flex: 1;
    overflow: hidden;
}

/* === Toolbar === */
.sol-scheduler-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: var(--sol-space-2, 8px) var(--sol-space-3, 12px);
    border-bottom: 1px solid var(--sol-border, #E2E5EC);
    background: var(--sol-bg-surface, #F8F9FB);
    gap: var(--sol-space-3, 12px);
    flex-shrink: 0;
}

.sol-scheduler-toolbar-nav {
    display: flex;
    align-items: center;
    gap: var(--sol-space-1, 4px);
}

.sol-scheduler-toolbar-title {
    font-size: var(--sol-font-size-lg, 16px);
    font-weight: var(--sol-font-weight-semibold, 600);
    margin: 0;
    white-space: nowrap;
}

.sol-scheduler-toolbar-views {
    display: flex;
    gap: var(--sol-space-1, 4px);
}

.sol-scheduler-toolbar-btn {
    box-sizing: border-box;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    height: calc(var(--sol-control-h) - 4px);
    padding: 0 var(--sol-space-3, 12px);
    border: 1px solid var(--sol-border, #E2E5EC);
    border-radius: var(--sol-radius-action);
    background: var(--sol-bg-base, #FFFFFF);
    color: var(--sol-text-primary, #1A1D27);
    font-size: var(--sol-font-size-sm, 12px);
    cursor: pointer;
    transition: background 0.15s, border-color 0.15s;
}

.sol-scheduler-toolbar-btn:hover {
    background: var(--sol-bg-muted, #F0F2F5);
    border-color: var(--sol-border-strong);
}

[data-sol-skin="material"] .sol-scheduler-toolbar-btn {
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-weight: var(--sol-font-weight-medium, 500);
}

.sol-scheduler-toolbar-btn--active {
    background: var(--sol-accent, #4F7FFF);
    color: var(--sol-on-accent);
    border-color: var(--sol-accent, #4F7FFF);
}

.sol-scheduler-toolbar-btn--active:hover {
    background: var(--sol-accent-hover, #6B95FF);
    border-color: var(--sol-accent-hover, #6B95FF);
}

.sol-scheduler-toolbar-btn--today {
    font-weight: var(--sol-font-weight-medium, 500);
}

/* Toolbar content slots */
.sol-scheduler-toolbar-start,
.sol-scheduler-toolbar-end {
    display: flex;
    align-items: center;
    gap: var(--sol-space-2, 8px);
}

/* Resource filter */
.sol-scheduler-resource-filter {
    position: relative;
}

.sol-scheduler-resource-filter__trigger {
    gap: var(--sol-space-1, 4px);
}

.sol-scheduler-resource-filter__arrow {
    font-size: 10px;
    opacity: 0.6;
}

.sol-scheduler-resource-filter__backdrop {
    position: fixed;
    inset: 0;
    z-index: 19;
}

.sol-scheduler-resource-filter__dropdown {
    position: absolute;
    top: calc(100% + 4px);
    inset-inline-end: 0;
    z-index: 20;
    background: var(--sol-bg-base, #FFFFFF);
    border: 1px solid var(--sol-border, #E2E5EC);
    border-radius: var(--sol-radius-menu);
    padding: var(--sol-space-2, 8px);
    box-shadow: var(--sol-elev-overlay);
    min-width: 200px;
    display: flex;
    flex-direction: column;
    gap: var(--sol-space-1, 4px);
}

.sol-scheduler-resource-filter__option {
    display: flex;
    align-items: center;
    width: 100%;
    padding: var(--sol-space-2, 8px) var(--sol-space-3, 12px);
    border: none;
    border-radius: var(--sol-radius-control);
    background: transparent;
    color: var(--sol-text-primary, #1A1D27);
    font-size: var(--sol-font-size-sm, 12px);
    cursor: pointer;
    text-align: start;
    transition: background 0.15s;
}

.sol-scheduler-resource-filter__option:hover {
    background: var(--sol-bg-muted, #F0F2F5);
}

.sol-scheduler-resource-filter__option--active {
    background: var(--sol-accent-muted);
    color: var(--sol-accent, #4F7FFF);
    font-weight: var(--sol-font-weight-medium, 500);
}

.sol-scheduler-resource-filter__divider {
    height: 1px;
    background: var(--sol-border, #E2E5EC);
    margin: var(--sol-space-1, 4px) 0;
}

.sol-scheduler-resource-filter__resource {
    display: flex;
    align-items: center;
    gap: var(--sol-space-2, 8px);
    padding: var(--sol-space-1, 4px) var(--sol-space-3, 12px);
    font-size: var(--sol-font-size-sm, 12px);
    cursor: pointer;
    border-radius: var(--sol-radius-control);
    transition: background 0.15s;
}

.sol-scheduler-resource-filter__resource:hover {
    background: var(--sol-bg-muted, #F0F2F5);
}

.sol-scheduler-resource-filter__resource input[type="checkbox"] {
    accent-color: var(--sol-accent, #4F7FFF);
}

.sol-scheduler-resource-filter__dot {
    display: inline-block;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    flex-shrink: 0;
}

.sol-scheduler-resource-filter__shared-label {
    padding: var(--sol-space-2, 8px) var(--sol-space-3, 12px);
    font-size: var(--sol-font-size-xs, 11px);
    font-weight: var(--sol-font-weight-semibold, 600);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--sol-text-tertiary);
}

.sol-scheduler-resource-filter__resource--shared {
    cursor: default;
    opacity: 0.85;
}

.sol-scheduler-resource-filter__resource--shared:hover {
    background: transparent;
}

/* === Time Grid (shared by Week/Day views) === */
.sol-scheduler-timegrid {
    display: flex;
    flex-direction: column;
    height: 100%;
    overflow: hidden;
}

.sol-scheduler-timegrid__day-headers {
    display: grid;
    grid-template-columns: var(--sol-scheduler-time-column-width, 60px) 1fr;
    border-bottom: 1px solid var(--sol-border, #E2E5EC);
    flex-shrink: 0;
    position: sticky;
    top: 0;
    z-index: 5;
    background: var(--sol-bg-surface, #F8F9FB);
}

.sol-scheduler-timegrid__day-headers-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(0, 1fr));
}

.sol-scheduler-timegrid__day-header {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: var(--sol-space-2, 8px) 0;
    font-size: var(--sol-font-size-sm, 12px);
    border-inline-end: 1px solid var(--sol-border-muted, #E2E5EC);
}

.sol-scheduler-timegrid__day-header--today .sol-scheduler-timegrid__day-number {
    background: var(--sol-accent, #4F7FFF);
    color: var(--sol-on-accent);
    border-radius: 50%;
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: var(--sol-font-weight-semibold, 600);
}

.sol-scheduler-timegrid__day-header--group {
    border-bottom: 1px solid var(--sol-border-muted, #E2E5EC);
}

/* Grouped by date, the dates and each day's people beneath them stick as one block: as two
   blocks both pinned at the top, the people covered the dates once the grid scrolled. */
.sol-scheduler-timegrid__day-headers--grouped > .sol-scheduler-timegrid__time-label {
    grid-row: span 2;
}

.sol-scheduler-timegrid__day-headers--grouped > .sol-scheduler-timegrid__day-headers-row {
    grid-column: 2;
}

.sol-scheduler-timegrid__day-headers-row--sub .sol-scheduler-timegrid__column-header {
    padding: var(--sol-space-1, 4px);
    font-size: var(--sol-font-size-xs, 11px);
}

.sol-scheduler-timegrid__day-name {
    color: var(--sol-text-tertiary);
    text-transform: uppercase;
    font-size: var(--sol-font-size-xs, 11px);
    letter-spacing: 0.05em;
}

.sol-scheduler-timegrid__day-number {
    font-size: var(--sol-font-size-md, 14px);
    font-weight: var(--sol-font-weight-medium, 500);
    margin-top: 2px;
}

/* All-day row */
.sol-scheduler-timegrid__allday {
    box-sizing: border-box;
    display: grid;
    grid-template-columns: var(--sol-scheduler-time-column-width, 60px) 1fr;
    border-bottom: 1px solid var(--sol-border, #E2E5EC);
    min-height: 36px;
    flex-shrink: 0;
}

.sol-scheduler-timegrid__allday-events {
    box-sizing: border-box;
    display: grid;
    gap: 2px;
    padding: var(--sol-space-1, 4px);
}

.sol-scheduler-timegrid__allday-cell {
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
    padding: 2px;
    border-inline-end: 1px solid var(--sol-border-muted, #E2E5EC);
}

/* In flow in their column at every width: chips on one day stack instead of overlapping, and a
   title that does not fit ellipsizes instead of spilling over the next days. Relative, not static:
   the resize handle and the tooltip are placed on the chip. */
.sol-scheduler-timegrid__allday-cell > .sol-scheduler-event {
    position: relative;
}

/* Scrollable time grid */
.sol-scheduler-timegrid__scroll {
    box-sizing: border-box;
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
}

.sol-scheduler-timegrid__grid {
    display: grid;
    grid-template-columns: var(--sol-scheduler-time-column-width, 60px) 1fr;
    min-height: 100%;
}

.sol-scheduler-timegrid__time-axis {
    border-inline-end: 1px solid var(--sol-border, #E2E5EC);
}

/* Shares row 1 with the resource header, so the time labels below start level
   with the columns they label. */
.sol-scheduler-timegrid__axis-spacer {
    border-inline-end: 1px solid var(--sol-border, #E2E5EC);
    border-bottom: 1px solid var(--sol-border, #E2E5EC);
}

.sol-scheduler-timegrid__time-label {
    box-sizing: border-box;
    display: flex;
    align-items: flex-start;
    justify-content: flex-end;
    padding: 0 var(--sol-space-2, 8px);
    font-size: var(--sol-font-size-xs, 11px);
    color: var(--sol-text-tertiary);
    position: relative;
    top: -6px;
}

.sol-scheduler-timegrid__columns {
    display: grid;
    position: relative;
}

.sol-scheduler-timegrid__column {
    position: relative;
    border-inline-end: 1px solid var(--sol-border-muted, #E2E5EC);
}

.sol-scheduler-timegrid__column--today {
    background: var(--sol-accent-muted, rgba(79, 127, 255, 0.04));
}

/* All-day event column highlight */
.sol-scheduler-timegrid__column--allday {
    background: color-mix(in srgb, var(--sol-allday-color, #4F7FFF) 6%, transparent);
}

.sol-scheduler-timegrid__column--allday.sol-scheduler-timegrid__column--today {
    background: color-mix(in srgb, var(--sol-allday-color, #4F7FFF) 8%, transparent);
}

/* Drag target column highlight */
.sol-scheduler-timegrid__column--drag-target {
    background: var(--sol-accent-muted, rgba(79, 127, 255, 0.08));
}

.sol-scheduler-timegrid__slot {
    box-sizing: border-box;
    border-bottom: 1px solid var(--sol-border-muted, #E2E5EC);
}

.sol-scheduler-timegrid__slot:nth-child(even) {
    border-bottom-style: dashed;
}

.sol-scheduler-timegrid__slot--clickable {
    cursor: pointer;
}

.sol-scheduler-timegrid__slot--clickable:hover {
    background: var(--sol-accent-muted, rgba(79, 127, 255, 0.06));
}

.sol-scheduler-timegrid__slot--blocked {
    background: var(--sol-bg-sunken);
    background-image: repeating-linear-gradient(
        -45deg,
        transparent,
        transparent 4px,
        rgba(0, 0, 0, 0.04) 4px,
        rgba(0, 0, 0, 0.04) 8px
    );
    cursor: not-allowed;
    position: relative;
}

.sol-scheduler-timegrid__slot-label {
    box-sizing: border-box;
    position: absolute;
    top: 50%;
    left: 50%;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    transform: translate(-50%, -50%);
    font-size: var(--sol-font-size-xs, 11px);
    color: var(--sol-text-tertiary);
    white-space: nowrap;
    pointer-events: none;
}

/* With no room for three characters, the hatching says "blocked" on its own. */
.sol-scheduler-timegrid__slot--blocked {
    container: sol-scheduler-slot / inline-size;
}

@container sol-scheduler-slot (width < 2.5em) {
    .sol-scheduler-timegrid__slot-label {
        display: none;
    }
}

/* Events container (absolute positioning) */
.sol-scheduler-timegrid__events-container {
    position: absolute;
    top: 0;
    inset-inline-start: 0;
    inset-inline-end: 0;
    bottom: 0;
    pointer-events: none;
}

/* Events wholly outside the visible hours are not drawn: a small count at the edge they fall
   past says they exist, and its name says when. It takes the pointer back so its tooltip shows. */
.sol-scheduler-timegrid__outside {
    box-sizing: border-box;
    position: absolute;
    inset-inline: 0;
    width: fit-content;
    max-width: 100%;
    margin-inline: auto;
    z-index: 2;
    padding: 0 var(--sol-space-1, 4px);
    border-radius: var(--sol-radius-control);
    background: var(--sol-bg-muted);
    color: var(--sol-text-secondary);
    font-size: var(--sol-font-size-xs, 11px);
    line-height: 16px;
    text-align: center;
    pointer-events: auto;
}

.sol-scheduler-timegrid__outside--before {
    top: 2px;
}

.sol-scheduler-timegrid__outside--after {
    bottom: 2px;
}

/* Resource headers */
.sol-scheduler-timegrid__column-headers {
    display: grid;
    border-bottom: 1px solid var(--sol-border, #E2E5EC);
}

.sol-scheduler-timegrid__column-header {
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 0;
    padding: var(--sol-space-2, 8px);
    font-size: var(--sol-font-size-sm, 12px);
    font-weight: var(--sol-font-weight-medium, 500);
    border-inline-end: 1px solid var(--sol-border-muted, #E2E5EC);
    container: sol-scheduler-header / inline-size;
}

/* A resource's name is longer than a day's: it ellipsizes inside its column, and a column with
   no room for three characters drops it (the header keeps it as its accessible name). */
.sol-scheduler-timegrid__resource-name {
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

@container sol-scheduler-header (width < 1.75rem) {
    .sol-scheduler-timegrid__resource-name {
        display: none;
    }
}

.sol-scheduler-timegrid__column-bodies {
    display: grid;
    position: relative;
}

/* Shared events overlay — spans all personal resource columns in Day view */
.sol-scheduler-timegrid__shared-overlay {
    position: absolute;
    inset: 0;
    grid-column: 1 / -1;
    pointer-events: none;
    z-index: 2;
}

.sol-scheduler-timegrid__shared-overlay .sol-scheduler-event {
    pointer-events: auto;
}

.sol-scheduler-event--shared {
    opacity: 0.92;
    background-image: repeating-linear-gradient(
        135deg,
        transparent,
        transparent 8px,
        color-mix(in srgb, currentColor 8%, transparent) 8px,
        color-mix(in srgb, currentColor 8%, transparent) 16px
    );
    border-inline-start: 3px solid color-mix(in srgb, currentColor 40%, transparent);
    box-shadow: var(--sol-shadow-sm, 0 1px 3px rgba(0, 0, 0, 0.15));
}

/* === Event Item === */
.sol-scheduler-event {
    box-sizing: border-box;
    position: absolute;
    border-radius: var(--sol-radius-control);
    padding: var(--sol-space-1, 4px) var(--sol-space-2, 8px);
    font-size: var(--sol-font-size-xs, 11px);
    line-height: 1.3;
    overflow: hidden;
    cursor: pointer;
    pointer-events: auto;
    z-index: var(--sol-z-base, 1);
    background: var(--sol-scheduler-event-color, var(--sol-accent, #4F7FFF));
    color: var(--sol-on-accent);
    border-inline-start: 3px solid color-mix(in srgb, var(--sol-scheduler-event-color, var(--sol-accent)) 70%, black);
    transition: box-shadow 0.15s, transform 0.1s;
}

.sol-scheduler-event:hover {
    box-shadow: var(--sol-shadow-md, 0 2px 8px rgba(0, 0, 0, 0.15));
    z-index: 2;
}

.sol-scheduler-event:focus-visible {
    outline: none;
    box-shadow: var(--sol-focus-shadow);
}

.sol-scheduler-event--focused {
    box-shadow: var(--sol-focus-shadow);
    z-index: 3;
}

.sol-scheduler-event__title {
    display: block;
    font-weight: var(--sol-font-weight-medium, 500);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* A title with no room for three characters says nothing: below that the chip keeps its colour,
   its accessible name and its tooltip, and drops the text instead of squeezing it to "…". */
.sol-scheduler-timegrid__events-container > .sol-scheduler-event,
.sol-scheduler-timegrid__allday-cell > .sol-scheduler-event {
    container: sol-scheduler-event / inline-size;
}

@container sol-scheduler-event (width < 2.5em) {
    .sol-scheduler-event__title {
        display: none;
    }
}

.sol-scheduler-event__time {
    display: block;
    opacity: 0.85;
    font-size: 10px;
    white-space: nowrap;
}

/* Tooltip */
.sol-scheduler-event__tooltip {
    position: absolute;
    inset-inline-start: 100%;
    top: 0;
    margin-inline-start: var(--sol-space-2, 8px);
    z-index: var(--sol-z-tooltip, 100);
    background: var(--sol-bg-base, #FFFFFF);
    color: var(--sol-text-primary, #1A1D27);
    border: 1px solid var(--sol-border, #E2E5EC);
    border-radius: var(--sol-radius-menu);
    box-shadow: var(--sol-elev-overlay);
    padding: var(--sol-space-3, 12px);
    min-width: 180px;
    max-width: 280px;
    font-size: var(--sol-font-size-sm, 12px);
    pointer-events: none;
    white-space: normal;
}

/* === Month View === */
.sol-scheduler-month {
    display: flex;
    flex-direction: column;
    height: 100%;
    overflow-y: auto;
}

.sol-scheduler-month__header {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    border-bottom: 1px solid var(--sol-border, #E2E5EC);
    flex-shrink: 0;
}

.sol-scheduler-month__header-cell {
    padding: var(--sol-space-2, 8px);
    text-align: center;
    font-size: var(--sol-font-size-xs, 11px);
    font-weight: var(--sol-font-weight-medium, 500);
    color: var(--sol-text-tertiary);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.sol-scheduler-month__week {
    display: flex;
    flex-direction: column;
    flex: 1;
    /* No fixed floor here: a week with lanes, chips and "+N more" grows to fit them instead
       of spilling into the next one. The floor is on its row of days. */
    border-bottom: 1px solid var(--sol-border-muted, #E2E5EC);
}

.sol-scheduler-month__week:last-child {
    border-bottom: none;
}

/* Multi-day event lanes */
.sol-scheduler-month__lanes {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    padding: 0 2px;
    gap: 2px;
}

.sol-scheduler-month__lane-event {
    min-height: 20px;
}

.sol-scheduler-month__lane-event .sol-scheduler-event {
    position: relative;
    width: 100%;
    padding: 1px var(--sol-space-1, 4px);
}

/* Day cells */
.sol-scheduler-month__days {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    flex: 1;
    min-height: 100px;
}

.sol-scheduler-month__day {
    position: relative;
    padding: var(--sol-space-1, 4px);
    border-inline-end: 1px solid var(--sol-border-muted, #E2E5EC);
    min-height: 60px;
    cursor: pointer;
    overflow: hidden;
}

.sol-scheduler-month__day:last-child {
    border-inline-end: none;
}

.sol-scheduler-month__day:hover {
    background: var(--sol-bg-muted, #F0F2F5);
}

.sol-scheduler-month__day--today {
    background: var(--sol-accent-muted, rgba(79, 127, 255, 0.06));
}

.sol-scheduler-month__day--other-month {
    opacity: 0.4;
}

.sol-scheduler-month__day-number {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: var(--sol-font-size-sm, 12px);
    font-weight: var(--sol-font-weight-medium, 500);
    color: var(--sol-text-secondary, #6B7280);
    width: 24px;
    height: 24px;
    margin-bottom: var(--sol-space-1, 4px);
}

.sol-scheduler-month__day--today .sol-scheduler-month__day-number {
    background: var(--sol-accent, #4F7FFF);
    color: var(--sol-on-accent);
    border-radius: 50%;
}

.sol-scheduler-month__day-event {
    margin-bottom: 2px;
}

.sol-scheduler-month__day-event .sol-scheduler-event {
    position: relative;
    width: 100%;
    padding: 1px var(--sol-space-1, 4px);
    font-size: 10px;
}

.sol-scheduler-month__more {
    display: block;
    width: 100%;
    padding: 2px var(--sol-space-1, 4px);
    background: none;
    border: none;
    font-size: var(--sol-font-size-xs, 11px);
    color: var(--sol-accent, #4F7FFF);
    cursor: pointer;
    text-align: start;
    font-weight: var(--sol-font-weight-medium, 500);
}

.sol-scheduler-month__more:hover {
    text-decoration: underline;
}

/* === Agenda View === */
.sol-scheduler-agenda {
    display: flex;
    flex-direction: column;
    overflow-y: auto;
    height: 100%;
    padding: var(--sol-space-2, 8px) 0;
}

.sol-scheduler-agenda__empty {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: var(--sol-space-6, 24px);
    color: var(--sol-text-tertiary);
    font-size: var(--sol-font-size-md, 14px);
}

.sol-scheduler-agenda__day {
    padding: 0 var(--sol-space-3, 12px);
    margin-bottom: var(--sol-space-2, 8px);
}

.sol-scheduler-agenda__day-header {
    display: flex;
    align-items: baseline;
    gap: var(--sol-space-2, 8px);
    padding: var(--sol-space-2, 8px) 0;
    border-bottom: 1px solid var(--sol-border-muted, #E2E5EC);
    margin-bottom: var(--sol-space-1, 4px);
}

.sol-scheduler-agenda__day--today .sol-scheduler-agenda__day-header {
    border-bottom-color: var(--sol-accent, #4F7FFF);
}

.sol-scheduler-agenda__day-name {
    font-weight: var(--sol-font-weight-semibold, 600);
    font-size: var(--sol-font-size-md, 14px);
    color: var(--sol-text-primary, #1A1D27);
}

.sol-scheduler-agenda__day--today .sol-scheduler-agenda__day-name {
    color: var(--sol-accent, #4F7FFF);
}

.sol-scheduler-agenda__day-date {
    font-size: var(--sol-font-size-sm, 12px);
    color: var(--sol-text-tertiary);
}

.sol-scheduler-agenda__events {
    display: flex;
    flex-direction: column;
    gap: var(--sol-space-1, 4px);
}

.sol-scheduler-agenda__event {
    display: flex;
    align-items: center;
    gap: var(--sol-space-3, 12px);
    padding: var(--sol-space-2, 8px) var(--sol-space-3, 12px);
    border-radius: var(--sol-radius-control);
    cursor: pointer;
    transition: background 0.15s;
}

.sol-scheduler-agenda__event:hover {
    background: var(--sol-bg-muted, #F0F2F5);
}

.sol-scheduler-agenda__event:focus-visible {
    outline: none;
    box-shadow: var(--sol-focus-shadow);
}

.sol-scheduler-agenda__event-color {
    width: 4px;
    height: 32px;
    border-radius: 2px;
    background: var(--sol-scheduler-event-color, var(--sol-accent, #4F7FFF));
    flex-shrink: 0;
}

.sol-scheduler-agenda__event-time {
    display: flex;
    flex-direction: column;
    min-width: 60px;
    font-size: var(--sol-font-size-sm, 12px);
    color: var(--sol-text-tertiary);
    line-height: 1.4;
}

.sol-scheduler-agenda__event-title {
    font-size: var(--sol-font-size-base, 13px);
    font-weight: var(--sol-font-weight-medium, 500);
    color: var(--sol-text-primary, #1A1D27);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* === Timeline View === */
.sol-scheduler-timeline {
    display: flex;
    flex-direction: column;
    height: 100%;
    overflow: hidden;
}

.sol-scheduler-timeline__header {
    display: flex;
    border-bottom: 1px solid var(--sol-border, #E2E5EC);
    flex-shrink: 0;
}

.sol-scheduler-timeline__resource-label {
    min-width: var(--sol-scheduler-timeline-resource-width, 140px);
    max-width: var(--sol-scheduler-timeline-resource-width, 140px);
    border-inline-end: 1px solid var(--sol-border, #E2E5EC);
}

.sol-scheduler-timeline__time-headers {
    display: flex;
    flex: 1;
    overflow: hidden;
}

.sol-scheduler-timeline__time-header {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: var(--sol-space-2, 8px) 0;
    font-size: var(--sol-font-size-xs, 11px);
    color: var(--sol-text-tertiary);
    border-inline-end: 1px solid var(--sol-border-muted, #E2E5EC);
}

.sol-scheduler-timeline__body {
    flex: 1;
    overflow-y: auto;
    overflow-x: auto;
}

.sol-scheduler-timeline__row {
    display: flex;
    min-height: 48px;
    border-bottom: 1px solid var(--sol-border-muted, #E2E5EC);
}

.sol-scheduler-timeline__resource-cell {
    min-width: var(--sol-scheduler-timeline-resource-width, 140px);
    max-width: var(--sol-scheduler-timeline-resource-width, 140px);
    display: flex;
    align-items: center;
    padding: 0 var(--sol-space-3, 12px);
    border-inline-end: 1px solid var(--sol-border, #E2E5EC);
    background: var(--sol-bg-surface, #F8F9FB);
    font-size: var(--sol-font-size-sm, 12px);
    font-weight: var(--sol-font-weight-medium, 500);
    flex-shrink: 0;
}

.sol-scheduler-timeline__slots {
    display: grid;
    flex: 1;
    position: relative;
}

.sol-scheduler-timeline__slot {
    border-inline-end: 1px solid var(--sol-border-muted, #E2E5EC);
}

.sol-scheduler-timeline__slot--blocked {
    background: var(--sol-bg-sunken);
    background-image: repeating-linear-gradient(
        -45deg,
        transparent,
        transparent 4px,
        rgba(0, 0, 0, 0.04) 4px,
        rgba(0, 0, 0, 0.04) 8px
    );
}

.sol-scheduler-timeline__events {
    position: absolute;
    top: 4px;
    bottom: 4px;
    inset-inline-start: 0;
    inset-inline-end: 0;
    pointer-events: none;
}

.sol-scheduler-timeline__event {
    box-sizing: border-box;
    position: absolute;
    top: 0;
    bottom: 0;
    border-radius: var(--sol-radius-control);
    background: var(--sol-scheduler-event-color, var(--sol-accent, #4F7FFF));
    color: var(--sol-on-accent);
    padding: 2px var(--sol-space-2, 8px);
    font-size: var(--sol-font-size-xs, 11px);
    overflow: hidden;
    cursor: pointer;
    pointer-events: auto;
    display: flex;
    align-items: center;
    border-inline-start: 3px solid color-mix(in srgb, var(--sol-scheduler-event-color, var(--sol-accent)) 70%, black);
    transition: box-shadow 0.15s;
}

/* An event's own color decides its text, so a resource or category color reads too. */
@supports (color: color(from red xyz-d65 x y z)) {
  .sol-scheduler-event,
  .sol-scheduler-timeline__event {
    color: color(from var(--sol-scheduler-event-color, var(--sol-accent)) xyz-d65 calc(0.9505 * clamp(0, (0.1791 - y) * 100000, 1)) clamp(0, (0.1791 - y) * 100000, 1) calc(1.089 * clamp(0, (0.1791 - y) * 100000, 1)));
  }
}

.sol-scheduler-timeline__event:hover {
    box-shadow: var(--sol-shadow-md, 0 2px 8px rgba(0, 0, 0, 0.15));
    z-index: 2;
}

.sol-scheduler-timeline__event-title {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    font-weight: var(--sol-font-weight-medium, 500);
}

/* === Responsive / Adaptive === */
@media (max-width: 768px) {
    .sol-scheduler-toolbar {
        flex-wrap: wrap;
        gap: var(--sol-space-2, 8px);
    }

    .sol-scheduler-toolbar-title {
        order: -1;
        width: 100%;
        text-align: center;
        font-size: var(--sol-font-size-md, 14px);
    }

    .sol-scheduler-toolbar-nav {
        flex: 1;
        justify-content: flex-start;
    }

    .sol-scheduler-toolbar-views {
        flex: 1;
        justify-content: flex-end;
        flex-wrap: wrap;
    }

    .sol-scheduler-toolbar-btn {
        padding: 0 var(--sol-space-2, 8px);
        font-size: var(--sol-font-size-xs, 11px);
        height: 30px;
    }

    .sol-scheduler-timegrid__day-header {
        padding: var(--sol-space-1, 4px) 0;
    }

    .sol-scheduler-timegrid__day-name {
        font-size: 10px;
    }

    .sol-scheduler-timegrid__day-number {
        font-size: var(--sol-font-size-sm, 12px);
    }

    .sol-scheduler-event {
        padding: 2px var(--sol-space-1, 4px);
        font-size: 10px;
    }

    .sol-scheduler-event__time {
        display: none;
    }

    .sol-scheduler-month__day-number {
        font-size: var(--sol-font-size-xs, 11px);
        width: 20px;
        height: 20px;
    }

    .sol-scheduler-month__header-cell {
        font-size: 10px;
        padding: var(--sol-space-1, 4px);
    }

    .sol-scheduler-month__day {
        padding: 2px;
        min-height: 48px;
    }

    .sol-scheduler-agenda__event {
        gap: var(--sol-space-2, 8px);
        padding: var(--sol-space-2, 8px);
    }

    .sol-scheduler-agenda__event-time {
        min-width: 48px;
        font-size: var(--sol-font-size-xs, 11px);
    }
}

@media (max-width: 480px) {
    /* Every view stays reachable: one row that scrolls sideways. The padding, taken back by
       the margin, leaves room for the focus ring the scroll box would otherwise clip. */
    .sol-scheduler-toolbar-views {
        flex: 1 1 100%;
        flex-wrap: nowrap;
        justify-content: flex-start;
        overflow-x: auto;
        overscroll-behavior-x: contain;
        scrollbar-width: thin;
        padding: 3px;
        margin: -3px;
    }

    .sol-scheduler-toolbar-views > .sol-scheduler-toolbar-btn {
        flex-shrink: 0;
    }

    .sol-scheduler-timegrid__time-label {
        font-size: 10px;
    }

    .sol-scheduler {
        --sol-scheduler-time-column-width: 44px;
    }

    .sol-scheduler-month__header-cell {
        padding: 2px;
    }

    .sol-scheduler-month__day {
        min-height: 36px;
    }
}

/* === Drag & Drop === */
.sol-scheduler-event--dragging {
    opacity: 0.85;
    box-shadow: var(--sol-elev-overlay);
    z-index: 10 !important;
    cursor: grabbing;
}

.sol-scheduler-event--resizing {
    z-index: 10 !important;
    cursor: ns-resize;
}

/* === Resize Handle === */
.sol-scheduler-event__resize-handle {
    position: absolute;
    bottom: 0;
    inset-inline-start: 0;
    inset-inline-end: 0;
    height: 6px;
    cursor: ns-resize;
    border-radius: 0 0 var(--sol-radius-control) var(--sol-radius-control);
    background: transparent;
    transition: background 0.15s;
}

.sol-scheduler-event:hover .sol-scheduler-event__resize-handle {
    background: color-mix(in srgb, currentColor 30%, transparent);
}

/* === Current Time Indicator === */
.sol-scheduler-time-indicator {
    position: absolute;
    inset-inline-start: var(--sol-scheduler-time-column-width, 60px);
    inset-inline-end: 0;
    z-index: var(--sol-z-elevated, 5);
    pointer-events: none;
    display: flex;
    align-items: center;
}

.sol-scheduler-time-indicator__dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: var(--sol-danger, #EF4444);
    margin-inline-start: -5px;
    flex-shrink: 0;
}

.sol-scheduler-time-indicator__line {
    flex: 1;
    height: 2px;
    background: var(--sol-danger, #EF4444);
}

/* === Quick Info Popup === */
.sol-scheduler-overlay--transparent {
    background: transparent;
}

.sol-scheduler-quickinfo {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: var(--sol-bg-elevated);
    border-radius: var(--sol-radius-menu);
    box-shadow: var(--sol-elev-overlay);
    padding: var(--sol-space-3, 12px);
    min-width: 240px;
    max-width: 360px;
    z-index: var(--sol-z-modal, 1000);
}

/* === Context Menu === */
.sol-scheduler-contextmenu {
    position: fixed;
    background: var(--sol-bg-elevated);
    border: 1px solid var(--sol-border, #E2E5EC);
    border-radius: var(--sol-radius-menu);
    box-shadow: var(--sol-elev-overlay);
    padding: var(--sol-space-1, 4px) 0;
    min-width: 160px;
    z-index: var(--sol-z-modal, 1000);
    font-size: var(--sol-font-size-sm, 12px);
}

/* === Overlay (quick info, context menu) === */
.sol-scheduler-overlay {
    position: absolute;
    inset: 0;
    background: var(--sol-overlay, rgba(0, 0, 0, 0.45));
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: var(--sol-z-modal, 1000);
}

/* === Edit dialog ===
   The edit form is a dialog: above the page, never clipped by the scheduler. It keeps the form's
   own width (320–480px plus padding), clamped to the viewport; a phone gets it full width. */
.sol-dialog.sol-scheduler-edit-popup {
    box-sizing: border-box;
    width: auto;
    min-width: min(352px, 100%);
    max-width: min(512px, 100%);
}

.sol-scheduler-edit-popup > .sol-dialog__body {
    padding: var(--sol-space-4, 16px);
    line-height: inherit;
}

/* === Default Edit Form === */
.sol-scheduler-default-form {
    min-width: 320px;
    color: var(--sol-text-primary, #1F2937);
}

@media (max-width: 480px) {
    .sol-dialog.sol-scheduler-edit-popup {
        width: 100%;
        min-width: 0;
    }

    .sol-scheduler-default-form {
        min-width: 0;
    }
}

.sol-scheduler-default-form__title {
    margin: 0 0 var(--sol-space-3, 12px) 0;
    font-size: var(--sol-font-size-md, 16px);
    font-weight: var(--sol-font-weight-semibold, 600);
}

.sol-scheduler-default-form__readonly-title {
    padding: var(--sol-space-2, 8px) 0;
    margin-bottom: var(--sol-space-3, 12px);
    font-weight: var(--sol-font-weight-medium, 500);
    color: var(--sol-text-primary, #1F2937);
}

.sol-scheduler-default-form__field {
    margin-bottom: var(--sol-space-3, 12px);
}

.sol-scheduler-default-form__field--inline {
    display: flex;
    align-items: center;
    gap: var(--sol-space-2, 8px);
}

.sol-scheduler-default-form__label {
    display: block;
    font-size: var(--sol-font-size-xs, 12px);
    font-weight: var(--sol-font-weight-medium, 500);
    color: var(--sol-text-secondary, #6B7280);
    margin-bottom: var(--sol-space-1, 4px);
}

.sol-scheduler-default-form__field--inline .sol-scheduler-default-form__label {
    box-sizing: border-box;
    margin-bottom: 0;
    font-size: var(--sol-font-size-sm, 14px);
    color: var(--sol-text-primary, #1F2937);
    cursor: pointer;
}

.sol-scheduler-default-form__input {
    width: 100%;
    padding: var(--sol-space-2, 8px) var(--sol-space-3, 12px);
    background: var(--sol-bg-sunken);
    color: var(--sol-text-primary, #1F2937);
    border: 1px solid var(--sol-border, #D1D5DB);
    border-radius: var(--sol-radius-control);
    font-size: max(var(--sol-font-size-sm, 14px), var(--sol-font-size-field-min, 0px));
    font-family: inherit;
    box-sizing: border-box;
}

.sol-scheduler-default-form__input:focus {
    outline: none;
    border-color: var(--sol-accent, #4F7FFF);
    box-shadow: var(--sol-focus-shadow);
}

.sol-scheduler-default-form__grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: var(--sol-space-2, 8px);
    margin-bottom: var(--sol-space-3, 12px);
}

.sol-scheduler-default-form__error {
    padding: var(--sol-space-2, 8px) var(--sol-space-3, 12px);
    margin-bottom: var(--sol-space-3, 12px);
    background: var(--sol-danger-muted, #FEF2F2);
    border: 1px solid var(--sol-danger, #FECACA);
    border-radius: var(--sol-radius-control);
    font-size: var(--sol-font-size-xs, 12px);
    color: var(--sol-danger);
}

.sol-scheduler-default-form__actions {
    display: flex;
    gap: var(--sol-space-2, 8px);
    justify-content: flex-end;
    margin-top: var(--sol-space-4, 16px);
}

.sol-scheduler-default-form__btn {
    box-sizing: border-box;
    padding: var(--sol-space-2, 8px) var(--sol-space-3, 14px);
    border: 1px solid var(--sol-border, #D1D5DB);
    background: transparent;
    color: var(--sol-text-primary, #374151);
    border-radius: var(--sol-radius-action);
    font-size: var(--sol-font-size-sm, 14px);
    font-weight: var(--sol-font-weight-medium, 500);
    cursor: pointer;
    transition: background 0.15s ease;
}

.sol-scheduler-default-form__btn:hover:not(:disabled) {
    background: var(--sol-bg-muted, #F3F4F6);
}

.sol-scheduler-default-form__btn--primary {
    background: var(--sol-accent, #4F7FFF);
    border-color: var(--sol-accent, #4F7FFF);
    color: var(--sol-on-accent);
}

.sol-scheduler-default-form__btn--primary:hover:not(:disabled) {
    background: var(--sol-accent-hover, #3B6BE6);
}

.sol-scheduler-default-form__btn--primary:disabled {
    background: var(--sol-accent-muted, #93C5FD);
    border-color: var(--sol-accent-muted, #93C5FD);
    cursor: not-allowed;
}

.sol-scheduler-default-form__btn--danger {
    color: var(--sol-danger, #EF4444);
    border-color: var(--sol-danger, #EF4444);
    margin-inline-end: auto;
}

.sol-scheduler-default-form__btn--danger:hover:not(:disabled) {
    background: var(--sol-danger-muted, #FEF2F2);
}

/* === Hierarchical Resources === */
.sol-scheduler-resource-header {
    display: flex;
    align-items: center;
    gap: var(--sol-space-1, 4px);
    width: 100%;
}

.sol-scheduler-resource-header--parent {
    font-weight: var(--sol-font-weight-semibold, 600);
}

.sol-scheduler-resource-header__toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 18px;
    height: 18px;
    padding: 0;
    border: none;
    background: transparent;
    cursor: pointer;
    border-radius: var(--sol-radius-control);
    color: var(--sol-text-secondary, #6B7280);
    font-size: 10px;
    transition: transform 0.15s, background 0.15s;
    flex-shrink: 0;
}

.sol-scheduler-resource-header__toggle:hover {
    background: var(--sol-bg-muted);
}

.sol-scheduler-resource-header__toggle--collapsed {
    transform: rotate(-90deg);
}

.sol-scheduler-resource-header__indent {
    flex-shrink: 0;
}

.sol-scheduler-resource-header__color {
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    flex-shrink: 0;
}

.sol-scheduler-resource-header__title {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* === Recurring Event Indicator === */
.sol-scheduler-event__recurrence-icon {
    display: inline-flex;
    align-items: center;
    margin-inline-start: var(--sol-space-1, 4px);
    opacity: 0.7;
    font-size: 10px;
    flex-shrink: 0;
}

.sol-scheduler-event__recurrence-icon::before {
    content: "↻";
}

/* === Recurrence Editor === */
.sol-recurrence-editor {
    display: flex;
    flex-direction: column;
    gap: var(--sol-space-2, 8px);
    font-size: var(--sol-font-size-sm, 12px);
    color: var(--sol-text-primary, #1A1D27);
}

.sol-recurrence-editor__row {
    display: flex;
    align-items: center;
    gap: var(--sol-space-2, 8px);
    flex-wrap: wrap;
}

.sol-recurrence-editor__row--indent {
    padding-inline-start: var(--sol-space-4, 16px);
}

.sol-recurrence-editor__label {
    display: flex;
    align-items: center;
    gap: var(--sol-space-1, 4px);
    font-weight: var(--sol-font-weight-medium, 500);
    min-width: 60px;
    flex-shrink: 0;
}

.sol-recurrence-editor__checkbox {
    accent-color: var(--sol-accent, #4F7FFF);
}

.sol-recurrence-editor__select {
    padding: var(--sol-space-1, 4px) var(--sol-space-2, 8px);
    border: 1px solid var(--sol-border, #E2E5EC);
    border-radius: var(--sol-radius-control);
    background: var(--sol-bg-base, #FFFFFF);
    color: inherit;
    font-size: max(1em, var(--sol-font-size-field-min, 0px));
    min-width: 100px;
}

.sol-recurrence-editor__input {
    padding: var(--sol-space-1, 4px) var(--sol-space-2, 8px);
    border: 1px solid var(--sol-border, #E2E5EC);
    border-radius: var(--sol-radius-control);
    background: var(--sol-bg-base, #FFFFFF);
    color: inherit;
    font-size: max(1em, var(--sol-font-size-field-min, 0px));
}

.sol-recurrence-editor__input--narrow {
    width: 64px;
    text-align: center;
}

.sol-recurrence-editor__suffix {
    color: var(--sol-text-secondary, #6B7280);
}

.sol-recurrence-editor__days {
    display: flex;
    gap: var(--sol-space-1, 4px);
    flex-wrap: wrap;
}

/* A toggle button per weekday: a Tab stop, pressed state in aria-pressed. */
.sol-recurrence-editor__day {
    box-sizing: border-box;
    display: flex;
    align-items: center;
    justify-content: center;
    /* min-width, not width: an abbreviated day name ("mié.", "Thu") grows the button instead of clipping. */
    min-width: 34px;
    height: calc(var(--sol-control-h) - 4px);
    padding: 0 4px;
    border: 1px solid var(--sol-border, #E2E5EC);
    border-radius: var(--sol-radius-action);
    background: transparent;
    color: inherit;
    font-family: inherit;
    cursor: pointer;
    user-select: none;
    font-size: var(--sol-font-size-xs, 11px);
    font-weight: var(--sol-font-weight-medium, 500);
    transition: background 0.15s, border-color 0.15s, color 0.15s;
}

.sol-recurrence-editor__day:hover {
    border-color: var(--sol-accent, #4F7FFF);
}

.sol-recurrence-editor__day:focus-visible {
    outline: none;
    box-shadow: var(--sol-focus-shadow);
}

.sol-recurrence-editor__day--selected {
    background: var(--sol-accent, #4F7FFF);
    border-color: var(--sol-accent, #4F7FFF);
    color: var(--sol-on-accent);
}

/* === Slot Selection Overlay === */
.sol-scheduler-slot-selection {
    position: absolute;
    inset-inline-start: 0;
    inset-inline-end: 0;
    background: color-mix(in srgb, var(--sol-accent) 18%, transparent);
    border: 1px solid var(--sol-accent, #4F7FFF);
    border-radius: var(--sol-radius-control);
    pointer-events: none;
    z-index: var(--sol-z-elevated, 5);
}

/* === Month Drag Target === */
.sol-scheduler-month__day--drag-target {
    background: color-mix(in srgb, var(--sol-accent) 10%, transparent) !important;
    outline: 2px dashed var(--sol-accent, #4F7FFF);
    outline-offset: -2px;
}

.sol-recurrence-editor__summary {
    padding: var(--sol-space-2, 8px);
    background: var(--sol-bg-surface, #F8F9FB);
    border-radius: var(--sol-radius-control);
    color: var(--sol-text-secondary, #6B7280);
    font-size: var(--sol-font-size-xs, 11px);
    font-style: italic;
}

/* === Collaboration === */
.sol-scheduler-collab-users {
    display: flex;
    align-items: center;
    gap: var(--sol-space-1, 4px);
    padding: var(--sol-space-1, 4px) var(--sol-space-3, 12px);
    border-bottom: 1px solid var(--sol-border, #E5E7EB);
    background: var(--sol-bg-surface, #F8F9FB);
}

.sol-scheduler-collab-avatar {
    --sol-collab-color: var(--sol-accent, #4F7FFF);
    position: relative;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    border: 2px solid var(--sol-collab-color);
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--sol-bg-elevated);
    cursor: default;
    transition: transform 150ms var(--sol-ease, ease);
    flex-shrink: 0;
}

.sol-scheduler-collab-avatar:hover {
    transform: scale(1.1);
    z-index: 1;
}

.sol-scheduler-collab-avatar--idle {
    opacity: 0.5;
}

.sol-scheduler-collab-avatar--overflow {
    border-style: dashed;
    border-color: var(--sol-text-secondary, #6B7280);
}

.sol-scheduler-collab-avatar__img {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    object-fit: cover;
}

.sol-scheduler-collab-avatar__initials {
    font-size: var(--sol-font-size-xs, 11px);
    font-weight: var(--sol-font-weight-semibold, 600);
    color: var(--sol-collab-color);
    line-height: 1;
    user-select: none;
}

.sol-scheduler-collab-avatar--editing {
    animation: sol-collab-pulse 1.5s infinite;
}

@keyframes sol-collab-pulse {
    0%, 100% { box-shadow: 0 0 0 0 var(--sol-collab-color); }
    50% { box-shadow: 0 0 0 3px color-mix(in srgb, var(--sol-collab-color) 30%, transparent); }
}


/* Hours, times and date numbers speak the data voice: mono + tabular-nums. */
.sol-scheduler-timegrid__time-label,
.sol-scheduler-timegrid__slot-label,
.sol-scheduler-timegrid__day-number,
.sol-scheduler-event__time,
.sol-scheduler-month__day-number,
.sol-scheduler-agenda__day-date,
.sol-scheduler-agenda__event-time,
.sol-scheduler-timeline__time-header {
    font-family: var(--sol-font-family-mono);
    font-variant-numeric: tabular-nums;
}

/* Reduced motion — decorative presence pulse off; event hover lift instant. */
@media (prefers-reduced-motion: reduce) {
    .sol-scheduler-collab-avatar--editing {
        animation: none;
    }
    .sol-scheduler-event {
        transition-duration: 0.01ms;
    }
}

/* Touch: the toolbar buttons reach the 44px minimum. Declared after the narrow-screen
   rule that shrinks them, which is right for a small window driven by a mouse only. */
@media (pointer: coarse) {
    .sol-scheduler-toolbar-btn {
        height: calc(var(--sol-control-h) - 4px);
        min-width: var(--sol-touch-target-min, 2.75rem);
    }

    /* The edit form's fields, buttons and the all-day toggle's label; fields are 16px already. */
    .sol-scheduler-default-form__input {
        min-height: var(--sol-touch-target-min);
    }

    .sol-scheduler-default-form__btn {
        min-width: var(--sol-touch-target-min);
        min-height: var(--sol-touch-target-min);
    }

    .sol-scheduler-default-form__field--inline .sol-scheduler-default-form__label {
        display: inline-flex;
        align-items: center;
        min-width: var(--sol-touch-target-min);
        min-height: var(--sol-touch-target-min);
    }

    /* The recurrence editor's controls. */
    .sol-recurrence-editor__label,
    .sol-recurrence-editor__select,
    .sol-recurrence-editor__input {
        box-sizing: border-box;
        min-height: var(--sol-touch-target-min);
    }

    .sol-recurrence-editor__day {
        min-width: var(--sol-touch-target-min);
    }

    /* All-day chips have the row's height to give; a timed chip's height is its duration. The row
       makes room for one chip, which sits inside the row's and the cell's padding. */
    .sol-scheduler-timegrid__allday {
        min-height: calc(var(--sol-touch-target-min) + 2 * (var(--sol-space-1, 4px) + 2px));
    }

    .sol-scheduler-timegrid__allday-cell > .sol-scheduler-event {
        display: flex;
        flex-direction: column;
        justify-content: center;
        min-height: var(--sol-touch-target-min);
    }
}

/* Forced touch (data-sol-touch on <html>): the block above, whatever the pointer. */
:where([data-sol-touch]) .sol-scheduler-toolbar-btn {
  height: calc(var(--sol-control-h) - 4px);
  min-width: var(--sol-touch-target-min, 2.75rem);
}
:where([data-sol-touch]) .sol-scheduler-default-form__input {
  min-height: var(--sol-touch-target-min);
}
:where([data-sol-touch]) .sol-scheduler-default-form__btn {
  min-width: var(--sol-touch-target-min);
  min-height: var(--sol-touch-target-min);
}
:where([data-sol-touch]) .sol-scheduler-default-form__field--inline .sol-scheduler-default-form__label {
  display: inline-flex;
  align-items: center;
  min-width: var(--sol-touch-target-min);
  min-height: var(--sol-touch-target-min);
}
:where([data-sol-touch]) .sol-recurrence-editor__label,
:where([data-sol-touch]) .sol-recurrence-editor__select,
:where([data-sol-touch]) .sol-recurrence-editor__input {
  box-sizing: border-box;
  min-height: var(--sol-touch-target-min);
}
:where([data-sol-touch]) .sol-recurrence-editor__day {
  min-width: var(--sol-touch-target-min);
}
:where([data-sol-touch]) .sol-scheduler-timegrid__allday {
  min-height: calc(var(--sol-touch-target-min) + 2 * (var(--sol-space-1, 4px) + 2px));
}
:where([data-sol-touch]) .sol-scheduler-timegrid__allday-cell > .sol-scheduler-event {
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-height: var(--sol-touch-target-min);
}

} /* @layer solsticio-components */

/* ============================================================
   Forced colors — chips, today, selection and focus keep a border.
   ============================================================ */
@layer solsticio-components {
  @media (forced-colors: active) {
    .sol-scheduler-timegrid__outside { border: 1px solid CanvasText; }
    .sol-scheduler-event,
    .sol-scheduler-month__lane-event,
    .sol-scheduler-month__day-event,
    .sol-scheduler-timeline__event,
    .sol-scheduler-agenda__event { border: 1px solid CanvasText; }
    .sol-scheduler-event--shared { border-style: dashed; }
    .sol-scheduler-event--dragging,
    .sol-scheduler-event--resizing { outline: 2px dashed Highlight; }
    .sol-scheduler-event:focus-visible,
    .sol-scheduler-event--focused,
    .sol-scheduler-agenda__event:focus-visible,
    .sol-scheduler-toolbar-btn:focus-visible,
    .sol-recurrence-editor__day:focus-visible {
      outline: 2px solid Highlight;
      outline-offset: 1px;
      box-shadow: none;
    }
    .sol-scheduler-toolbar-btn { border: 1px solid ButtonText; }
    .sol-scheduler-toolbar-btn--active,
    .sol-scheduler-toolbar-btn[aria-pressed="true"],
    .sol-recurrence-editor__day[aria-pressed="true"] { border-width: 2px; text-decoration: underline; }
    .sol-scheduler-timegrid__column--today,
    .sol-scheduler-month__day--today,
    .sol-scheduler-agenda__day--today,
    [aria-current="date"] { outline: 2px solid Highlight; outline-offset: -2px; }
    .sol-scheduler-slot-selection,
    [aria-selected="true"] { border: 2px dashed Highlight; background: transparent; }
    .sol-scheduler-timegrid__slot--blocked { border: 1px dashed GrayText; }
    .sol-scheduler-timegrid__column--drag-target,
    .sol-scheduler-month__day--drag-target { outline: 2px dashed Highlight; }
    .sol-scheduler-time-indicator__line { forced-color-adjust: none; background: Highlight; }
    .sol-scheduler-time-indicator__dot { forced-color-adjust: none; background: Highlight; }
  }
}

/* Entrances: the context menu and the resource filter pour out of where they open, and their items
   follow one step apart (tokens: entrance primitive). */
@layer solsticio-components {
  .sol-scheduler-contextmenu,
  .sol-scheduler-resource-filter__dropdown {
    animation: sol-enter-pour var(--sol-motion-enter) var(--sol-ease-enter) backwards;
  }

  .sol-scheduler-contextmenu > *,
  .sol-scheduler-resource-filter__dropdown > * {
    animation: sol-enter-item var(--sol-step-time, 0s) var(--sol-ease-enter)
      calc(var(--sol-step, 0) * var(--sol-motion-step)) backwards;
  }
}

/* ============================================================
   Light — where a drag lands, a clash, who is editing, a new event, now.
   ============================================================ */
@layer solsticio-components {
  /* Where a dragged event would land: light on two opposite corners over the slot (sol-scheduler-landing.ts). */
  /* Over the dragged chip (z-index 100), so its corners show wherever the chip is. */
  .sol-scheduler-landing {
    position: absolute;
    inset-inline: 2px;
    z-index: 101;
    box-sizing: border-box;
    pointer-events: none;
  }

  .sol-scheduler-landing::before,
  .sol-scheduler-landing::after {
    content: "";
    position: absolute;
    width: 12px;
    height: 12px;
    box-sizing: border-box;
    border: 0 solid var(--sol-accent);
    filter: drop-shadow(0 0 5px color-mix(in srgb, var(--sol-accent) calc(var(--sol-fx-glow) * 100%), transparent));
  }

  .sol-scheduler-landing::before {
    inset-block-start: 0;
    inset-inline-start: 0;
    border-block-start-width: 2px;
    border-inline-start-width: 2px;
    border-start-start-radius: 4px;
  }

  .sol-scheduler-landing::after {
    inset-block-end: 0;
    inset-inline-end: 0;
    border-block-end-width: 2px;
    border-inline-end-width: 2px;
    border-end-end-radius: 4px;
  }

  .sol-scheduler-landing--clash::before,
  .sol-scheduler-landing--clash::after {
    border-color: var(--sol-danger);
    filter: drop-shadow(0 0 5px color-mix(in srgb, var(--sol-danger) calc(var(--sol-fx-glow) * 100%), transparent));
  }

  /* A clash: the dragged event and every one it would overlap turn red while the drag lasts. */
  .sol-scheduler-event[data-sol-clash] {
    border-color: var(--sol-danger);
    box-shadow: 0 0 0 1px var(--sol-danger),
      0 0 12px color-mix(in srgb, var(--sol-danger) calc(var(--sol-fx-glow) * 90%), transparent);
    animation: sol-scheduler-clash 0.9s ease-in-out infinite;
  }

  /* Someone else is editing it: the edge light in their color, and their name. */
  .sol-scheduler-event--remote-edit > .sol-edge-light {
    --sol-edge-light-color: var(--sol-collab-color, var(--sol-accent));
  }

  /* A month chip is small: the light and the description say who; the name tag stays off. */
  .sol-scheduler-month__day-event.sol-scheduler-event--remote-edit { position: relative; }
  .sol-scheduler-month__day-event .sol-scheduler-event__editor { display: none; }

  .sol-scheduler-event__editor {
    position: absolute;
    inset-block-start: 2px;
    inset-inline-end: 2px;
    z-index: 2;
    max-width: calc(100% - 4px);
    box-sizing: border-box;
    padding: 0 6px;
    overflow: hidden;
    border: 1px solid var(--sol-collab-color, var(--sol-accent));
    border-radius: 999px;
    background: color-mix(in srgb, var(--sol-collab-color, var(--sol-accent)) 16%, var(--sol-bg-surface));
    color: var(--sol-text-primary);
    font-size: 0.62rem;
    font-weight: 600;
    line-height: 1.5;
    text-overflow: ellipsis;
    white-space: nowrap;
    pointer-events: none;
  }

  /* An event shown appearing (RevealEventAsync / revealEvent): hidden while the dots gather, then fades in. */
  :is(.sol-scheduler-event, .sol-scheduler-month__day-event)[data-sol-reveal="hidden"] { opacity: 0; }
  :is(.sol-scheduler-event, .sol-scheduler-month__day-event)[data-sol-reveal="fresh"] { animation: sol-scheduler-appear 0.4s ease-out; }

  /* Now: the line's head breathes. */
  .sol-scheduler-time-indicator__dot {
    animation: sol-scheduler-now var(--sol-fx-breathe-duration) ease-in-out infinite;
  }

  @keyframes sol-scheduler-clash {
    50% { box-shadow: 0 0 0 1px var(--sol-danger); }
  }

  @keyframes sol-scheduler-appear {
    from { opacity: 0; }
  }

  @keyframes sol-scheduler-now {
    0%, 100% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--sol-danger) calc(var(--sol-fx-glow) * 70%), transparent); }
    50% { box-shadow: 0 0 0 5px color-mix(in srgb, var(--sol-danger) 0%, transparent); }
  }

  @media (prefers-reduced-motion: reduce) {
    .sol-scheduler-event[data-sol-clash],
    :is(.sol-scheduler-event, .sol-scheduler-month__day-event)[data-sol-reveal="fresh"],
    .sol-scheduler-time-indicator__dot {
      animation: none;
    }
  }

  @media (forced-colors: active) {
    .sol-scheduler-landing::before,
    .sol-scheduler-landing::after {
      border-color: Highlight;
      filter: none;
    }

    .sol-scheduler-event[data-sol-clash] { outline: 2px solid Mark; }
    .sol-scheduler-event__editor { border-color: CanvasText; }
  }
}
