/*
 * Simple Calendar — Design System & Component Stylesheet
 * =========================================================
 * Architecture: BEM + CSS Custom Properties (design tokens)
 * All selectors are namespaced under .sc-calendar-wrap to
 * prevent collisions with the active WordPress theme.
 *
 * TOKEN LAYERS
 *  L0 — Primitive palette (raw hex values)
 *  L1 — Semantic tokens   (colour roles)
 *  L2 — Component tokens  (per-component defaults)
 *
 * OVERRIDE SURFACE
 *  Override any L1/L2 token in :root or on .sc-calendar-wrap
 *  to reskin the whole plugin without touching this file.
 *
 * PRESET CLASSES   (applied to .sc-calendar-wrap)
 *  .sc-preset-minimal   — Clean, monochrome-leaning
 *  .sc-preset-vibrant   — Bold gradient header, rich colours
 *  .sc-preset-dark      — Full dark-mode palette
 *  .sc-preset-brand     — Custom brand palette (warm cream, navy & amber)
 */

/* ============================================================
   L0  —  Primitive design tokens (raw values, do not use directly)
   ============================================================ */
:root {
    /* Blue palette */
    --sc-blue-50:  #eff6ff;
    --sc-blue-100: #dbeafe;
    --sc-blue-400: #60a5fa;
    --sc-blue-500: #3b82f6;
    --sc-blue-600: #2563eb;
    --sc-blue-700: #1d4ed8;
    --sc-blue-900: #1e3a8a;

    /* Indigo */
    --sc-indigo-500: #6366f1;
    --sc-indigo-600: #4f46e5;

    /* Slate */
    --sc-slate-50:  #f8fafc;
    --sc-slate-100: #f1f5f9;
    --sc-slate-200: #e2e8f0;
    --sc-slate-300: #cbd5e1;
    --sc-slate-400: #94a3b8;
    --sc-slate-500: #64748b;
    --sc-slate-600: #475569;
    --sc-slate-700: #334155;
    --sc-slate-800: #1e293b;
    --sc-slate-900: #0f172a;

    /* Focus ring. Brand navy, not the browser's default blue, and not the
       brand amber either: amber on a white surface measures about 2:1, well
       under the 3:1 a focus indicator needs to be seen at all. Navy is
       ~14:1 on white. On the navy toolbar it would vanish, so dark surfaces
       switch to the light ring below. */
    --sc-focus-ring: #1f2a44;
    --sc-focus-ring-on-dark: rgba(255, 255, 255, 0.92);

    /* Spacing scale */
    --sc-sp-1: 0.25rem;
    --sc-sp-2: 0.5rem;
    --sc-sp-3: 0.75rem;
    --sc-sp-4: 1rem;
    --sc-sp-5: 1.25rem;
    --sc-sp-6: 1.5rem;
    --sc-sp-8: 2rem;

    /* Type scale */
    --sc-text-2xs: 0.625rem;
    --sc-text-xs:  0.6875rem;
    --sc-text-sm:  0.8rem;
    --sc-text-md:  0.875rem;
    --sc-text-base: 0.9375rem;
    --sc-text-lg:  1.0625rem;
    --sc-text-xl:  1.2rem;

    /* Easing */
    --sc-ease-out:  cubic-bezier(0.0, 0.0, 0.2, 1);
    --sc-ease-in:   cubic-bezier(0.4, 0.0, 1.0, 1);
    --sc-ease-std:  cubic-bezier(0.4, 0.0, 0.2, 1);
    --sc-ease-spring: cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* ============================================================
   L1  —  Semantic tokens  (default theme — "Default Blue")
   ============================================================ */
.sc-calendar-wrap {
    /* Brand */
    --sc-primary:          var(--sc-blue-500);
    --sc-primary-hover:    var(--sc-blue-600);
    --sc-primary-light:    var(--sc-blue-50);
    --sc-primary-text:     #ffffff;

    /* Header gradient (start → end) */
    --sc-header-from:      var(--sc-blue-500);
    --sc-header-to:        var(--sc-blue-700);

    /* Surfaces */
    --sc-bg:               #ffffff;
    --sc-surface-1:        var(--sc-slate-50);
    --sc-surface-2:        var(--sc-slate-100);
    --sc-surface-3:        var(--sc-slate-200);
    --sc-surface-hover:    var(--sc-slate-100);

    /* Text */
    --sc-text:             var(--sc-slate-900);
    --sc-text-2:           var(--sc-slate-700);
    --sc-text-muted:       var(--sc-slate-500);
    --sc-text-faint:       var(--sc-slate-400);
    --sc-text-on-primary:  #ffffff;

    /* Border */
    --sc-border:           var(--sc-slate-200);
    --sc-border-strong:    var(--sc-slate-300);

    /* Today */
    --sc-today-bg:         var(--sc-blue-50);
    --sc-today-ring:       var(--sc-blue-500);

    /* Shadows */
    --sc-shadow-xs:  0 1px 2px rgba(15,23,42,0.04);
    --sc-shadow-sm:  0 1px 3px rgba(15,23,42,0.08),  0 1px 2px rgba(15,23,42,0.04);
    --sc-shadow-md:  0 4px 8px rgba(15,23,42,0.08),  0 2px 4px rgba(15,23,42,0.04);
    --sc-shadow-lg:  0 10px 20px rgba(15,23,42,0.1), 0 4px 8px rgba(15,23,42,0.04);
    --sc-shadow-xl:  0 24px 48px rgba(15,23,42,0.14);

    /* Geometry */
    --sc-radius-xs:  3px;
    --sc-radius-sm:  5px;
    --sc-radius:     8px;
    --sc-radius-md:  10px;
    --sc-radius-lg:  14px;
    --sc-radius-xl:  20px;
    --sc-radius-full: 9999px;

    /* Typography */
    --sc-font:        inherit;
    --sc-fw-normal:   400;
    --sc-fw-medium:   500;
    --sc-fw-semibold: 600;
    --sc-fw-bold:     700;
    --sc-fw-extrabold:800;

    /* Layout */
    --sc-cell-min-height: 108px;
    --sc-time-slot-h:     48px;
    --sc-gutter-w:        52px;

    /* Animation durations */
    --sc-dur-fast:  120ms;
    --sc-dur:       200ms;
    --sc-dur-slow:  320ms;

    /* Skeleton shimmer */
    --sc-shimmer-from: var(--sc-surface-2);
    --sc-shimmer-mid:  var(--sc-surface-1);
}

/* ============================================================
   Base reset (scoped)
   ============================================================ */
.sc-calendar-wrap,
.sc-calendar-wrap *,
.sc-calendar-wrap *::before,
.sc-calendar-wrap *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

.sc-calendar-wrap {
    font-family: var(--sc-font);
    font-size: var(--sc-text-base);
    color: var(--sc-text);
    background: var(--sc-bg);
    border: 1px solid var(--sc-border);
    border-radius: var(--sc-radius-lg);
    box-shadow: var(--sc-shadow-md);
    overflow: hidden;
    position: relative;
    isolation: isolate;
    /* Isolate from theme styles — deliberately "style" only, NOT "layout",
       "paint", "content", or "strict". Those establish this element as the
       containing block for any position:fixed descendant instead of the
       viewport, which broke the event modal: it rendered clipped by this
       wrapper's own overflow:hidden and scrolled with the page instead of
       staying fixed over the whole screen. */
    contain: style;
}

/* ============================================================
   Toolbar
   ============================================================ */
.sc-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: var(--sc-sp-2);
    padding: var(--sc-sp-3) var(--sc-sp-4);
    background: linear-gradient(135deg, var(--sc-header-from), var(--sc-header-to));
    color: var(--sc-text-on-primary);
    position: relative;
    z-index: 2;
}

.sc-toolbar::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, rgba(255,255,255,0.06) 0%, transparent 100%);
    pointer-events: none;
}

.sc-toolbar__nav {
    display: flex;
    align-items: center;
    gap: var(--sc-sp-1);
}

.sc-toolbar__title {
    font-size: var(--sc-text-lg);
    font-weight: var(--sc-fw-bold);
    color: var(--sc-text-on-primary);
    min-width: 170px;
    text-align: center;
    letter-spacing: -0.01em;
}

.sc-toolbar__views {
    display: flex;
    align-items: center;
    gap: var(--sc-sp-2);
    flex-wrap: wrap;
}

/* The view switcher is the calendar's primary control: sized to be read and
   hit first, not to match the density of the rows below it. The icons carry
   their size as an attribute, so it takes CSS to grow them with the text. */
.sc-toolbar__views .sc-btn {
    letter-spacing: .01em;
}

.sc-toolbar__views .sc-btn svg {
    width: 15px;
    height: 15px;
}

/* ============================================================
   Buttons
   ============================================================ */
.sc-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 0.5rem 0.95rem;
    font-size: var(--sc-text-md);
    font-weight: var(--sc-fw-semibold);
    font-family: var(--sc-font);
    line-height: 1;
    white-space: nowrap;
    border: 1.5px solid rgba(255,255,255,0.3);
    border-radius: var(--sc-radius-sm);
    background: rgba(255,255,255,0.1);
    color: rgba(255,255,255,0.95);
    cursor: pointer;
    transition:
        background var(--sc-dur-fast) var(--sc-ease-std),
        border-color var(--sc-dur-fast) var(--sc-ease-std),
        transform var(--sc-dur-fast) var(--sc-ease-spring),
        box-shadow var(--sc-dur-fast) var(--sc-ease-std);
    -webkit-user-select: none;
    user-select: none;
}

.sc-btn:focus-visible {
    outline: 2px solid var(--sc-focus-ring-on-dark);
    outline-offset: 2px;
}

.sc-btn:hover {
    background: rgba(255,255,255,0.2);
    border-color: rgba(255,255,255,0.55);
}

.sc-btn:active {
    transform: scale(0.96);
}

.sc-btn--icon {
    padding: 0.375rem 0.5rem;
    border-radius: var(--sc-radius-sm);
}

.sc-btn--today {
    background: rgba(255,255,255,0.18);
}

.sc-btn--active {
    background: rgba(255,255,255,0.28) !important;
    border-color: rgba(255,255,255,0.7) !important;
    box-shadow: 0 0 0 1px rgba(255,255,255,0.25) inset;
}

.sc-btn--export {
    text-decoration: none;
}

/* ============================================================
   Filter bar
   ============================================================ */
.sc-filter-bar {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: var(--sc-sp-2);
    padding: var(--sc-sp-3) var(--sc-sp-4);
    background: var(--sc-surface-1);
    border-bottom: 1px solid var(--sc-border);
    min-height: 0;
    overflow: hidden;
    transition: max-height var(--sc-dur-slow) var(--sc-ease-std), padding var(--sc-dur-slow) var(--sc-ease-std);
}

.sc-filter-bar--empty {
    display: none;
}

.sc-filter-bar__label {
    font-size: var(--sc-text-xs);
    font-weight: var(--sc-fw-bold);
    text-transform: uppercase;
    letter-spacing: 0.07em;
    color: var(--sc-text-muted);
    flex-shrink: 0;
    padding-right: var(--sc-sp-1);
}

.sc-filter-bar__pills {
    display: flex;
    flex-wrap: wrap;
    gap: var(--sc-sp-1);
    flex: 1;
}

.sc-filter-pill {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 0.25rem 0.625rem;
    font-size: var(--sc-text-xs);
    font-weight: var(--sc-fw-semibold);
    border-radius: var(--sc-radius-full);
    border: 1.5px solid var(--sc-border-strong);
    background: var(--sc-bg);
    color: var(--sc-text-2);
    cursor: pointer;
    transition:
        background var(--sc-dur-fast) var(--sc-ease-std),
        border-color var(--sc-dur-fast) var(--sc-ease-std),
        color var(--sc-dur-fast) var(--sc-ease-std),
        box-shadow var(--sc-dur-fast) var(--sc-ease-std);
}

.sc-filter-pill:hover {
    border-color: var(--sc-primary);
    color: var(--sc-primary);
    background: var(--sc-primary-light);
}

.sc-filter-pill--active {
    background: var(--sc-primary);
    border-color: var(--sc-primary);
    color: white;
    box-shadow: 0 1px 4px color-mix(in srgb, var(--sc-primary) 40%, transparent);
}

.sc-filter-pill__swatch {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    flex-shrink: 0;
}

.sc-filter-bar__clear {
    font-size: var(--sc-text-xs);
    color: var(--sc-text-muted);
    cursor: pointer;
    border: none;
    background: none;
    padding: 0.2rem 0.4rem;
    border-radius: var(--sc-radius-xs);
    font-family: var(--sc-font);
    transition: color var(--sc-dur-fast);
    margin-left: auto;
    flex-shrink: 0;
}

.sc-filter-bar__clear:hover {
    color: var(--sc-primary);
}

/* ============================================================
   Brand logo (toolbar corner)
   ============================================================ */
.sc-toolbar__logo {
    height: 40px;
    max-width: 45%;
    width: auto;
    object-fit: contain;
    display: block;
    flex: 0 0 auto;
    margin-right: auto;
}

/* ============================================================
   Period header — centred month title, below the toolbar
   ============================================================ */
.sc-cal-head {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--sc-sp-3);
    padding: var(--sc-sp-4) var(--sc-sp-4) var(--sc-sp-2);
    background: var(--sc-surface-1);
    position: relative;
}

.sc-cal-head .sc-toolbar__title {
    color: var(--sc-text);
    font-size: var(--sc-text-xl);
    min-width: 190px;
    margin: 0;
}

.sc-navbtn {
    width: 34px;
    height: 34px;
    flex-shrink: 0;
    border-radius: 50%;
    border: 1px solid var(--sc-border-strong);
    background: var(--sc-bg);
    color: var(--sc-text);
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: background var(--sc-dur-fast) var(--sc-ease-std),
                border-color var(--sc-dur-fast) var(--sc-ease-std);
}

.sc-navbtn:hover {
    background: var(--sc-surface-2);
    border-color: var(--sc-text-2);
}

.sc-navbtn:focus-visible {
    outline: 2px solid var(--sc-focus-ring);
    outline-offset: 2px;
}

/* "Today" sits beside the title here, so it needs the light treatment
   rather than the toolbar's translucent-on-navy look. */
.sc-cal-head .sc-btn--ghost {
    position: absolute;
    right: var(--sc-sp-4);
    background: var(--sc-bg);
    border-color: var(--sc-border-strong);
    color: var(--sc-text);
}

/* Second, more discoverable way to hide/show the filter sidebar — sits at
   the opposite (left) edge of this row, same idea as "Today" on the right.
   The toolbar's own "Filters" button stays put; this is just an easier-to-
   notice shortcut to the same action. */
.sc-cal-head .sc-sidebar-arrow-toggle {
    position: absolute;
    left: var(--sc-sp-4);
}

.sc-cal-head .sc-sidebar-arrow-toggle svg {
    transition: transform var(--sc-dur-fast) var(--sc-ease-std);
}

.sc-cal-head .sc-sidebar-arrow-toggle--collapsed svg {
    transform: rotate(180deg);
}

.sc-cal-head .sc-btn--ghost:hover {
    background: var(--sc-surface-2);
    border-color: var(--sc-text-2);
    color: var(--sc-text);
}

/* ============================================================
   Calendar display switcher (month grid only)
   ============================================================ */
.sc-variants {
    display: flex;
    align-items: center;
    gap: var(--sc-sp-3);
    flex-wrap: wrap;
    padding: var(--sc-sp-3) var(--sc-sp-4);
    border-bottom: 1px solid var(--sc-border);
}

.sc-variants__label {
    font-size: var(--sc-text-xs);
    font-weight: var(--sc-fw-bold);
    letter-spacing: .12em;
    text-transform: uppercase;
    color: var(--sc-text-muted);
}

.sc-seg {
    display: flex;
    align-items: center;
    gap: 2px;
    background: var(--sc-surface-2);
    border: 1px solid var(--sc-border);
    border-radius: var(--sc-radius-full);
    padding: 3px;
}

.sc-seg__btn {
    font-family: var(--sc-font);
    font-weight: var(--sc-fw-semibold);
    font-size: var(--sc-text-sm);
    color: var(--sc-text-2);
    background: none;
    border: 0;
    border-radius: var(--sc-radius-full);
    padding: 7px 14px;
    cursor: pointer;
    white-space: nowrap;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    transition: background var(--sc-dur-fast) var(--sc-ease-std),
                color var(--sc-dur-fast) var(--sc-ease-std),
                box-shadow var(--sc-dur-fast) var(--sc-ease-std);
}

.sc-seg__btn svg { flex: none; opacity: .85; }

.sc-seg__btn:hover { color: var(--sc-text); }

/* The chosen layout reads as a raised tab on the track rather than as a
   dark block, which looked like a button waiting to be pressed. */
.sc-seg__btn--on {
    background: var(--sc-surface-1);
    color: var(--sc-text);
    box-shadow: 0 1px 3px rgba(31, 42, 68, .18);
}

.sc-seg__btn--on svg { opacity: 1; color: var(--sc-primary-strong, #d99900); }

.sc-seg__btn:focus-visible {
    outline: 2px solid var(--sc-focus-ring);
    outline-offset: 2px;
}

.sc-seg__rec {
    font-size: 9.5px;
    font-weight: var(--sc-fw-bold);
    letter-spacing: .08em;
    text-transform: uppercase;
    color: var(--sc-text);
    background: var(--sc-primary);
    border-radius: var(--sc-radius-xs);
    padding: 2px 6px;
    margin-left: 7px;
}

.sc-cal-caption {
    font-size: var(--sc-text-sm);
    color: var(--sc-text-muted);
    line-height: 1.5;
    padding: var(--sc-sp-3) var(--sc-sp-4) var(--sc-sp-4);
    margin: 0;
}

.sc-cal-caption b { color: var(--sc-text); font-weight: var(--sc-fw-semibold); }

/* ============================================================
   Status legend
   ============================================================ */
.sc-legend {
    display: flex;
    align-items: center;
    gap: var(--sc-sp-4);
    flex-wrap: wrap;
    padding: var(--sc-sp-3) var(--sc-sp-4);
    border-bottom: 1px solid var(--sc-border);
    background: var(--sc-surface-1);
}

.sc-legend__item {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    font-size: var(--sc-text-xs);
    color: var(--sc-text-muted);
    font-weight: var(--sc-fw-medium);
}

.sc-legend__item--end { margin-left: auto; }

.sc-legend__dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    flex: none;
}

/* ============================================================
   Results summary
   ============================================================ */
/* The count and the chips for what is currently filtering it: the one line
   that explains why the calendar below is showing what it shows. It was set
   at 10–11px with 4px of padding, which read as a footnote to the calendar
   rather than as its controls — and the chips were too small to aim an "×"
   at. Sized here to be read first and clicked without care. */
.sc-summary {
    display: flex;
    align-items: center;
    gap: var(--sc-sp-2) var(--sc-sp-3);
    flex-wrap: wrap;
    padding: var(--sc-sp-3) var(--sc-sp-4);
    border-bottom: 1px solid var(--sc-border);
    background: var(--sc-surface-1);
}

.sc-summary__count {
    font-size: var(--sc-text-md);
    font-weight: var(--sc-fw-bold);
    color: var(--sc-text);
    letter-spacing: -0.01em;
    margin-right: var(--sc-sp-1);
}

.sc-summary__empty {
    font-size: var(--sc-text-sm);
    color: var(--sc-text-muted);
}

/* Amber with navy text — the same "this is on" language the filter rail's
   checkboxes and the list pills speak. */
.sc-summary__chip {
    display: inline-flex;
    align-items: center;
    gap: 2px;
    font-size: var(--sc-text-sm);
    font-weight: var(--sc-fw-bold);
    line-height: 1.2;
    color: #1f2a44;
    background: var(--sc-primary);
    border: 1.5px solid transparent;
    border-radius: var(--sc-radius-full);
    padding: 5px 5px 5px 13px;
    max-width: 100%;
}

.sc-summary__chip-x {
    border: 0;
    background: none;
    cursor: pointer;
    color: #1f2a44;
    font-size: 16px;
    line-height: 1;
    width: 20px;
    height: 20px;
    padding: 0;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: none;
    font-family: var(--sc-font);
    transition: background var(--sc-dur-fast) var(--sc-ease-std);
}

.sc-summary__chip-x:hover,
.sc-summary__chip-x:focus-visible {
    background: rgba(31, 42, 68, 0.16);
    color: #1f2a44;
}

/* Sits at the end of the row as a real button. As underlined text with only
   a hover colour of its own, the theme supplied the rest — its blue block
   with the link colour on top, which is what the screenshot caught. */
.sc-summary__clear {
    font-family: var(--sc-font);
    font-weight: var(--sc-fw-bold);
    font-size: var(--sc-text-sm);
    color: var(--sc-text-2);
    cursor: pointer;
    background: var(--sc-surface-1);
    border: 1.5px solid var(--sc-border-strong);
    border-radius: var(--sc-radius-full);
    padding: 5px 13px;
    line-height: 1.2;
    margin-left: auto;
    text-decoration: none;
    transition:
        background var(--sc-dur-fast) var(--sc-ease-std),
        border-color var(--sc-dur-fast) var(--sc-ease-std),
        color var(--sc-dur-fast) var(--sc-ease-std);
}

/* ============================================================
   Sidebar filter layout (2+ filterable taxonomies)
   ============================================================ */
.sc-main-row {
    display: flex;
    align-items: stretch;
    position: relative;
}

.sc-main-col {
    flex: 1 1 auto;
    min-width: 0;
}

.sc-sidebar-filters {
    flex: 0 0 220px;
    width: 220px;
    box-sizing: border-box;
    padding: var(--sc-sp-4);
    background: var(--sc-surface-1);
    border-right: 1px solid var(--sc-border);
    overflow-y: auto;
    /* Fills the row (the flex default) so its background runs the whole
       height of the calendar beside it. Sizing it to its own content
       instead leaves the facets floating above a strip of page background
       in a different shade — the column reads as cut off rather than as a
       rail with room to spare. */
    align-self: stretch;
    /* Flex items default to min-height:auto (content-based) — without this,
       a long facet list (many cities/studios) can outgrow the JS-computed
       max-height cap instead of actually scrolling within it. */
    min-height: 0;
}

.sc-sidebar-filters.sc-hidden {
    display: none;
}

.sc-sidebar-filters__group {
    border-bottom: 1px solid var(--sc-border);
    padding-bottom: var(--sc-sp-2);
}

.sc-sidebar-filters__group + .sc-sidebar-filters__group {
    margin-top: var(--sc-sp-2);
    padding-top: var(--sc-sp-2);
}

.sc-sidebar-filters__heading {
    font-size: var(--sc-text-xs);
    font-weight: var(--sc-fw-bold);
    text-transform: uppercase;
    letter-spacing: 0.07em;
    color: var(--sc-text-muted);
    margin: 0 0 var(--sc-sp-2);
    cursor: pointer;
    list-style: none;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--sc-sp-1);
}

.sc-sidebar-filters__heading::-webkit-details-marker {
    display: none;
}

.sc-sidebar-filters__heading::after {
    content: '';
    width: 7px;
    height: 7px;
    border-right: 1.5px solid var(--sc-text-muted);
    border-bottom: 1.5px solid var(--sc-text-muted);
    transform: rotate(-45deg);
    transition: transform var(--sc-dur-fast) var(--sc-ease-std);
    flex-shrink: 0;
}

.sc-sidebar-filters__group[open] > .sc-sidebar-filters__heading::after {
    transform: rotate(45deg);
}

.sc-sidebar-filters__group:not([open]) .sc-sidebar-filters__list {
    display: none;
}

.sc-sidebar-filters__list {
    display: flex;
    flex-direction: column;
    gap: var(--sc-sp-1);
}

.sc-sidebar-filters__list .sc-filter-pill {
    width: 100%;
    justify-content: flex-start;
    border-radius: var(--sc-radius-sm);
    background: transparent;
    border-color: transparent;
    padding-left: var(--sc-sp-1);
    box-shadow: none;
}

.sc-sidebar-filters__list .sc-filter-pill:hover {
    background: var(--sc-surface-2);
}

/* Checkbox square, drawn before the term label/swatch — checked state
   fills yellow with a tick, per the design handoff's filter rail spec. */
.sc-sidebar-filters__list .sc-filter-pill::before {
    content: '';
    width: 16px;
    height: 16px;
    flex-shrink: 0;
    box-sizing: border-box;
    border: 1.5px solid var(--sc-border-strong);
    border-radius: 4px;
    background-color: var(--sc-surface-1);
    background-position: center;
    background-repeat: no-repeat;
    transition: background-color var(--sc-dur-fast), border-color var(--sc-dur-fast);
}

.sc-sidebar-filters__list .sc-filter-pill--active {
    background: transparent;
    color: var(--sc-text);
    font-weight: var(--sc-fw-semibold);
}

.sc-sidebar-filters__list .sc-filter-pill--active::before {
    background-color: var(--sc-primary);
    border-color: var(--sc-primary);
    background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'><path d='M3 8.5l3 3 7-7' fill='none' stroke='%231f2a44' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/></svg>");
    background-size: 11px;
}

.sc-filter-pill__label {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.sc-sidebar-filters__list .sc-filter-pill__label { flex: 1; }

.sc-filter-pill__count {
    font-size: var(--sc-text-2xs);
    font-weight: var(--sc-fw-bold);
    color: var(--sc-text-muted);
    flex-shrink: 0;
}

.sc-sidebar-filters__clear {
    display: block;
    margin-top: var(--sc-sp-4);
    font-size: var(--sc-text-xs);
    color: var(--sc-text-muted);
    background: none;
    border: none;
    cursor: pointer;
    font-family: var(--sc-font);
    padding: 0;
}

.sc-sidebar-filters__clear:hover {
    color: var(--sc-primary);
}

/* Sidebar toggle button lives in the toolbar — inherits .sc-btn's navy/white
   look, just needs the same "active" treatment as the view buttons. */
.sc-sidebar-toggle-btn.sc-btn--active {
    background: rgba(255,255,255,0.28);
    border-color: rgba(255,255,255,0.7);
}

/* Slide transition — the sidebar stays in the DOM and shrinks to 0 width
   instead of an abrupt display:none, so opening/closing animates. */
.sc-sidebar-filters {
    transition:
        flex-basis var(--sc-dur-slow) var(--sc-ease-std),
        width var(--sc-dur-slow) var(--sc-ease-std),
        padding var(--sc-dur-slow) var(--sc-ease-std),
        opacity var(--sc-dur) var(--sc-ease-std);
    opacity: 1;
}

.sc-sidebar-collapsed .sc-sidebar-filters {
    flex-basis: 0;
    width: 0;
    padding-left: 0;
    padding-right: 0;
    opacity: 0;
    border-right: none;
    overflow: hidden;
    pointer-events: none;
}

/* ============================================================
   Body container + view transitions
   ============================================================ */
.sc-body {
    position: relative;
    min-height: 380px;
    background: var(--sc-bg);
}

/* Incoming view slides up and fades in */
@keyframes sc-view-enter {
    from { opacity: 0; transform: translateY(6px); }
    to   { opacity: 1; transform: translateY(0); }
}

@keyframes sc-view-exit {
    from { opacity: 1; }
    to   { opacity: 0; }
}

.sc-body__view {
    animation: sc-view-enter var(--sc-dur-slow) var(--sc-ease-out) both;
}

/* ============================================================
   Skeleton / shimmer loading
   ============================================================ */
@keyframes sc-shimmer {
    0%   { background-position: -200% 0; }
    100% { background-position:  200% 0; }
}

.sc-skeleton {
    background: linear-gradient(
        90deg,
        var(--sc-shimmer-from) 0%,
        var(--sc-shimmer-mid) 50%,
        var(--sc-shimmer-from) 100%
    );
    background-size: 200% 100%;
    animation: sc-shimmer 1.4s ease-in-out infinite;
    border-radius: var(--sc-radius-xs);
}

.sc-skeleton-month {
    display: flex;
    flex-direction: column;
    gap: 1px;
    padding: 1px;
    background: var(--sc-border);
}

.sc-skeleton-month__row {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 1px;
}

.sc-skeleton-month__cell {
    background: var(--sc-bg);
    padding: var(--sc-sp-2);
    min-height: var(--sc-cell-min-height);
}

.sc-skeleton-month__num {
    width: 24px;
    height: 24px;
    border-radius: 50%;
}

.sc-skeleton-month__pill {
    height: 14px;
    margin-top: var(--sc-sp-1);
    border-radius: var(--sc-radius-xs);
}

.sc-skeleton-list {
    display: flex;
    flex-direction: column;
    gap: var(--sc-sp-3);
    padding: var(--sc-sp-4);
}

.sc-skeleton-list__header {
    height: 14px;
    width: 120px;
    margin-bottom: var(--sc-sp-2);
}

.sc-skeleton-list__item {
    display: flex;
    gap: var(--sc-sp-3);
    align-items: flex-start;
}

.sc-skeleton-list__thumb {
    width: 56px;
    height: 56px;
    flex-shrink: 0;
    border-radius: var(--sc-radius);
}

.sc-skeleton-list__lines {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: var(--sc-sp-2);
    padding-top: var(--sc-sp-1);
}

.sc-skeleton-list__line {
    height: 12px;
    border-radius: var(--sc-radius-xs);
}

.sc-skeleton-list__line--short { width: 55%; }
.sc-skeleton-list__line--medium { width: 75%; }

/* ============================================================
   Month grid view
   ============================================================ */
.sc-month {
    display: flex;
    flex-direction: column;
}

.sc-month__dow-row {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    background: var(--sc-surface-1);
    border-bottom: 1px solid var(--sc-border);
}

.sc-month__dow {
    padding: var(--sc-sp-2) var(--sc-sp-1);
    text-align: center;
    font-size: var(--sc-text-2xs);
    font-weight: var(--sc-fw-extrabold);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--sc-text-muted);
}

.sc-month__grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
}

/* Day cell */
.sc-month__cell {
    border-right: 1px solid var(--sc-border);
    border-bottom: 1px solid var(--sc-border);
    min-height: var(--sc-cell-min-height);
    padding: var(--sc-sp-1) var(--sc-sp-1) var(--sc-sp-2);
    background: var(--sc-bg);
    cursor: pointer;
    position: relative;
    transition: background var(--sc-dur-fast) var(--sc-ease-std);
    overflow: hidden;
}

.sc-month__cell:nth-child(7n) { border-right: none; }
.sc-month__cell:hover          { background: var(--sc-surface-hover); }

/* Leading/trailing cells outside the current month — empty, greyed,
   non-interactive, so the grid never implies "next month" data. */
.sc-month__cell--blank {
    background: var(--sc-surface-1);
    cursor: default;
}

.sc-month__cell--blank:hover { background: var(--sc-surface-1); }

.sc-month__cell--today {
    background: var(--sc-today-bg) !important;
}

.sc-month__cell--weekend .sc-month__day-num {
    color: var(--sc-text-muted);
}

/* Day number */
.sc-month__day-num {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 26px;
    height: 26px;
    font-size: var(--sc-text-sm);
    font-weight: var(--sc-fw-semibold);
    color: var(--sc-text-2);
    border-radius: 50%;
    line-height: 1;
    transition: background var(--sc-dur-fast), color var(--sc-dur-fast);
}

.sc-month__cell--today .sc-month__day-num {
    background: var(--sc-today-ring);
    color: white;
    font-weight: var(--sc-fw-bold);
}

/* Event chips inside grid cell */
.sc-chip {
    display: flex;
    align-items: center;
    gap: 3px;
    padding: 2px 5px 2px 4px;
    margin-bottom: 2px;
    border-radius: var(--sc-radius-xs);
    font-size: var(--sc-text-xs);
    font-weight: var(--sc-fw-semibold);
    cursor: pointer;
    overflow: hidden;
    line-height: 1.35;
    transition: filter var(--sc-dur-fast);
    background: var(--sc-primary);
    color: white;
    max-width: 100%;
}

.sc-chip:hover { filter: brightness(0.88); }

.sc-chip__dot {
    display: inline-block;
    width: 5px;
    height: 5px;
    border-radius: 50%;
    background: rgba(255,255,255,0.65);
    flex-shrink: 0;
}

.sc-chip__label {
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
    flex: 1;
    min-width: 0;
}

/* Status chip: filled with the course's status colour (set inline, with a
   text colour chosen to read on it), and the title allowed to wrap onto a
   second line so two courses on one day can still be told apart. */
.sc-chip--status {
    align-items: flex-start;
    border: 1px solid transparent;
    padding: 4px 6px;
}

.sc-chip--status .sc-chip__dot { margin-top: 4px; }

.sc-chip--status .sc-chip__label {
    white-space: normal;
    text-overflow: clip;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow-wrap: anywhere;
}

/* ---- Duration bars ---- */
.sc-month__bar {
    font-size: var(--sc-text-2xs);
    font-weight: var(--sc-fw-semibold);
    line-height: 1.2;
    height: 19px;
    display: flex;
    align-items: center;
    padding: 0 6px;
    margin-bottom: 2px;
    color: #fff;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    border-radius: 3px;
    cursor: pointer;
    transition: filter var(--sc-dur-fast);
}

.sc-month__bar:hover { filter: brightness(0.9); }

/* Mid-run days bleed into the cell gutters so consecutive days read as one
   continuous band instead of separate blocks. */
.sc-month__bar--mid {
    border-radius: 0;
    margin-left: calc(var(--sc-sp-1) * -1);
    margin-right: calc(var(--sc-sp-1) * -1);
    padding-left: var(--sc-sp-1);
}

/* ---- Hybrid: marker on a course's non-start days ---- */
.sc-month__daymark {
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: var(--sc-text-2xs);
    color: var(--sc-text-muted);
    font-weight: var(--sc-fw-medium);
    cursor: pointer;
    margin-bottom: 2px;
    overflow: hidden;
}

.sc-month__daymark:hover { color: var(--sc-text); }

.sc-month__daymark-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    flex: none;
    opacity: .75;
}

.sc-month__daymark-label {
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
}

/* "+N more" indicator */
.sc-month__more {
    display: inline-block;
    font-size: var(--sc-text-2xs);
    font-weight: var(--sc-fw-semibold);
    color: var(--sc-text-muted);
    padding: 1px var(--sc-sp-1);
    border-radius: var(--sc-radius-xs);
    cursor: pointer;
    transition: color var(--sc-dur-fast), background var(--sc-dur-fast);
}

.sc-month__more:hover {
    background: var(--sc-primary-light);
    color: var(--sc-primary);
}

/* ============================================================
   Week view
   ============================================================ */
.sc-week {
    display: flex;
    flex-direction: column;
}

.sc-week__header {
    display: grid;
    grid-template-columns: var(--sc-gutter-w) repeat(7, 1fr);
    background: var(--sc-surface-1);
    border-bottom: 2px solid var(--sc-border-strong);
    position: sticky;
    top: 0;
    z-index: 3;
}

.sc-week__header-gutter { border-right: 1px solid var(--sc-border); }

.sc-week__day-head {
    text-align: center;
    padding: var(--sc-sp-3) var(--sc-sp-1);
    border-right: 1px solid var(--sc-border);
    cursor: pointer;
    transition: background var(--sc-dur-fast);
}

.sc-week__day-head:hover { background: var(--sc-surface-hover); }

.sc-week__dow {
    display: block;
    font-size: var(--sc-text-2xs);
    font-weight: var(--sc-fw-extrabold);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--sc-text-muted);
}

.sc-week__day-num {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    font-size: var(--sc-text-base);
    font-weight: var(--sc-fw-bold);
    margin-top: 2px;
    transition: background var(--sc-dur-fast), color var(--sc-dur-fast);
}

.sc-week__day-head--today .sc-week__day-num {
    background: var(--sc-today-ring);
    color: white;
}

/* All-day row */
.sc-week__allday {
    display: grid;
    grid-template-columns: var(--sc-gutter-w) repeat(7, 1fr);
    border-bottom: 1px solid var(--sc-border);
    background: var(--sc-surface-1);
    min-height: 28px;
}

.sc-week__allday-gutter {
    display: flex;
    align-items: flex-start;
    justify-content: flex-end;
    padding: var(--sc-sp-1) var(--sc-sp-2) 0 0;
    font-size: var(--sc-text-2xs);
    color: var(--sc-text-faint);
    letter-spacing: 0.06em;
    text-transform: uppercase;
    border-right: 1px solid var(--sc-border);
    font-weight: var(--sc-fw-semibold);
}

.sc-week__allday-col {
    padding: 2px 3px;
    border-right: 1px solid var(--sc-border);
    min-height: 26px;
}

/* Time body */
.sc-week__body {
    display: grid;
    grid-template-columns: var(--sc-gutter-w) repeat(7, 1fr);
    overflow-y: auto;
    max-height: 560px;
    position: relative;
}

.sc-week__time-gutter {
    display: flex;
    flex-direction: column;
    border-right: 1px solid var(--sc-border);
    background: var(--sc-bg);
}

.sc-week__hour-label {
    height: var(--sc-time-slot-h);
    display: flex;
    align-items: flex-start;
    justify-content: flex-end;
    padding-right: var(--sc-sp-2);
    padding-top: 3px;
    font-size: var(--sc-text-2xs);
    color: var(--sc-text-faint);
    border-bottom: 1px solid var(--sc-border);
    white-space: nowrap;
    font-weight: var(--sc-fw-medium);
}

.sc-week__col {
    position: relative;
    border-right: 1px solid var(--sc-border);
}

.sc-week__col--today { background: var(--sc-today-bg); }

.sc-week__hour-line {
    height: var(--sc-time-slot-h);
    border-bottom: 1px solid var(--sc-border);
}

.sc-week__half-line {
    position: absolute;
    left: 0; right: 0;
    top: calc(var(--sc-time-slot-h) / 2);
    border-bottom: 1px dashed color-mix(in srgb, var(--sc-border) 80%, transparent);
    pointer-events: none;
}

/* Timed event block */
.sc-week__event {
    position: absolute;
    left: 3px;
    right: 3px;
    border-radius: var(--sc-radius-sm);
    background: var(--sc-primary);
    color: white;
    font-size: var(--sc-text-xs);
    font-weight: var(--sc-fw-semibold);
    padding: 3px 5px;
    overflow: hidden;
    cursor: pointer;
    z-index: 1;
    transition: filter var(--sc-dur-fast), box-shadow var(--sc-dur-fast), z-index 0s;
    box-shadow: 0 1px 3px rgba(0,0,0,0.15);
}

.sc-week__event:hover {
    filter: brightness(0.9);
    box-shadow: var(--sc-shadow-md);
    z-index: 2;
}

.sc-week__event-title {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.sc-week__event-time {
    font-size: var(--sc-text-2xs);
    opacity: 0.8;
    margin-top: 1px;
}

/* Current time indicator */
.sc-week__now-line {
    position: absolute;
    left: -4px;
    right: 0;
    z-index: 4;
    pointer-events: none;
}

.sc-week__now-dot {
    position: absolute;
    left: 0;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #ef4444;
    top: -4px;
}

.sc-week__now-rule {
    position: absolute;
    left: 8px;
    right: 0;
    height: 1.5px;
    background: #ef4444;
    top: -0.75px;
}

/* ============================================================
   Day view
   ============================================================ */
.sc-day {
    display: flex;
    flex-direction: column;
}

.sc-day__header {
    padding: var(--sc-sp-3) var(--sc-sp-4);
    border-bottom: 1px solid var(--sc-border);
    background: var(--sc-surface-1);
}

.sc-day__date-label {
    font-size: var(--sc-text-xl);
    font-weight: var(--sc-fw-bold);
    color: var(--sc-text);
    letter-spacing: -0.02em;
}

.sc-day__today-badge {
    display: inline-block;
    font-size: var(--sc-text-xs);
    font-weight: var(--sc-fw-bold);
    background: var(--sc-primary);
    color: white;
    padding: 2px 8px;
    border-radius: var(--sc-radius-full);
    margin-left: var(--sc-sp-2);
    vertical-align: middle;
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

.sc-day__body {
    display: grid;
    grid-template-columns: var(--sc-gutter-w) 1fr;
    overflow-y: auto;
    max-height: 560px;
}

/* ============================================================
   List / Agenda view
   ============================================================ */
.sc-list {
    padding: var(--sc-sp-4);
}

.sc-list__empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: var(--sc-sp-8) var(--sc-sp-4);
    color: var(--sc-text-muted);
    text-align: center;
    gap: var(--sc-sp-3);
}

.sc-list__empty-icon {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: var(--sc-surface-2);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--sc-text-faint);
}

.sc-list__empty-title {
    font-size: var(--sc-text-base);
    font-weight: var(--sc-fw-semibold);
    color: var(--sc-text-2);
}

.sc-list__empty-sub {
    font-size: var(--sc-text-sm);
    color: var(--sc-text-muted);
    max-width: 260px;
}

/* Date group */
.sc-list__group {
    margin-bottom: var(--sc-sp-6);
}

/* Sticky group header */
.sc-list__group-header {
    position: sticky;
    top: 0;
    z-index: 2;
    display: flex;
    align-items: center;
    gap: var(--sc-sp-2);
    font-size: var(--sc-text-xs);
    font-weight: var(--sc-fw-extrabold);
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--sc-text-muted);
    padding: var(--sc-sp-2) 0;
    background: var(--sc-bg);
}

.sc-list__group-header::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--sc-border);
}

/* ══ List view: detailed rows ══════════════════════════════════════════ */

.sc-row {
    border: 1px solid var(--sc-border);
    border-radius: var(--sc-radius-lg, 14px);
    background: var(--sc-bg);
    margin-bottom: var(--sc-sp-3);
    cursor: pointer;
    transition: box-shadow var(--sc-dur-fast) var(--sc-ease-std),
                border-color var(--sc-dur-fast) var(--sc-ease-std);
}

.sc-row:hover {
    border-color: var(--sc-border-strong, var(--sc-border));
    box-shadow: 0 2px 10px rgba(0,0,0,.06);
}

.sc-row__main {
    display: flex;
    gap: var(--sc-sp-5);
    align-items: flex-start;
    padding: var(--sc-sp-5);
}

/* Date block. Centred against the row's own height rather than pinned to
   the top: a two-line title makes the text column much taller than the
   block, and top alignment then reads as the block having slipped. */
.sc-row__date {
    flex: 0 0 auto;
    align-self: center;
    width: 76px;
    padding: var(--sc-sp-3) 0;
    border-radius: var(--sc-radius-md);
    color: #fff;
    text-align: center;
    display: flex;
    flex-direction: column;
    line-height: 1.1;
}
.sc-row__date-day { font-size: 1.75rem; font-weight: 800; }
.sc-row__date-mon { font-size: .72rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; }
.sc-row__date-yr  { font-size: .68rem; opacity: .85; }

.sc-row__body { flex: 1 1 auto; min-width: 0; }

.sc-row__title {
    margin: 0 0 var(--sc-sp-3);
    font-size: 1.05rem;
    line-height: 1.35;
    font-weight: 800;
    letter-spacing: .01em;
    text-transform: uppercase;
    color: var(--sc-text);
}

.sc-row__chips {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: var(--sc-sp-2);
    margin-bottom: var(--sc-sp-3);
}

.sc-row__cat {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: .74rem;
    font-weight: 700;
    letter-spacing: .06em;
    text-transform: uppercase;
    color: var(--sc-text);
}
.sc-row__cat-dot { width: 8px; height: 8px; border-radius: 50%; flex: none; }

/* Feature pill. Deliberately NOT .sc-chip: that class belongs to the month
   grid's event chips, and sharing it dragged in their colours, their hover
   filter, and the mobile rules that strip a chip down to a dot. */
.sc-pill {
    display: inline-flex;
    align-items: center;
    padding: 3px 12px;
    border-radius: 999px;
    font-size: .74rem;
    font-weight: 700;
    white-space: nowrap;
    background: var(--sc-primary);
    /* Fixed rather than inherited: the text used to take whatever colour the
       surrounding context gave it, which on the amber pill came out a pale
       blue that couldn't be read. */
    color: #1f2a44;
}

.sc-row__place,
.sc-card__when {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: .84rem;
    line-height: 1.5;
    color: var(--sc-text-muted, #6b7280);
    margin-bottom: var(--sc-sp-1);
}
.sc-row__place svg,
.sc-card__when svg { width: 14px; height: 14px; flex: none; }

.sc-row__dates {
    font-size: .84rem;
    line-height: 1.5;
    color: var(--sc-text-muted, #6b7280);
}

/* Action column */
.sc-row__actions {
    flex: 0 0 auto;
    display: flex;
    flex-direction: column;
    gap: var(--sc-sp-2);
    align-items: stretch;
    min-width: 200px;
}

.sc-row__cta {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 16px;
    border: 1px solid transparent;
    border-radius: var(--sc-radius-md);
    font-size: .8rem;
    font-weight: 800;
    letter-spacing: .04em;
    text-transform: uppercase;
    text-decoration: none;
    text-align: center;
    cursor: pointer;
}
.sc-row__cta svg { width: 14px; height: 14px; flex: none; }
.sc-row__cta--inert { cursor: default; }
.sc-row__cta--neutral {
    background: var(--sc-surface-1, #f4f4f5);
    color: var(--sc-text);
    border-color: var(--sc-border);
}

.sc-row__mods-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 16px;
    border: 1px solid var(--sc-border);
    border-radius: var(--sc-radius-md);
    background: var(--sc-bg);
    color: var(--sc-text);
    font: inherit;
    font-size: .86rem;
    font-weight: 600;
    cursor: pointer;
}
.sc-row__mods-btn svg {
    width: 15px; height: 15px; flex: none;
    transition: transform var(--sc-dur-fast) var(--sc-ease-std);
}
.sc-row__mods-btn--open svg { transform: rotate(180deg); }

/* Expanded module days */
/* Inset must match .sc-row__main's padding so the rule lines up with the
   content above it rather than floating short of it. */
.sc-row__modules {
    border-top: 1px dashed var(--sc-border);
    margin: 0 var(--sc-sp-5);
    padding: var(--sc-sp-4) 0 var(--sc-sp-5);
}
.sc-row__modules-label {
    font-size: .72rem;
    font-weight: 800;
    letter-spacing: .08em;
    text-transform: uppercase;
    color: var(--sc-text-muted, #6b7280);
    margin-bottom: var(--sc-sp-2);
}
.sc-row__modules-list { display: flex; flex-wrap: wrap; gap: var(--sc-sp-2); }

/* Module schedule — one line per module, name left, its dates and days
   right, separated by rules like a timetable. */
.sc-modlist { display: flex; flex-direction: column; }

.sc-modlist__row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--sc-sp-4);
    padding: var(--sc-sp-3) 0;
    border-bottom: 1px solid var(--sc-border);
}
.sc-modlist__row:last-child { border-bottom: 0; padding-bottom: 0; }

.sc-modlist__name {
    font-size: .88rem;
    font-weight: 800;
    letter-spacing: .02em;
    text-transform: uppercase;
    color: var(--sc-text);
    min-width: 0;
}

.sc-modlist__meta {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: var(--sc-sp-2) var(--sc-sp-4);
    margin-left: auto;
    text-align: right;
}

.sc-modlist__item {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: .86rem;
    color: var(--sc-text-muted, #6b7280);
    white-space: nowrap;
}
.sc-modlist__item svg {
    width: 15px;
    height: 15px;
    flex: none;
    color: var(--sc-primary);
}

@media (max-width: 640px) {
    /* Stacked: the two columns can't both hold a line of text this narrow. */
    .sc-modlist__row { flex-direction: column; align-items: flex-start; gap: var(--sc-sp-1); }
    .sc-modlist__meta { justify-content: flex-start; margin-left: 0; text-align: left; }
}

.sc-daychip {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 6px 14px 6px 6px;
    border: 1px solid var(--sc-border);
    border-radius: 999px;
    font-size: .84rem;
    color: var(--sc-text);
    white-space: nowrap;
}
.sc-daychip__n {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 22px; height: 22px;
    border-radius: 50%;
    background: var(--sc-secondary, #1f2a44);
    color: #fff;
    font-size: .72rem;
    font-weight: 700;
    flex: none;
}

/* ══ List view: cards ══════════════════════════════════════════════════ */

.sc-cards {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: var(--sc-sp-3);
}

.sc-card {
    display: flex;
    flex-direction: column;
    border: 1px solid var(--sc-border);
    /* Status colour along the top edge (set per card from the course's
       registration status), visible whether or not the card has a picture. */
    border-top: 4px solid var(--sc-status-color, var(--sc-border));
    border-radius: var(--sc-radius-lg, 14px);
    background: var(--sc-bg);
    overflow: hidden;
    cursor: pointer;
    transition: box-shadow var(--sc-dur-fast) var(--sc-ease-std),
                border-color var(--sc-dur-fast) var(--sc-ease-std);
}
.sc-card:hover {
    border-color: var(--sc-border-strong, var(--sc-border));
    box-shadow: 0 2px 10px rgba(0,0,0,.06);
}

.sc-card__media {
    aspect-ratio: 16 / 9;
    background: var(--sc-surface-1, #f4f4f5);
}
.sc-card__media img { width: 100%; height: 100%; object-fit: cover; display: block; }
.sc-card__media--empty {
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: .74rem;
    font-weight: 700;
    letter-spacing: .12em;
    text-transform: uppercase;
    color: var(--sc-text-muted, #9ca3af);
    text-align: center;
    padding: var(--sc-sp-2);
}

.sc-card__body {
    display: flex;
    flex-direction: column;
    gap: var(--sc-sp-2);
    padding: var(--sc-sp-5);
    flex: 1 1 auto;
}

.sc-card__title {
    margin: 2px 0;
    font-size: 1.05rem;
    line-height: 1.35;
    font-weight: 700;
    color: var(--sc-text);
}

/* The card packs chips, title, place and dates into a narrow column, so
   these lines need more room between them than they do in a wide row. */
.sc-card__body .sc-row__place,
.sc-card__when {
    margin-bottom: 0;
    line-height: 1.45;
}

.sc-card__foot {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--sc-sp-2);
    margin-top: auto;
    padding-top: var(--sc-sp-5);
}

.sc-card__status {
    display: inline-flex;
    align-items: center;
    padding: 6px 14px;
    border: 1px solid transparent;
    border-radius: 999px;
    font-size: .78rem;
    font-weight: 700;
}

.sc-card__more {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: .88rem;
    font-weight: 700;
    color: var(--sc-text);
    text-decoration: none;
    border-bottom: 2px solid var(--sc-primary);
    padding-bottom: 2px;
}
.sc-card__more svg { width: 15px; height: 15px; }

/* Narrow screens: the action column can't hold its own beside the text */
@media (max-width: 640px) {
    .sc-row__main { flex-wrap: wrap; }
    .sc-row__actions { min-width: 0; width: 100%; }
    .sc-cards { grid-template-columns: 1fr; }
}

/* Event card (list item) */
.sc-event-card {
    display: flex;
    gap: var(--sc-sp-3);
    align-items: flex-start;
    padding: var(--sc-sp-3) var(--sc-sp-3);
    border-radius: var(--sc-radius-md);
    cursor: pointer;
    transition:
        background var(--sc-dur-fast) var(--sc-ease-std),
        box-shadow var(--sc-dur-fast) var(--sc-ease-std),
        transform var(--sc-dur-fast) var(--sc-ease-std);
    border: 1px solid transparent;
    text-decoration: none;
    color: inherit;
    margin-bottom: var(--sc-sp-2);
}

.sc-event-card:hover {
    background: var(--sc-surface-1);
    border-color: var(--sc-border);
    box-shadow: var(--sc-shadow-sm);
    transform: translateY(-1px);
}

/* Date block — big day number + month + year, tinted with the event's own
   colour (Manage Events override), echoing the design handoff's date block
   without losing per-event colour coding. */
.sc-event-card__date-block {
    width: 56px;
    height: 56px;
    border-radius: var(--sc-radius);
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: #fff;
    line-height: 1.1;
}

.sc-event-card__date-day {
    font-size: 20px;
    font-weight: var(--sc-fw-bold);
}

.sc-event-card__date-month {
    font-size: 10px;
    font-weight: var(--sc-fw-bold);
    text-transform: uppercase;
    letter-spacing: .08em;
}

.sc-event-card__date-year {
    font-size: 9px;
    opacity: .8;
}

.sc-event-card__thumb {
    width: 60px;
    height: 60px;
    border-radius: var(--sc-radius);
    object-fit: cover;
    flex-shrink: 0;
    box-shadow: var(--sc-shadow-xs);
}


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

.sc-event-card__title {
    font-size: var(--sc-text-base);
    font-weight: var(--sc-fw-bold);
    color: var(--sc-text);
    margin-bottom: 3px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.sc-event-card__meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: var(--sc-sp-2);
    font-size: var(--sc-text-sm);
    color: var(--sc-text-muted);
    margin-bottom: 4px;
}

.sc-event-card__meta-item {
    display: flex;
    align-items: center;
    gap: 4px;
}

.sc-event-card__meta-item svg {
    flex-shrink: 0;
    color: var(--sc-primary);
    opacity: 0.7;
}

.sc-event-card__excerpt {
    font-size: var(--sc-text-sm);
    color: var(--sc-text-muted);
    line-height: 1.5;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

/* Term pills on the card */
.sc-event-card__terms {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    margin-top: var(--sc-sp-1);
}

.sc-event-card__term {
    font-size: var(--sc-text-2xs);
    font-weight: var(--sc-fw-semibold);
    padding: 1px 7px;
    border-radius: var(--sc-radius-full);
    background: var(--sc-surface-2);
    color: var(--sc-text-muted);
    border: 1px solid var(--sc-border);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

/* Registration status button — renders only once ev.registration_status
   has a real value (see statusMeta() in calendar.js). */
.sc-event-card__status {
    align-self: center;
    flex-shrink: 0;
    font-size: var(--sc-text-xs);
    font-weight: var(--sc-fw-bold);
    padding: 7px 14px;
    border-radius: var(--sc-radius-sm);
    white-space: nowrap;
}

/* Pagination */
.sc-list__pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: var(--sc-sp-1);
    padding: var(--sc-sp-4) 0 var(--sc-sp-2);
}

.sc-page-btn {
    min-width: 34px;
    height: 34px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0 var(--sc-sp-2);
    border: 1.5px solid var(--sc-border);
    border-radius: var(--sc-radius);
    background: var(--sc-bg);
    color: var(--sc-text-2);
    font-size: var(--sc-text-sm);
    font-weight: var(--sc-fw-semibold);
    cursor: pointer;
    font-family: var(--sc-font);
    transition:
        background var(--sc-dur-fast),
        border-color var(--sc-dur-fast),
        color var(--sc-dur-fast);
}

.sc-page-btn:hover {
    border-color: var(--sc-primary);
    color: var(--sc-primary);
}

.sc-page-btn--active {
    background: var(--sc-primary);
    border-color: var(--sc-primary);
    color: white;
}

.sc-page-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

/* ============================================================
   Mini calendar widget
   ============================================================ */
.sc-mini-wrap {
    display: flex;
    gap: 0;
}

.sc-mini-cal {
    width: 220px;
    flex-shrink: 0;
    border-right: 1px solid var(--sc-border);
    background: var(--sc-surface-1);
    padding: var(--sc-sp-3);
    display: flex;
    flex-direction: column;
    gap: var(--sc-sp-2);
}

.sc-mini-cal__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.sc-mini-cal__title {
    font-size: var(--sc-text-sm);
    font-weight: var(--sc-fw-bold);
    color: var(--sc-text);
    text-align: center;
    flex: 1;
}

.sc-mini-cal__nav {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    border-radius: var(--sc-radius-xs);
    border: none;
    background: none;
    color: var(--sc-text-muted);
    cursor: pointer;
    transition: background var(--sc-dur-fast), color var(--sc-dur-fast);
    font-family: var(--sc-font);
}

.sc-mini-cal__nav:hover {
    background: var(--sc-surface-3);
    color: var(--sc-text);
}

.sc-mini-cal__grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 1px;
}

.sc-mini-cal__dow {
    text-align: center;
    font-size: 9px;
    font-weight: var(--sc-fw-extrabold);
    text-transform: uppercase;
    color: var(--sc-text-faint);
    padding-bottom: var(--sc-sp-1);
}

.sc-mini-cal__day {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 100%;
    aspect-ratio: 1;
    font-size: 11px;
    font-weight: var(--sc-fw-medium);
    border-radius: 50%;
    cursor: pointer;
    position: relative;
    color: var(--sc-text-2);
    transition: background var(--sc-dur-fast), color var(--sc-dur-fast);
    border: none;
    background: none;
    font-family: var(--sc-font);
}

.sc-mini-cal__day:hover:not(.sc-mini-cal__day--today):not(.sc-mini-cal__day--selected) {
    background: var(--sc-surface-3);
}

.sc-mini-cal__day--other { color: var(--sc-text-faint); }

.sc-mini-cal__day--today {
    background: var(--sc-today-ring);
    color: white;
    font-weight: var(--sc-fw-bold);
}

.sc-mini-cal__day--selected:not(.sc-mini-cal__day--today) {
    background: var(--sc-primary-light);
    color: var(--sc-primary);
    font-weight: var(--sc-fw-bold);
}

.sc-mini-cal__dot {
    width: 3px;
    height: 3px;
    border-radius: 50%;
    background: var(--sc-primary);
    position: absolute;
    bottom: 1px;
}

.sc-mini-cal__day--today .sc-mini-cal__dot { background: rgba(255,255,255,0.7); }

.sc-mini-wrap .sc-body {
    flex: 1;
    min-width: 0;
}

/* ============================================================
   Event detail modal
   ============================================================ */
.sc-modal {
    /* Anchored to the calendar (.sc-calendar-wrap is position:relative),
       NOT to the viewport. A viewport-fixed modal drifts out of alignment
       with the calendar whenever the calendar is taller than the window —
       which it usually is on a laptop — so it's scoped to the widget it
       belongs to instead. Page scrolling stays unlocked, letting the reader
       scroll the panel into view normally. */
    position: absolute;
    inset: 0;
    z-index: 999999;
    display: flex;
    /* No align-items:center here on purpose — centering a flex item with
       align-items and letting it overflow is a known combination that
       clips the start of the overflowing content with no way to scroll to
       it (the space "above" the centered item goes negative and isn't a
       valid scroll position in some browsers). The panel centers itself
       vertically via margin:auto instead, which doesn't have that bug. */
    justify-content: center;
    padding: var(--sc-sp-4);
    /* Safety net if the panel's own max-height/scroll ever fails to apply
       or its content is simply taller than this container. */
    overflow-y: auto;
}

.sc-modal[hidden] { display: none; }

.sc-modal__backdrop {
    position: absolute;
    inset: 0;
    background: rgba(15,23,42,0.5);
    backdrop-filter: blur(3px);
    -webkit-backdrop-filter: blur(3px);
    animation: sc-backdrop-in var(--sc-dur) var(--sc-ease-out) both;
}

@keyframes sc-backdrop-in {
    from { opacity: 0; }
    to   { opacity: 1; }
}

.sc-modal__panel {
    position: relative;
    background: var(--sc-bg);
    border-radius: var(--sc-radius-xl);
    box-shadow: var(--sc-shadow-xl);
    width: 100%;
    max-width: 520px;
    /* Capped to the calendar's own height (the modal's container), not the
       viewport — the calendar clips its overflow, so a viewport-sized cap
       would let the panel run past the calendar's bottom edge and get cut
       off with no way to reach the rest. */
    max-height: 100%;
    overflow-y: auto;
    /* Momentum scrolling on older iOS Safari; modern browsers already do
       this by default, but it's a harmless no-op there. */
    -webkit-overflow-scrolling: touch;
    animation: sc-modal-in var(--sc-dur-slow) var(--sc-ease-spring) both;
    /* Belt-and-suspenders alongside .sc-modal's own overflow-y above. */
    flex-shrink: 0;
    margin: auto;
    /* The panel scrolls fine on its own (overflow-y:auto), but macOS/iOS
       hide the scrollbar until you're mid-scroll by default — with no other
       "there's more below" cue, that reads as "the rest is just missing"
       rather than "scroll for more". Keep a slim scrollbar always visible
       instead of relying on the OS default. */
    scrollbar-width: thin;
    scrollbar-color: var(--sc-border-strong) transparent;
}

.sc-modal__panel::-webkit-scrollbar {
    width: 8px;
}

.sc-modal__panel::-webkit-scrollbar-track {
    background: transparent;
}

.sc-modal__panel::-webkit-scrollbar-thumb {
    background-color: var(--sc-border-strong);
    border-radius: var(--sc-radius-full);
}

@keyframes sc-modal-in {
    from { opacity: 0; transform: translateY(16px) scale(0.96); }
    to   { opacity: 1; transform: none; }
}

.sc-modal__close {
    /* Sticky, not absolute. The close button lives inside the panel, and
       the panel is what scrolls when the content outgrows it — so an
       absolutely-positioned button was anchored to a point in the content
       and scrolled away with it. A course with a dozen module days made
       the panel scroll far enough that the only way to close it was the
       backdrop or Escape. Sticky keeps it pinned to the top of the panel's
       visible area however far down the reader has scrolled.

       Floated right so it overlays the hero instead of pushing it down —
       a float contributes no height to the flow, so the content below
       starts where it always did. */
    position: sticky;
    top: var(--sc-sp-3);
    float: right;
    margin-right: var(--sc-sp-3);
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: none;
    /* Solid enough to read on any hero colour, since the hero takes the
       event's own colour and can be as pale as the stone swatch. */
    background: rgba(31, 42, 68, 0.62);
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2;
    transition: background var(--sc-dur-fast), transform var(--sc-dur-fast) var(--sc-ease-spring);
}

.sc-modal__close:hover,
.sc-modal__close:focus-visible,
.sc-modal__close:active {
    /* Darkens on hover instead of lightening. The old rule went the other
       way — a white glyph on a translucent-white chip, over a hero that is
       the event's own colour. On a pale event (amber, stone) the button was
       already faint, and hovering washed it out completely. */
    background: rgba(31, 42, 68, 0.88);
    color: #fff;
    transform: scale(1.08);
}

/* Hero image / colour band at top of modal */
.sc-modal__hero {
    height: 180px;
    border-radius: var(--sc-radius-xl) var(--sc-radius-xl) 0 0;
    overflow: hidden;
    position: relative;
    background: linear-gradient(135deg, var(--sc-header-from), var(--sc-header-to));
}

.sc-modal__hero img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* No featured image: a slim accent bar rather than a tall empty panel,
   which reads as a picture that failed to load. The course's colour still
   identifies it, and the title becomes the first thing in the modal.

   Both classes are in the selector on purpose: the narrow-screen rules set
   .sc-modal__hero to 140px further down the file, and a single-class
   selector here would lose to it on phones. */
.sc-modal__hero.sc-modal__hero--bare {
    height: 10px;
    border-radius: var(--sc-radius-xl) var(--sc-radius-xl) 0 0;
}

.sc-modal__hero-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(to top, rgba(15,23,42,0.6) 0%, transparent 60%);
}

.sc-modal__hero-title {
    position: absolute;
    bottom: var(--sc-sp-4);
    left: var(--sc-sp-4);
    right: var(--sc-sp-4);
    font-size: var(--sc-text-xl);
    font-weight: var(--sc-fw-extrabold);
    color: white;
    text-shadow: 0 1px 4px rgba(0,0,0,0.4);
    letter-spacing: -0.02em;
    line-height: 1.2;
}

/* Modal content area */
.sc-modal__body {
    padding: var(--sc-sp-5);
}

.sc-modal__title {
    font-size: var(--sc-text-xl);
    font-weight: var(--sc-fw-extrabold);
    color: var(--sc-text);
    line-height: 1.25;
    letter-spacing: -0.02em;
    margin-bottom: var(--sc-sp-3);
    padding-right: var(--sc-sp-8);
}

/* Meta row: icon + text */
.sc-modal__meta {
    display: flex;
    flex-direction: column;
    gap: var(--sc-sp-2);
    margin-bottom: var(--sc-sp-4);
}

.sc-modal__meta-row {
    display: flex;
    align-items: flex-start;
    gap: var(--sc-sp-2);
    font-size: var(--sc-text-sm);
    color: var(--sc-text-2);
    line-height: 1.4;
}

.sc-modal__meta-icon {
    flex-shrink: 0;
    width: 28px;
    height: 28px;
    border-radius: var(--sc-radius);
    background: var(--sc-primary-light);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--sc-primary);
    margin-top: -1px;
}

.sc-modal__meta-icon svg { flex-shrink: 0; }

.sc-modal__divider {
    height: 1px;
    background: var(--sc-border);
    margin: var(--sc-sp-4) 0;
}

.sc-modal__description {
    font-size: var(--sc-text-sm);
    line-height: 1.75;
    color: var(--sc-text-2);
}

.sc-modal__description p + p { margin-top: var(--sc-sp-3); }

/* Term badges in modal */
.sc-modal__terms {
    display: flex;
    flex-wrap: wrap;
    gap: var(--sc-sp-1);
    margin-bottom: var(--sc-sp-4);
}

.sc-modal__term-badge {
    font-size: var(--sc-text-xs);
    font-weight: var(--sc-fw-semibold);
    padding: 3px 10px;
    border-radius: var(--sc-radius-full);
    background: var(--sc-primary-light);
    color: var(--sc-primary);
    border: 1px solid color-mix(in srgb, var(--sc-primary) 25%, transparent);
}

/* Every day the course runs, numbered */
/* Module schedule in the modal. Same list as the list view's "View Modules"
   panel, but the modal is too narrow for a module's name and its dates to
   share a line, so each module stacks: name, then dates and days beneath. */
.sc-modal__modules {
    border-top: 1px solid var(--sc-border);
    margin-bottom: var(--sc-sp-4);
    padding-top: var(--sc-sp-3);
}

.sc-modal__modules-label {
    font-size: var(--sc-text-2xs);
    font-weight: 800;
    letter-spacing: .08em;
    text-transform: uppercase;
    color: var(--sc-text-muted, #8c93a3);
    margin-bottom: var(--sc-sp-1);
}

.sc-modal__modules .sc-modlist__row {
    flex-direction: column;
    align-items: flex-start;
    gap: 3px;
    padding: var(--sc-sp-2) 0;
}

.sc-modal__modules .sc-modlist__name { font-size: .8rem; }

.sc-modal__modules .sc-modlist__meta {
    justify-content: flex-start;
    margin-left: 0;
    text-align: left;
    gap: 2px var(--sc-sp-3);
}

.sc-modal__modules .sc-modlist__item { font-size: .8rem; white-space: normal; }

/* Registration status pill — renders only once ev.registration_status has
   a real value (see statusMeta() in calendar.js). */
.sc-modal__status {
    display: inline-block;
    font-size: var(--sc-text-xs);
    font-weight: var(--sc-fw-bold);
    padding: 4px 12px;
    border-radius: var(--sc-radius-full);
    margin-bottom: var(--sc-sp-4);
}

/* Action buttons */
.sc-modal__actions {
    display: flex;
    gap: var(--sc-sp-2);
    flex-wrap: wrap;
    padding-top: var(--sc-sp-4);
    border-top: 1px solid var(--sc-border);
}

.sc-modal__action-btn {
    display: inline-flex;
    align-items: center;
    gap: var(--sc-sp-1);
    padding: 0.5rem 1.1rem;
    border-radius: var(--sc-radius);
    font-size: var(--sc-text-sm);
    font-weight: var(--sc-fw-semibold);
    text-decoration: none;
    border: 1.5px solid transparent;
    cursor: pointer;
    font-family: var(--sc-font);
    transition:
        background var(--sc-dur-fast),
        border-color var(--sc-dur-fast),
        color var(--sc-dur-fast),
        transform var(--sc-dur-fast) var(--sc-ease-spring);
}

.sc-modal__action-btn:active { transform: scale(0.97); }

.sc-modal__action-btn--primary {
    background: var(--sc-primary);
    color: white;
    box-shadow: 0 2px 6px color-mix(in srgb, var(--sc-primary) 40%, transparent);
}

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

.sc-modal__action-btn--outline {
    border-color: var(--sc-border-strong);
    background: transparent;
    color: var(--sc-text-2);
}

.sc-modal__action-btn--outline:hover {
    border-color: var(--sc-primary);
    color: var(--sc-primary);
    background: var(--sc-primary-light);
}

/* Day-events list inside modal */
.sc-modal__day-list { display: flex; flex-direction: column; gap: var(--sc-sp-2); }

.sc-modal__day-item {
    display: flex;
    align-items: center;
    gap: var(--sc-sp-2);
    padding: var(--sc-sp-2) var(--sc-sp-3);
    border-radius: var(--sc-radius);
    cursor: pointer;
    border: 1px solid var(--sc-border);
    transition: background var(--sc-dur-fast), border-color var(--sc-dur-fast);
}

.sc-modal__day-item:hover {
    background: var(--sc-surface-hover);
    border-color: var(--sc-primary);
}

.sc-modal__day-item-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    flex-shrink: 0;
}

.sc-modal__day-item-title {
    font-weight: var(--sc-fw-semibold);
    font-size: var(--sc-text-sm);
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.sc-modal__day-item-time {
    font-size: var(--sc-text-xs);
    color: var(--sc-text-muted);
    white-space: nowrap;
}

/* ============================================================
   PRESET: Minimal
   ============================================================ */
.sc-preset-minimal {
    --sc-header-from:   #ffffff;
    --sc-header-to:     #f8fafc;
    --sc-primary:       #111827;
    --sc-primary-hover: #374151;
    --sc-primary-light: #f9fafb;
    --sc-text-on-primary: #111827;
    --sc-today-ring:    #111827;
    --sc-today-bg:      #f9fafb;
    --sc-shadow-md:     0 1px 4px rgba(0,0,0,0.07);
    --sc-shadow-xl:     0 8px 24px rgba(0,0,0,0.12);
    border: 1.5px solid var(--sc-border-strong);
}

.sc-preset-minimal .sc-toolbar {
    border-bottom: 1px solid var(--sc-border);
}

.sc-preset-minimal .sc-btn {
    border-color: var(--sc-border-strong);
    color: var(--sc-text-2);
    background: var(--sc-bg);
}

.sc-preset-minimal .sc-btn:hover,
.sc-preset-minimal .sc-btn--active {
    background: var(--sc-surface-2);
    border-color: var(--sc-border-strong);
    color: var(--sc-text);
}

/* ============================================================
   PRESET: Vibrant
   ============================================================ */
.sc-preset-vibrant {
    --sc-primary:          #8b5cf6;
    --sc-primary-hover:    #7c3aed;
    --sc-primary-light:    #f5f3ff;
    --sc-header-from:      #7c3aed;
    --sc-header-to:        #ec4899;
    --sc-today-ring:       #7c3aed;
    --sc-today-bg:         #f5f3ff;
    --sc-shadow-md:        0 4px 12px rgba(124,58,237,0.15);
    --sc-shadow-xl:        0 24px 48px rgba(124,58,237,0.18);
    border-radius: var(--sc-radius-xl);
}

.sc-preset-vibrant .sc-chip {
    background: linear-gradient(135deg, #8b5cf6, #ec4899);
}

.sc-preset-vibrant .sc-modal__hero {
    background: linear-gradient(135deg, #7c3aed, #ec4899);
}

/* ============================================================
   PRESET: Dark
   ============================================================ */
.sc-preset-dark {
    --sc-bg:               #0f172a;
    --sc-surface-1:        #1e293b;
    --sc-surface-2:        #334155;
    --sc-surface-3:        #475569;
    --sc-surface-hover:    #1e293b;
    --sc-border:           #334155;
    --sc-border-strong:    #475569;
    --sc-text:             #f1f5f9;
    --sc-text-2:           #e2e8f0;
    --sc-text-muted:       #94a3b8;
    --sc-text-faint:       #64748b;
    --sc-primary:          #60a5fa;
    --sc-primary-hover:    #3b82f6;
    --sc-primary-light:    #1e3a5f;
    --sc-header-from:      #1e293b;
    --sc-header-to:        #0f172a;
    --sc-today-bg:         #1e3a5f;
    --sc-today-ring:       #60a5fa;
    --sc-shimmer-from:     #1e293b;
    --sc-shimmer-mid:      #334155;
    --sc-shadow-md:        0 4px 12px rgba(0,0,0,0.4);
    --sc-shadow-xl:        0 24px 48px rgba(0,0,0,0.5);
    color-scheme: dark;
}

.sc-preset-dark .sc-toolbar {
    border-bottom: 1px solid #334155;
}

.sc-preset-dark .sc-modal__panel {
    border: 1px solid var(--sc-border-strong);
}

.sc-preset-dark .sc-modal__close {
    background: rgba(255,255,255,0.1);
}

.sc-preset-dark .sc-filter-pill {
    border-color: var(--sc-border-strong);
    color: var(--sc-text-muted);
}

/* ============================================================
   PRESET: Brand
   ============================================================ */
.sc-preset-brand {
    /* Values below match the official brand manual's design tokens rather
       than the earlier approximation taken from the live site before that
       manual existed. */
    --sc-primary:          #f2a900;
    --sc-primary-hover:    #d99a00;
    --sc-primary-light:    #fcf0d8;
    --sc-header-from:      #1f2a44;
    --sc-header-to:        #6b8b9a;
    --sc-bg:               #f7f5f2;
    --sc-surface-1:        #ffffff;
    --sc-surface-2:        #eceae6;
    --sc-text:             #1f2a44;
    --sc-text-2:           #6b8b9a;
    --sc-text-muted:       #8c93a3;
    --sc-border:           #d7d4cf;
    --sc-border-strong:    #b6b2ac;
    --sc-today-ring:       #f2a900;
    --sc-today-bg:         #fcf0d8;
    --sc-shadow-md:        0 4px 12px rgba(31,42,68,.10);
    --sc-shadow-xl:        0 18px 40px rgba(31,42,68,.14);
    --sc-font:             "Poppins", sans-serif;
    /* Brand manual: "clean & editorial — modest rounding, never pill-y on
       cards." The rest of the plugin's components already use the
       --sc-radius-* scale for their own corners; this only controls the
       outer calendar box, which no longer needs to be as rounded as 25px. */
    border-radius: var(--sc-radius-xl);
}

.sc-preset-brand .sc-toolbar__title {
    font-family: "Poppins", sans-serif;
}

.sc-preset-brand .sc-btn--active,
.sc-preset-brand .sc-btn:hover {
    background: #333;
    color: #fff;
}

/* ============================================================
   Utility: hidden / states
   ============================================================ */
.sc-hidden { display: none !important; }

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

/* ============================================================
   Responsive — tablet (≤768px)
   ============================================================ */
@media (max-width: 768px) {
    .sc-mini-wrap { flex-direction: column; }
    .sc-mini-cal  { width: 100%; border-right: none; border-bottom: 1px solid var(--sc-border); }

    .sc-toolbar { gap: var(--sc-sp-2); }
    .sc-toolbar__views { flex: 1 1 auto; justify-content: flex-end; }
    .sc-toolbar__logo { height: 34px; max-width: 40%; }

    .sc-cal-head { padding: var(--sc-sp-3) var(--sc-sp-3) var(--sc-sp-2); gap: var(--sc-sp-2); }
    .sc-cal-head .sc-toolbar__title {
        min-width: 0;
        flex: 1 1 auto;
        font-size: var(--sc-text-base);
        overflow: hidden;
        white-space: nowrap;
        text-overflow: ellipsis;
    }
    /* Absolute placement would overlap the shorter title on narrow screens. */
    .sc-cal-head .sc-btn--ghost,
    .sc-cal-head .sc-sidebar-arrow-toggle { position: static; }
    /* Sits first in the DOM (before prev/next) — reorder after "Today" so
       nav stays visually grouped in the middle. */
    .sc-cal-head .sc-sidebar-arrow-toggle { order: 3; }

    .sc-variants,
    .sc-legend,
    .sc-summary { padding-left: var(--sc-sp-3); padding-right: var(--sc-sp-3); }
    .sc-legend { gap: var(--sc-sp-3); }
    .sc-legend__item--end { margin-left: 0; }

    .sc-week__body,
    .sc-day__body  { max-height: 420px; }

    .sc-cell-min-height { --sc-cell-min-height: 80px; }

    .sc-modal__hero { height: 140px; }
    .sc-modal__panel { max-width: 100%; border-radius: var(--sc-radius-lg); }

    .sc-main-row { flex-direction: column; }
    .sc-sidebar-filters {
        width: 100%;
        flex: 1 1 auto;
        border-right: none;
        border-bottom: 1px solid var(--sc-border);
    }
    .sc-sidebar-filters__group + .sc-sidebar-filters__group { margin-top: var(--sc-sp-3); }
    .sc-sidebar-filters__list { flex-direction: row; flex-wrap: wrap; }
    .sc-sidebar-filters__list .sc-filter-pill { width: auto; }

    /* Stacked layout: the flex main-axis is vertical here, so collapsing
       needs to zero out height, not width. */
    .sc-sidebar-collapsed .sc-sidebar-filters {
        flex-basis: 0;
        width: 100%;
        height: 0;
        min-height: 0;
        padding-top: 0;
        padding-bottom: 0;
        border-bottom: none;
    }
}

/* ============================================================
   Responsive — mobile (≤520px)
   ============================================================ */
@media (max-width: 520px) {
    .sc-toolbar__logo { height: 28px; }
    .sc-cal-head .sc-toolbar__title { font-size: var(--sc-text-sm); }
    .sc-cal-head { gap: var(--sc-sp-1); }
    .sc-navbtn { width: 30px; height: 30px; }

    /* The switcher's three labels can't share a row this narrow. */
    .sc-variants { gap: var(--sc-sp-2); }
    .sc-seg { width: 100%; justify-content: space-between; }
    .sc-seg__btn { padding: 7px 10px; font-size: var(--sc-text-xs); gap: 4px; }
    .sc-seg__rec { display: none; }

    .sc-month__dow { font-size: var(--sc-text-xs); padding: var(--sc-sp-1); }
    .sc-month__cell { min-height: 52px; padding: 2px 1px; }
    .sc-month__day-num { width: 22px; height: 22px; font-size: var(--sc-text-xs); }

    /* A day's courses can't be named in a 45px cell, so they read as dots
       — but at 6px they were barely visible and gave no sense of how many.
       Bigger dots, laid out in a row, with the cell itself tinted when it
       has anything on it; tapping opens the day's list. */
    /* Both selectors carry a class each, because .sc-chip--status
       .sc-chip__label sets display:-webkit-box and outranks a bare
       .sc-chip__label — which is why the course title kept rendering
       inside the dot instead of being hidden by it. */
    .sc-chip .sc-chip__label,
    .sc-chip .sc-chip__dot { display: none !important; }

    .sc-chip {
        display: inline-block;
        width: 13px;
        height: 13px;
        min-height: 0;
        margin: 2px;
        border-radius: 50%;
        padding: 0;
        overflow: hidden;
        border: 0;
        vertical-align: middle;
        /* Solid status colour, the same one the full-size chip is filled
           with, so a dot means the same thing at every width. */
        background: var(--sc-chip-color, var(--sc-primary)) !important;
        /* Nothing left to typeset; this stops any stray text node from
           being laid out inside the circle. */
        font-size: 0 !important;
        line-height: 0;
        color: transparent;
    }
    /* Neutral wash for "something on this day": amber is Wait list's
       colour now, and tinting every busy day with it said otherwise. */
    .sc-month__cell:has(.sc-chip) { background: rgba(107, 139, 154, 0.12); }
    .sc-month__more { font-size: var(--sc-text-2xs); padding: 0 2px; }
    /* The dot-only chip has no room for a border to read against. */
    .sc-chip--status { border: 0; padding: 0; }

    /* Bars and day markers shrink to a band/dot for the same reason. */
    .sc-month__bar {
        height: 6px;
        padding: 0;
        font-size: 0;
        border-radius: 3px;
    }
    .sc-month__daymark-label { display: none; }

    /* Labels stay. Hiding them left four look-alike icon buttons with no
       way to tell which view you were in — and Month, which had no icon,
       rendered as an empty box. */
    .sc-btn { padding: 0.35rem 0.5rem; }
    .sc-btn--today { padding: 0.35rem 0.6rem; }

    .sc-event-card__thumb { display: none; }

    /* align-items:flex-end is safe here (unlike the clipping risk noted
       above for :center) because the panel's own max-height below caps its
       box size directly — it never actually grows larger than the sheet
       area for flex-end's positioning to miscompute against. */
    .sc-modal { padding: var(--sc-sp-2); align-items: flex-end; }
    .sc-modal__panel {
        max-height: 100%;
        border-radius: var(--sc-radius-lg) var(--sc-radius-lg) 0 0;
        animation-name: sc-modal-sheet-in;
        /* A vertical auto margin (set for desktop centering) would override
           the container's align-items:flex-end above and re-center the
           sheet instead of anchoring it to the bottom — reset it here. */
        margin-top: 0;
        margin-bottom: 0;
    }

    @keyframes sc-modal-sheet-in {
        from { opacity: 0; transform: translateY(40px); }
        to   { opacity: 1; transform: none; }
    }
}

/* ============================================================
   Print
   ============================================================ */
@media print {
    .sc-toolbar__views,
    .sc-btn--export,
    .sc-filter-bar,
    .sc-mini-cal,
    .sc-modal { display: none !important; }

    .sc-calendar-wrap {
        border: none;
        box-shadow: none;
        border-radius: 0;
    }

    .sc-month__cell { min-height: 64px; }
    .sc-chip { background: #999 !important; }
}

/* ============================================================
   Grid / Magazine view
   ============================================================
   Editorial card layout with three size tiers:
     .sc-grid-card--hero   — first in each group, large
     .sc-grid-card--mid    — 2 stacked beside the hero
     .sc-grid-card--sm     — 3 per row below each group

   Cards use a full-bleed background image (or generated
   placeholder) with a gradient overlay that reveals text on
   hover. When no image exists, a decorative colour + pattern
   placeholder is shown instead.
   ============================================================ */

/* ── Base card ─────────────────────────────────────────────── */
.sc-grid {
    padding: var(--sc-sp-4);
    display: flex;
    flex-direction: column;
    gap: var(--sc-sp-3);
}

.sc-grid-card {
    position: relative;
    border-radius: var(--sc-radius-lg);
    overflow: hidden;
    cursor: pointer;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    isolation: isolate;
    transition:
        transform var(--sc-dur) var(--sc-ease-spring),
        box-shadow var(--sc-dur) var(--sc-ease-std);
    box-shadow: var(--sc-shadow-md);
    /* Accessibility — card is a button-like region */
    outline-offset: 3px;
}

.sc-grid-card:hover {
    transform: translateY(-3px) scale(1.005);
    box-shadow: var(--sc-shadow-lg);
}

.sc-grid-card:focus-visible {
    outline: 3px solid var(--sc-focus-ring);
}

.sc-grid-card:active {
    transform: scale(0.99);
}

/* Gradient overlay — always present, deeper on hover */
.sc-grid-card__overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(
        to top,
        rgba(5,10,24,0.88)  0%,
        rgba(5,10,24,0.45) 45%,
        rgba(5,10,24,0.1)  80%,
        transparent        100%
    );
    transition: background var(--sc-dur) var(--sc-ease-std);
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    padding: var(--sc-sp-4);
}

.sc-grid-card:hover .sc-grid-card__overlay {
    background: linear-gradient(
        to top,
        rgba(5,10,24,0.96)  0%,
        rgba(5,10,24,0.65) 55%,
        rgba(5,10,24,0.2)  85%,
        transparent        100%
    );
}

/* Date badge — top-right corner */
.sc-grid-card__badge {
    position: absolute;
    top: var(--sc-sp-3);
    right: var(--sc-sp-3);
    background: rgba(255,255,255,0.18);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border: 1px solid rgba(255,255,255,0.25);
    border-radius: var(--sc-radius);
    padding: 4px 10px;
    display: flex;
    flex-direction: column;
    align-items: center;
    line-height: 1.1;
    min-width: 42px;
    z-index: 2;
}

.sc-grid-card__badge-day {
    font-size: 1.25rem;
    font-weight: var(--sc-fw-extrabold);
    color: #fff;
    letter-spacing: -0.02em;
}

.sc-grid-card__badge-mon {
    font-size: 0.6rem;
    font-weight: var(--sc-fw-bold);
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: rgba(255,255,255,0.8);
}

/* Category pill — top-left */
.sc-grid-card__cat {
    position: absolute;
    top: var(--sc-sp-3);
    left: var(--sc-sp-3);
    font-size: var(--sc-text-2xs);
    font-weight: var(--sc-fw-bold);
    text-transform: uppercase;
    letter-spacing: 0.09em;
    color: #fff;
    background: var(--sc-primary);
    padding: 3px 9px;
    border-radius: var(--sc-radius-full);
    z-index: 2;
    max-width: 140px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    box-shadow: 0 2px 8px rgba(0,0,0,0.25);
}

/* Text content inside overlay */
.sc-grid-card__content {
    position: relative;
    z-index: 1;
    transform: translateY(4px);
    transition: transform var(--sc-dur) var(--sc-ease-out);
}

.sc-grid-card:hover .sc-grid-card__content {
    transform: translateY(0);
}

.sc-grid-card__title {
    font-size: var(--sc-text-base);
    font-weight: var(--sc-fw-extrabold);
    color: #fff;
    line-height: 1.25;
    letter-spacing: -0.01em;
    margin-bottom: 4px;
    text-shadow: 0 1px 4px rgba(0,0,0,0.4);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.sc-grid-card__meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: var(--sc-sp-2);
    font-size: var(--sc-text-xs);
    color: rgba(255,255,255,0.75);
    margin-top: 2px;
    /* Hidden initially, revealed on hover */
    opacity: 0;
    max-height: 0;
    overflow: hidden;
    transition:
        opacity var(--sc-dur) var(--sc-ease-out),
        max-height var(--sc-dur-slow) var(--sc-ease-out);
}

.sc-grid-card:hover .sc-grid-card__meta,
.sc-grid-card--hero .sc-grid-card__meta {
    opacity: 1;
    max-height: 80px;
}

.sc-grid-card__meta-item {
    display: flex;
    align-items: center;
    gap: 4px;
}

.sc-grid-card__excerpt {
    font-size: var(--sc-text-xs);
    color: rgba(255,255,255,0.7);
    margin-top: var(--sc-sp-2);
    line-height: 1.5;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    opacity: 0;
    max-height: 0;
    transition:
        opacity var(--sc-dur) var(--sc-ease-out),
        max-height var(--sc-dur-slow) var(--sc-ease-out);
}

.sc-grid-card--hero .sc-grid-card__excerpt,
.sc-grid-card:hover .sc-grid-card__excerpt {
    opacity: 1;
    max-height: 60px;
}

/* ── Placeholder (no featured image) ─────────────────────── */
.sc-grid-card--placeholder {
    background-size: cover;
}

/* Subtle SVG pattern overlay on placeholders */
.sc-grid-card--placeholder::before {
    content: '';
    position: absolute;
    inset: 0;
    opacity: 0.12;
    background-image: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23ffffff' fill-opacity='1'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
}

/* Large initial letter on placeholder */
.sc-grid-card__placeholder-letter {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: clamp(3rem, 8vw, 6rem);
    font-weight: var(--sc-fw-extrabold);
    color: rgba(255,255,255,0.15);
    line-height: 1;
    pointer-events: none;
    z-index: 0;
    letter-spacing: -0.05em;
    user-select: none;
    -webkit-user-select: none;
}

/* ── Size tiers ─────────────────────────────────────────── */

/* Hero — first card in each group, takes 2/3 width */
.sc-grid-card--hero {
    min-height: 380px;
    flex: 2 0 0;
    /* Larger title */
}

.sc-grid-card--hero .sc-grid-card__title {
    font-size: var(--sc-text-xl);
    -webkit-line-clamp: 3;
}

.sc-grid-card--hero .sc-grid-card__badge-day { font-size: 1.6rem; }

/* Mid — stacked beside the hero */
.sc-grid-card--mid {
    min-height: 181px;
    flex: 1 0 0;
}

/* Small — bottom row, 3 per row */
.sc-grid-card--sm {
    min-height: 220px;
    flex: 1 0 0;
}

.sc-grid-card--sm .sc-grid-card__title {
    font-size: var(--sc-text-sm);
}

.sc-grid-card--sm .sc-grid-card__badge-day { font-size: 1rem; }

/* Wide — solo full-width accent card */
.sc-grid-card--wide {
    min-height: 240px;
    width: 100%;
}

.sc-grid-card--wide .sc-grid-card__title {
    font-size: var(--sc-text-lg);
}

/* ── Row layout ─────────────────────────────────────────── */
.sc-grid__group {
    display: flex;
    flex-direction: column;
    gap: var(--sc-sp-3);
}

/* Hero row: hero card + 2 stacked mid cards */
.sc-grid__hero-row {
    display: flex;
    gap: var(--sc-sp-3);
    min-height: 380px;
}

/* Mid col: two mid cards stacked */
.sc-grid__mid-col {
    display: flex;
    flex-direction: column;
    gap: var(--sc-sp-3);
    flex: 1 0 0;
    min-width: 0;
}

/* Small row: up to 3 small cards */
.sc-grid__sm-row {
    display: flex;
    gap: var(--sc-sp-3);
}

/* ── Pagination in grid view ────────────────────────────── */
.sc-grid__pagination {
    display: flex;
    justify-content: center;
    gap: var(--sc-sp-2);
    padding: var(--sc-sp-4) 0 var(--sc-sp-2);
}

/* ── Responsive ─────────────────────────────────────────── */
@media (max-width: 820px) {
    .sc-grid__hero-row {
        flex-direction: column;
        min-height: auto;
    }

    .sc-grid-card--hero {
        min-height: 280px;
        flex: none;
    }

    .sc-grid__mid-col {
        flex-direction: row;
    }

    .sc-grid-card--mid {
        min-height: 160px;
        flex: 1;
    }

    .sc-grid-card--sm {
        min-height: 170px;
    }
}

@media (max-width: 560px) {
    .sc-grid {
        padding: var(--sc-sp-2);
        gap: var(--sc-sp-2);
    }

    .sc-grid__hero-row,
    .sc-grid__mid-col,
    .sc-grid__sm-row {
        flex-direction: column;
        gap: var(--sc-sp-2);
    }

    .sc-grid-card--hero   { min-height: 240px; }
    .sc-grid-card--mid    { min-height: 160px; }
    .sc-grid-card--sm     { min-height: 160px; }

    .sc-grid-card__overlay { padding: var(--sc-sp-3); }

    .sc-grid-card__meta,
    .sc-grid-card__excerpt {
        /* Always visible on touch devices */
        opacity: 1 !important;
        max-height: 80px !important;
    }
}

@media print {
    .sc-grid-card {
        break-inside: avoid;
        box-shadow: none;
    }
}

/* ══ Interaction states ════════════════════════════════════════════════
   Every focusable thing in the calendar gets a brand focus ring. Without
   this, anything the stylesheet forgot falls back to the browser's own
   ring — the light blue that has nothing to do with the brand and shows
   up on click, not just on keyboard focus, in some browsers.

   :focus-visible (not :focus) so a mouse click doesn't leave a ring
   behind, while keyboard users keep the indicator they need.            */

.sc-calendar-wrap :is(a, button, input, select, summary, [tabindex]):focus-visible {
    outline: 2px solid var(--sc-focus-ring);
    outline-offset: 2px;
}

/* Dark surfaces: the navy ring would disappear into the background. */
.sc-toolbar :is(a, button, [tabindex]):focus-visible,
.sc-modal__header :is(a, button, [tabindex]):focus-visible {
    outline-color: var(--sc-focus-ring-on-dark);
}

/* Links inside the calendar are chrome, not body copy — they must not
   pick up the theme's link colour on hover or after being visited. */
.sc-calendar-wrap a:hover,
.sc-calendar-wrap a:focus,
.sc-calendar-wrap a:active,
.sc-calendar-wrap a:visited {
    color: inherit;
}

/* The list view's own buttons had no hover or pressed state, which left
   the theme's generic styling to supply one. */
.sc-row__cta:hover { filter: brightness(0.93); }
.sc-row__cta:active { filter: brightness(0.88); }
.sc-row__cta--inert:hover,
.sc-row__cta--inert:active { filter: none; }

/* Picks up the amber of the status button above it on hover. Declares
   `color` alongside `background`, which is what was missing: the rule set
   only a pale background and left the theme to supply a colour, and its
   white text on that background rendered the button blank. */
.sc-calendar-wrap .sc-row__mods-btn:hover,
.sc-calendar-wrap .sc-row__mods-btn:focus,
.sc-calendar-wrap .sc-row__mods-btn:focus-visible {
    background: #f2a900;
    border-color: #f2a900;
    color: #1f2a44;
}

.sc-calendar-wrap .sc-row__mods-btn:active {
    background: #d99900;
    border-color: #d99900;
    color: #1f2a44;
}

.sc-card__more:hover { color: var(--sc-focus-ring); }
.sc-card__more:active { opacity: .8; }

/* Tap highlight: mobile browsers paint their own translucent blue over a
   tapped control unless told otherwise. */
.sc-calendar-wrap :is(a, button, [tabindex]) {
    -webkit-tap-highlight-color: rgba(31, 42, 68, 0.12);
}

/* ══ Theme-proofing for control states ═════════════════════════════════
   The plugin renders inside somebody else's theme, and themes style bare
   `button` and `a` on :hover/:focus/:active — commonly with their own
   accent colour. Where the plugin declared only a resting style, the
   theme supplied the rest: nav arrows whose glyph vanished into a themed
   hover background, and a sidebar toggle left sitting on the theme's blue
   after being clicked.

   These re-declare each state with the wrap class in the selector, so the
   plugin's own colours win on specificity without resorting to
   !important, and set colour alongside background so a glyph can never be
   left the same shade as what's behind it.                              */

.sc-calendar-wrap :is(button, a.sc-btn) {
    -webkit-appearance: none;
    appearance: none;
    background-image: none;
}

/* Round nav buttons: month arrows, the sidebar arrow toggle. */
.sc-calendar-wrap .sc-navbtn:hover,
.sc-calendar-wrap .sc-navbtn:focus,
.sc-calendar-wrap .sc-navbtn:focus-visible {
    background: var(--sc-surface-2);
    border-color: var(--sc-text-2);
    color: var(--sc-text);
}

.sc-calendar-wrap .sc-navbtn:active,
.sc-calendar-wrap .sc-sidebar-arrow-toggle--collapsed {
    background: var(--sc-focus-ring);
    border-color: var(--sc-focus-ring);
    color: #fff;
}

/* Toolbar buttons sit on the dark band and keep the translucent look. */
.sc-calendar-wrap .sc-toolbar .sc-btn:hover,
.sc-calendar-wrap .sc-toolbar .sc-btn:focus,
.sc-calendar-wrap .sc-toolbar .sc-btn:active,
.sc-calendar-wrap .sc-toolbar .sc-btn--active {
    background: rgba(255, 255, 255, 0.22);
    border-color: rgba(255, 255, 255, 0.55);
    color: #fff;
}

/* "Today" and other light buttons outside the toolbar. */
.sc-calendar-wrap .sc-cal-head .sc-btn--ghost:hover,
.sc-calendar-wrap .sc-cal-head .sc-btn--ghost:focus,
.sc-calendar-wrap .sc-cal-head .sc-btn--ghost:active {
    background: var(--sc-surface-2);
    border-color: var(--sc-text-2);
    color: var(--sc-text);
}

/* Results summary: "Clear all", and the × on each active-filter chip. */
.sc-calendar-wrap .sc-summary__clear:hover,
.sc-calendar-wrap .sc-summary__clear:focus,
.sc-calendar-wrap .sc-summary__clear:focus-visible {
    background: #1f2a44;
    border-color: #1f2a44;
    color: #fff;
}

.sc-calendar-wrap .sc-summary__clear:active {
    background: #16203a;
    border-color: #16203a;
    color: #fff;
}

.sc-calendar-wrap .sc-summary__chip-x:hover,
.sc-calendar-wrap .sc-summary__chip-x:focus,
.sc-calendar-wrap .sc-summary__chip-x:focus-visible,
.sc-calendar-wrap .sc-summary__chip-x:active {
    background: rgba(31, 42, 68, 0.16);
    color: #1f2a44;
}

/* Segmented switchers (Calendar display / List style). */
.sc-calendar-wrap .sc-seg__btn:hover,
.sc-calendar-wrap .sc-seg__btn:focus {
    background: var(--sc-surface-2);
    color: var(--sc-text);
}
.sc-calendar-wrap .sc-seg__btn--on,
.sc-calendar-wrap .sc-seg__btn--on:hover,
.sc-calendar-wrap .sc-seg__btn--on:focus {
    background: var(--sc-surface-1);
    color: var(--sc-text);
    box-shadow: 0 1px 3px rgba(31, 42, 68, .18);
}

/* ══ Mobile ════════════════════════════════════════════════════════════
   On a phone the rail can't sit beside the calendar, so it stacks above
   it. Left open, it filled the first screen and pushed the calendar out
   of sight — so it behaves as a drawer here: closed until the Filters
   button is tapped, capped in height, and scrolling inside itself.      */

@media (max-width: 768px) {
    .sc-sidebar-filters {
        max-height: 60vh;
        overflow-y: auto;
        /* The JS caps this to the calendar's height for the desktop rail;
           on a stacked drawer that number is meaningless. */
        max-height: 60vh !important;
    }

    /* Long facet names (studio and venue names especially) ran past the
       edge and left the panel scrolling sideways. */
    .sc-filter-pill { max-width: 100%; }
    .sc-filter-pill__label {
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
        min-width: 0;
    }
    .sc-sidebar-filters__list { gap: var(--sc-sp-2); }

    /* Touch targets: 44px is the smallest comfortable tap area. */
    .sc-sidebar-filters__list .sc-filter-pill { min-height: 40px; }
    .sc-sidebar-filters__heading { min-height: 44px; display: flex; align-items: center; }

    /* Count of active filters, so a closed drawer still says it's on. */
    .sc-btn__badge {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        min-width: 18px;
        height: 18px;
        margin-left: 5px;
        padding: 0 5px;
        border-radius: 999px;
        background: #f2a900;
        color: #1f2a44;
        font-size: 11px;
        font-weight: 800;
        line-height: 1;
    }

    /* The view switcher is the main orientation cue on a phone: the active
       view has to be unmistakable, not a slightly lighter button. The base
       rule marks it with a 28%-white wash flagged !important, which on the
       dark toolbar is too close to the inactive 10% to tell apart — and it
       left dark text sitting on a mostly-dark button. Solid white here, so
       the override has to carry !important too. */
    .sc-calendar-wrap .sc-toolbar__views .sc-btn--active {
        background: #fff !important;
        border-color: #fff !important;
        color: #1f2a44 !important;
        font-weight: 800;
        box-shadow: none;
    }
    .sc-toolbar__views .sc-btn { font-size: var(--sc-text-sm); padding: 0.45rem 0.7rem; }
    .sc-toolbar__views .sc-btn svg { width: 13px; height: 13px; }

    /* List rows: the action column can't hold its own beside the text. */
    .sc-row__main { flex-wrap: wrap; gap: var(--sc-sp-3); }
    .sc-row__date { width: 60px; align-self: flex-start; }
    .sc-row__body { flex: 1 1 60%; }
    .sc-row__actions { width: 100%; min-width: 0; }
    .sc-row__title { font-size: .98rem; }
    .sc-cards { grid-template-columns: 1fr; }

    /* Module schedule stacks; its two columns can't share this width. */
    .sc-modlist__row { flex-direction: column; align-items: flex-start; gap: var(--sc-sp-1); }
    .sc-modlist__meta { justify-content: flex-start; margin-left: 0; text-align: left; }
}

@media (max-width: 520px) {
    /* Enough height for the day number and a row of dots under it. */
    .sc-month__cell { min-height: 62px; }
    .sc-legend { font-size: var(--sc-text-2xs); }
    .sc-summary__count { font-size: var(--sc-text-sm); }
    .sc-summary__clear { margin-left: 0; }
}

@media (max-width: 520px) {
    /* The legend is reference material, not a control — one compact row
       rather than three lines competing with the calendar for the first
       screen. */
    .sc-legend {
        gap: var(--sc-sp-2) var(--sc-sp-3);
        padding-top: var(--sc-sp-2);
        padding-bottom: var(--sc-sp-2);
    }
    .sc-legend__dot { width: 8px; height: 8px; }

    /* Day cells: number and its markers on separate lines so the dots
       aren't crowded against the digits. */
    .sc-month__cell { padding: 3px 2px; }
    .sc-month__day-num { display: block; margin-bottom: 2px; }
}
