/* ==========================================================================
   Timetable Components — course blocks, day headers, time slots, UI elements
   ========================================================================== */

/* --------------------------------------------------------------------------
   Toolbar buttons (.download-btn group + standalone download-btn)
   -------------------------------------------------------------------------- */

/* Shared styles for all toolbar icon buttons */
.download-btn, .add-temp-course-btn, .upload-btn, .compare-btn, .ai-btn {
    position: relative;
    padding: 0.5rem;
    border-radius: 0.25rem;
    transition: all 0.2s ease-in-out;
}

.download-btn i, .add-temp-course-btn i, .upload-btn i, .compare-btn i, .ai-btn i {
    transition: color 0.2s ease-in-out;
}

.download-btn:hover, .add-temp-course-btn:hover, .upload-btn:hover, .compare-btn:hover, .ai-btn:hover {
    background-color: rgba(37, 99, 235, 0.1);
}

.download-btn:hover i, .add-temp-course-btn:hover i, .upload-btn:hover i, .compare-btn:hover i, .ai-btn:hover i {
    color: #2563eb;
}

/* Extended download button (inline-flex variant) */
.download-btn {
    display: inline-flex;
    align-items: center;
    padding: 6px 10px;
    border-radius: 4px;
    transition: all 0.2s ease;
}

.download-btn:hover {
    background-color: rgba(59, 130, 246, 0.1);
}

/* Tooltip shared by all toolbar buttons */
.download-tooltip {
    position: absolute;
    top: 100%;
    right: 0;
    background-color: var(--color-text-dark);
    color: white;
    font-size: 0.75rem;
    padding: 4px 8px;
    border-radius: 4px;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease;
    white-space: nowrap;
    margin-top: 5px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
    z-index: 20;
}

.download-btn:hover .download-tooltip,
.add-temp-course-btn:hover .download-tooltip,
.upload-btn:hover .download-tooltip,
.compare-btn:hover .download-tooltip,
.ai-btn:hover .download-tooltip {
    opacity: 1;
    visibility: visible;
}

/* --------------------------------------------------------------------------
   Day headers, grid lines, time labels
   -------------------------------------------------------------------------- */

/* Canonical .day-header — merged from all conflicting definitions */
.day-header {
    position: absolute;
    height: 30px;
    line-height: 30px;
    text-align: center;
    border-right: 1px solid var(--color-border);
    background-color: white;
    font-weight: 500;
    margin-left: -10px;
    top: 0;
    font-size: 1rem;
    width: 120px;
}

/* Precise positions inside #schDays */
#schDays .day-header:nth-child(1) { left: 85px; }
#schDays .day-header:nth-child(2) { left: 205px; }
#schDays .day-header:nth-child(3) { left: 325px; }
#schDays .day-header:nth-child(4) { left: 445px; }
#schDays .day-header:nth-child(5) { left: 565px; }
/* Weekend columns (print/shared): markup ships them display:none with class
   .weekend-col; static-grid.js reveals them when a course meets S/U */
#schDays .day-header:nth-child(6) { left: 685px; }
#schDays .day-header:nth-child(7) { left: 805px; }

/* Fallback positions for .day-header outside #schDays */
.day-header:nth-child(1) { left: 70px; }
.day-header:nth-child(2) { left: 190px; }
.day-header:nth-child(3) { left: 310px; }
.day-header:nth-child(4) { left: 430px; }
.day-header:nth-child(5) { left: 550px; }
.day-header:nth-child(6) { left: 670px; }
.day-header:nth-child(7) { left: 790px; }

/* Vertical day-separator lines */
.day-line {
    position: absolute;
    top: 40px;
    width: 1px;
    background-color: #ddd;
}

.day-line:nth-child(1) { left: 75px; }
.day-line:nth-child(2) { left: 195px; }
.day-line:nth-child(3) { left: 315px; }
.day-line:nth-child(4) { left: 435px; }
.day-line:nth-child(5) { left: 555px; }
.day-line:nth-child(6) { left: 675px; }

/* Horizontal hour-separator lines */
.hour-line {
    position: absolute;
    left: 70px;
    width: 615px;
    height: 1px;
    background-color: #ddd;
}

.time-label {
    font-size: 0.875rem;
    color: #4b5563;
}

/* --------------------------------------------------------------------------
   Course blocks
   -------------------------------------------------------------------------- */

.course-shadow {
    position: absolute;
    background-color: rgba(0, 123, 255, 0.1);
    border: 2px dashed rgba(0, 123, 255, 0.4);
    border-radius: 4px;
    pointer-events: none;
    z-index: 1;
    transition: opacity 0.2s ease;
}

.course-block {
    position: absolute;
    border-radius: 3px;
    padding: 8px;
    color: white;
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    overflow: hidden;
}

.course-block:hover {
    transform: scale(1.02);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

/* Retired section (M15): NDU no longer lists it, but it is still in this
   draft and still holds its slot. Dimmed with a dashed edge so it reads as
   "present but not real" at a glance, and labelled in words underneath —
   colour alone would say nothing to a screen reader or a monochrome print. */
.course-block-archived {
    opacity: 0.72;
    border: 2px dashed rgba(255, 255, 255, 0.85);
}

.course-block-archived .block-retired {
    display: block;
    margin-top: 2px;
    font-size: 0.6rem;
    font-weight: 600;
    letter-spacing: 0.02em;
    text-transform: uppercase;
    line-height: 1.1;
    word-break: break-word;
}

/* Conflict/removal states */
.overlap-highlight {
    background-color: var(--color-danger) !important;
    border: 2px solid #dc2626 !important;
    box-shadow: 0 0 10px rgba(239, 68, 68, 0.5) !important;
    animation: pulse 1s infinite;
}

.course-block.removal-ready {
    animation: pulse-warning 1s infinite;
    border: 2px solid #f59e0b !important;
    box-shadow: 0 0 10px rgba(245, 158, 11, 0.5) !important;
}

.course-block.removing-confirmed {
    animation: fade-out 0.18s ease-out forwards;
    border: 2px solid var(--color-danger) !important;
    box-shadow: 0 0 15px rgba(239, 68, 68, 0.7) !important;
}

/* Course preview block (hover shadow on grid) */
.course-preview-block {
    animation: pulse 2s ease-in-out infinite;
}

/* --------------------------------------------------------------------------
   Context menu
   -------------------------------------------------------------------------- */

.course-context-menu {
    min-width: 200px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.15);
    animation: context-menu-appear 0.15s ease-out;
}

.course-context-menu .context-menu-item {
    transition: background-color 0.15s ease;
}

.course-context-menu .context-menu-item:hover {
    background-color: #f3f4f6;
}

.course-context-menu .context-menu-item:active {
    background-color: var(--color-border);
}

/* --------------------------------------------------------------------------
   Scrollbar styling
   -------------------------------------------------------------------------- */

.overflow-y-auto {
    scrollbar-width: thin;
    scrollbar-color: #cbd5e0 #f1f5f9;
}

.overflow-y-auto::-webkit-scrollbar {
    width: 6px;
}

.overflow-y-auto::-webkit-scrollbar-track {
    background: #f1f5f9;
    border-radius: 3px;
}

.overflow-y-auto::-webkit-scrollbar-thumb {
    background-color: #cbd5e0;
    border-radius: 3px;
}

/* --------------------------------------------------------------------------
   Course info card
   -------------------------------------------------------------------------- */

#courseInfo {
    transition: all 0.3s ease;
}

/* --------------------------------------------------------------------------
   Modern design system — cards, inputs, search, tips
   -------------------------------------------------------------------------- */

/* Theme cross-fade — scoped replacement for the old `* { transition: all .3s }`
   catch-all, which taxed paint on the 675x1200 absolute grid and animated
   modal toggles / grid transforms unintentionally. Interactive elements carry
   their own transitions. */
body,
.day-header,
.time-label,
.hour-line,
.day-line,
#schTimes,
.bg-white {
    transition: background-color 0.3s ease, color 0.3s ease, border-color 0.3s ease;
}

.glass-card {
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

.modern-card {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.modern-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.15);
}

/* Floating label */
.floating-label-container {
    position: relative;
}

/* The hint label doesn't float — layout.css fades it out on focus/content —
   so it sits exactly where the typed text goes (left matches px-4, vertically
   centred), and the input needs no asymmetric headroom padding. */
.floating-label {
    position: absolute;
    left: 16px;
    top: 50%;
    transform: translateY(-50%);
    transition: opacity 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    color: #9ca3af;
    pointer-events: none;
    font-size: 16px;
}

.modern-input {
    padding-top: 12px;
    padding-bottom: 12px;
}

/* Modern search input */
.modern-search-input {
    background: rgba(255, 255, 255, 0.9);
    border: 2px solid transparent;
    backdrop-filter: blur(10px);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.modern-search-input:focus {
    background: rgba(255, 255, 255, 1);
    border-color: var(--color-primary);
    box-shadow: 0 0 0 4px rgba(35, 135, 186, 0.1);
}

/* Search result items */
.search-result-item {
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    transform: translateY(0);
}

.search-result-item:hover {
    background: rgba(255, 255, 255, 1);
    transform: translateY(-1px);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
    border-color: rgba(35, 135, 186, 0.2);
}

/* Expert tips */
/* Colour and border are the utilities on the element (bg-ink-50, border-ink-100):
   a rule here would beat their dark-mode rows (UI-13). */
.expert-tip-card {
    backdrop-filter: blur(10px);
}

.tip-icon {
    background: linear-gradient(135deg, var(--color-primary), var(--color-primary-alt));
    color: white;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    animation: pulse 2s infinite;
}

/* Loading shimmer */
.shimmer {
    background: linear-gradient(to right, #f6f7f8 8%, #edeef1 18%, #f6f7f8 33%);
    background-size: 800px 104px;
    animation: shimmer 1.5s infinite ease-in-out;
}

/* --------------------------------------------------------------------------
   Course info header / content
   -------------------------------------------------------------------------- */

/* A panel title is text: gray-900, not a blue-to-blue gradient clipped to the
   letters (UI-13). Dark mode: dark-mode.css. */
.course-info-header {
    color: #111827;
    font-weight: 600;
}

.course-info-content {
    opacity: 0;
    transform: translateY(10px);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.course-info-content.show {
    opacity: 1;
    transform: translateY(0);
}

/* --------------------------------------------------------------------------
   Favorites items
   -------------------------------------------------------------------------- */

.favorite-item {
    background: rgba(255, 255, 255, 0.9);
    border: 1px solid rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(10px);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    opacity: 0;
    transform: translateX(-20px);
    animation: slideInFavorite 0.5s forwards;
}

.favorite-item:hover {
    background: rgba(255, 255, 255, 1);
    transform: translateX(4px);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
}

.favorite-remove-btn {
    opacity: 0;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.favorite-item:hover .favorite-remove-btn {
    opacity: 1;
}

/* Empty state */
.empty-state {
    opacity: 0;
    animation: fadeInUp 0.6s forwards;
}

.empty-state-icon {
    animation: float 3s ease-in-out infinite;
}

/* --------------------------------------------------------------------------
   Feature icons (toolbar icons section)
   -------------------------------------------------------------------------- */

.feature-icon {
    background: linear-gradient(135deg, var(--color-primary), var(--color-primary-alt));
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

.feature-icon::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.4), transparent);
    transition: left 0.6s;
}

.feature-icon:hover::before {
    left: 100%;
}

.feature-icon:hover {
    transform: translateY(-4px) scale(1.05);
    box-shadow: 0 8px 25px rgba(35, 135, 186, 0.3);
}

.feature-item {
    animation: bounceIn 0.6s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

/* Was gradient text; the class name is kept so the markup and the scripts that
   write it do not change (UI-13). It is plain heading text now. */
.gradient-text {
    color: #111827;
}

/* Modern button */
.modern-btn {
    background: linear-gradient(135deg, var(--color-primary), var(--color-primary-alt));
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

.modern-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(35, 135, 186, 0.3);
}

/* --------------------------------------------------------------------------
   AI floating button
   -------------------------------------------------------------------------- */

#ai-floating-button {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 1000;
    animation: slideInFromBottom 0.6s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

#ai-floating-button:hover {
    transform: scale(1.05);
}

#ai-floating-button button {
    transition: all 0.3s ease;
    box-shadow: 0 8px 32px rgba(13, 113, 160, 0.3);
    backdrop-filter: blur(10px);
}

#ai-floating-button button:hover {
    box-shadow: 0 12px 40px rgba(13, 113, 160, 0.4);
    transform: translateY(-2px);
}

#ai-floating-button button:active {
    transform: translateY(0px) scale(0.95);
}

#ai-help-bubble {
    max-width: 300px;
    z-index: 60;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(13, 113, 160, 0.1);
    cursor: pointer;
}

#ai-help-bubble:hover {
    transform: translateY(-2px);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
}

#ai-help-bubble.show {
    opacity: 1 !important;
    transform: translateY(0) !important;
}

#ai-floating-button .animate-ping {
    animation: aiPulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

/* --------------------------------------------------------------------------
   Filter bar
   -------------------------------------------------------------------------- */

.modern-filter-card {
    position: relative;
    overflow: hidden;
    animation: slideInUp 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

.modern-filter-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(35, 135, 186, 0.1), transparent);
    animation: shimmer-filter 3s infinite;
}

.filter-icon-wrapper {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    background: linear-gradient(135deg, var(--color-primary), var(--color-primary-alt));
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 15px rgba(35, 135, 186, 0.3);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

.filter-icon-wrapper::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    transform: translate(-50%, -50%) scale(0);
    transition: transform 0.6s ease;
}

.modern-filter-card:hover .filter-icon-wrapper::before {
    transform: translate(-50%, -50%) scale(2);
}

.filter-icon-wrapper:hover {
    transform: rotate(5deg) scale(1.05);
    box-shadow: 0 6px 20px rgba(35, 135, 186, 0.4);
}

.filter-select-wrapper {
    position: relative;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.filter-label {
    font-size: 0.75rem;
    font-weight: 600;
    color: #6b7280;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    display: flex;
    align-items: center;
    white-space: nowrap;
    margin: 0;
}

.modern-filter-select {
    padding: 12px 16px;
    border: 2px solid var(--color-border);
    border-radius: 10px;
    background: linear-gradient(to bottom, #ffffff, #f9fafb);
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--color-text-dark);
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%236366f1' d='M6 9L1 4h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    padding-right: 36px;
    min-width: 140px;
    height: 44px;
}

.modern-filter-select:hover {
    border-color: #c7ebff;
    background: linear-gradient(to bottom, #ffffff, #f5fbff);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(35, 135, 186, 0.1);
}

.modern-filter-select:focus {
    outline: none;
    border-color: var(--color-primary);
    box-shadow: 0 0 0 3px rgba(35, 135, 186, 0.1);
    background: #ffffff;
}

.modern-filter-button {
    padding: 12px 24px;
    background: linear-gradient(135deg, var(--color-primary), var(--color-primary-alt));
    color: white;
    font-weight: 600;
    font-size: 0.875rem;
    border-radius: 10px;
    border: none;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 4px 15px rgba(35, 135, 186, 0.3);
    position: relative;
    overflow: hidden;
    white-space: nowrap;
}

.modern-filter-button::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
    transition: left 0.5s;
}

.modern-filter-button:hover::before {
    left: 100%;
}

.modern-filter-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 25px rgba(35, 135, 186, 0.4);
}

.modern-filter-button:active {
    transform: translateY(0);
    box-shadow: 0 2px 10px rgba(35, 135, 186, 0.3);
}

/* --------------------------------------------------------------------------
   Conflict dialog
   -------------------------------------------------------------------------- */

#conflict-dialog,
#confirm-dialog {
    animation: fadeIn 0.2s ease-in-out;
}

/* --------------------------------------------------------------------------
   Conflict detection
   -------------------------------------------------------------------------- */

.conflict-shake {
    animation: conflict-shake 0.6s ease-in-out;
}

.conflict-indicator {
    position: absolute;
    top: 2px;
    right: 2px;
    background: var(--color-danger);
    border-radius: 50%;
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 100;
    animation: pulse 2s ease-in-out infinite;
}

/* Expert-search tip icon glow — purple drop-shadow matching the brand accent.
   Lives here instead of `style="filter:..."` in the template so the CSP can
   eventually tighten style-src 'self' without rewriting the markup. */
.tip-icon-glow {
    filter: drop-shadow(0 0 8px rgba(13, 113, 160, 0.6));
}

/* --------------------------------------------------------------------------
   Start card (Round B) — a student with no draft yet picks a campus and a
   term over the empty grid (templates/timetable/timetable.html,
   pages/timetable/draft-start.js). The live page only: the id exists nowhere
   else, so the share and print views that load this file never match.

   It sits in the grid's scroll container, beside #schTimes rather than
   inside it, so the mobile scale transform never shrinks it; below the
   sticky day-header row (30px, z 10) and over the grid lines. z 12 stays
   under every piece of page chrome (the mobile action bar is 40).
   -------------------------------------------------------------------------- */
#draft-start {
    position: absolute;
    top: 3.25rem;
    left: 50%;
    transform: translateX(-50%);
    z-index: 12;
    width: min(26rem, calc(100% - 2rem));
    padding: 1.25rem;
    border: 1px solid var(--color-border);
    border-radius: 1rem;
    background: white;
    box-shadow: 0 12px 32px rgba(15, 23, 42, 0.14);
}
/* The attribute has to win over the rule above: the page un-hides the card
   only once it knows there is no draft. */
#draft-start[hidden] {
    display: none;
}
.draft-start-title {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.35rem;
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--color-text-dark);
}
.draft-start-title i {
    color: var(--color-primary);
}
.draft-start-note {
    margin-bottom: 0.9rem;
    font-size: 0.8rem;
    line-height: 1.45;
    color: #6b7280;
}
/* The campus column gets the larger share: "North Lebanon Campus" is the
   longest option on the card, "Summer 2026" the longest term. */
.draft-start-fields {
    display: grid;
    grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr);
    gap: 0.75rem;
}
.draft-start-field {
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
    min-width: 0;
    font-size: 0.75rem;
    font-weight: 600;
    color: #4b5563;
}
.draft-start-select {
    width: 100%;
    padding: 0.45rem 0.6rem;
    border: 1px solid #d1d5db;
    border-radius: 0.5rem;
    background: white;
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--color-text-dark);
}
.draft-start-select:focus {
    outline: 2px solid var(--color-primary);
    outline-offset: 1px;
}
/* A phone is too narrow for two selects side by side ("North Lebanon
   Campus" would be cut); stack them. */
@media (max-width: 420px) {
    .draft-start-fields {
        grid-template-columns: 1fr;
    }
}

/* --------------------------------------------------------------------------
   Search filters (UI-18): the chips under the planner's search box.
   Days, time of day, open seats. Plain rules, not utilities, because the
   pressed state needs a dark row of its own (dark-mode.css) and a `dark:`
   variant loses to that file's rows. This is the strip as a phone shows it,
   inline under the box; desktop.css places it for the two desktop bands.
   -------------------------------------------------------------------------- */
/* Two rows at every width (UI-40): the days, then the time of day and Open
   seats. The rows stretch to the strip's width (the default `stretch`): a
   row sized to its content would grow past the strip instead of sliding. */
.search-filters {
    display: flex;
    flex-direction: column;
    gap: 0.375rem;
    /* Tucked under the box: the form above carries a 1rem bottom margin. */
    margin: -0.375rem 0 1rem;
    flex-shrink: 0;
}
.search-filters .sf-row {
    display: flex;
    flex-wrap: nowrap;
    align-items: center;
    gap: 0.375rem;
    min-width: 0;
}
/* Each row is one line (UI-35). Its chips sit in a scroller that slides
   sideways where they do not fit (a narrow phone, a large text size), with
   no scrollbar, and fades at an edge that has more past it
   (search-filters.js sets data-more). Clear ends the second row outside its
   scroller, so it is always in view. The 4px of padding keeps a chip's
   focus ring from being cut off by the overflow; the -4px margin gives the
   room back. */
.search-filters .sf-scroll {
    display: flex;
    align-items: center;
    gap: 0.375rem;
    flex: 0 1 auto;
    min-width: 0;
    overflow-x: auto;
    overflow-y: hidden;
    scrollbar-width: none;
    overscroll-behavior-x: contain;
    padding: 4px;
    margin: -4px;
}
.search-filters .sf-scroll::-webkit-scrollbar {
    display: none;
}
.search-filters .sf-scroll > * {
    flex-shrink: 0;
}
/* The fade is a mask: no colour, so the same rule serves the dark theme. */
.search-filters .sf-scroll[data-more="start"] {
    mask-image: linear-gradient(to left, #000 calc(100% - 2rem), transparent);
    -webkit-mask-image: linear-gradient(to left, #000 calc(100% - 2rem), transparent);
}
.search-filters .sf-scroll[data-more="end"] {
    mask-image: linear-gradient(to right, #000 calc(100% - 2rem), transparent);
    -webkit-mask-image: linear-gradient(to right, #000 calc(100% - 2rem), transparent);
}
.search-filters .sf-scroll[data-more="both"] {
    mask-image: linear-gradient(to right, transparent, #000 2rem, #000 calc(100% - 2rem), transparent);
    -webkit-mask-image: linear-gradient(to right, transparent, #000 2rem, #000 calc(100% - 2rem), transparent);
}
.search-filters .sf-days {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
}
.search-filters .sf-label {
    margin-right: 0.125rem;
    font-size: 0.75rem;
    font-weight: 600;
    color: #6b7280;
    white-space: nowrap;
}
.sf-chip {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    height: 2rem;
    padding: 0 0.625rem;
    border: 1px solid #d1d5db;
    border-radius: 9999px;
    background: #fff;
    color: #374151;
    font-size: 0.75rem;
    font-weight: 600;
    line-height: 1;
    white-space: nowrap;
    cursor: pointer;
    transition: background 0.15s, border-color 0.15s, color 0.15s;
}
.sf-chip:hover {
    border-color: #9ca3af;
}
.sf-chip:focus-visible {
    outline: 2px solid var(--color-primary);
    outline-offset: 2px;
}
.sf-chip.sf-day {
    min-width: 2rem;
    padding: 0 0.375rem;
}
/* On: ink, the colour of a chosen day in the custom-course form. */
.sf-chip[aria-pressed="true"],
.sf-select.is-set {
    background: #0b1f33;
    border-color: #0b1f33;
    color: #fff;
}
.sf-select {
    padding: 0 0.375rem 0 0.625rem;
    max-width: 100%;
}
/* The list the select opens is the browser's; keep it readable when the
   chip itself is filled. */
.sf-select option {
    background: #fff;
    color: #111827;
}
.sf-clear {
    display: inline-flex;
    align-items: center;
    height: 2rem;
    padding: 0 0.25rem;
    border: 0;
    background: none;
    color: #20719c;
    font-size: 0.75rem;
    font-weight: 600;
    cursor: pointer;
}
.sf-clear:hover {
    text-decoration: underline;
}
.sf-clear:focus-visible {
    outline: 2px solid var(--color-primary);
    outline-offset: 2px;
    border-radius: 0.25rem;
}
/* `hidden` must win over the display set above. */
.sf-clear[hidden],
.sf-count[hidden] {
    display: none;
}
/* The Filters button belongs to the narrow desktop band alone (desktop.css
   shows it there). */
.search-filters-btn {
    display: none;
}
