/* Reset and base styles */
*, *::before, *::after {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    font-size: 16px;
    line-height: 1.5;
    color: #2d3538;
    background-color: #f0f0f0;
}

a {
    color: #5a7d8a;
    text-decoration: none;
}

a:hover {
    text-decoration: underline;
}

/* Layout */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1rem;
}

/* Header */
.site-header {
    background-color: #5a7d8a;
    color: white;
    padding: 1rem 0;
}

.page-title {
    font-size: 1.4rem;
    margin: 1rem 0 0.75rem;
    color: #2d3e44;
}

.site-header .site-brand {
    margin: 0;
    font-size: 1.5rem;
    font-weight: bold;
    display: flex;
    align-items: center;
    gap: 1rem;
    flex-wrap: wrap;
    min-width: 0;
}

.header-logo-link {
    display: inline-flex;
    align-items: center;
    min-width: 0;
    flex-shrink: 1;
}

.header-logo {
    display: block;
    max-height: 5rem;
    height: auto;
    width: auto;
    max-width: 100%;
}

.header-tagline {
    font-weight: normal;
    font-size: clamp(0.7rem, 2.8vw, 1rem);
    opacity: 0.9;
}

.header-tagline-link {
    text-decoration: underline;
    text-underline-offset: 2px;
}

.header-tagline-link:hover {
    text-decoration: underline;
    opacity: 0.8;
}

.site-header a {
    color: white;
}

.site-header a:hover {
    text-decoration: none;
    opacity: 0.9;
}

.header-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.header-auth {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 0.9rem;
    flex-shrink: 0;
}

.header-user {
    opacity: 0.85;
}

.header-auth-link {
    padding: 0.3rem 0.75rem;
    border: 1px solid rgba(255, 255, 255, 0.5);
    border-radius: 4px;
    font-size: 0.85rem;
}

.header-auth-link:hover {
    background-color: rgba(255, 255, 255, 0.1);
}

/* Footer */
.site-footer {
    background-color: #2d3538;
    color: #9aa4a8;
    padding: 1rem 0;
    margin-top: 2rem;
    font-size: 0.875rem;
}

.site-footer p {
    margin: 0;
}

/* Buttons */
.btn {
    display: inline-block;
    padding: 0.5rem 1rem;
    border: none;
    border-radius: 8px;
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    text-decoration: none;
    background-color: #e2e8ea;
    color: #2d3538;
}

.btn:hover {
    background-color: #c8d2d5;
    text-decoration: none;
}

.btn-primary {
    background-color: #5a7d8a;
    color: white;
}

.btn-primary:hover {
    background-color: #4a6d7a;
}

.btn-enroll {
    background-color: #3a8a6a;
    color: white;
}

.btn-enroll:hover {
    background-color: #2e7a5a;
}

.btn-waitlist {
    background-color: #d4940e;
    color: white;
}

.btn-waitlist:hover {
    background-color: #b87e0c;
}

/* ── Compact sticky filter bar ─────────────────────────────────────────── */
.filterbar {
    position: sticky;
    top: 0;
    z-index: 20;
    background: rgba(255, 255, 255, 0.96);
    backdrop-filter: saturate(140%) blur(6px);
    border: 1px solid #dce4e6;
    border-radius: 12px;
    padding: 0.6rem 0.8rem;
    margin: 1rem 0 0.75rem;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
}

.filterbar-row {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    align-items: center;
}

.filterbar-search {
    flex: 1 1 240px;
    min-width: 220px;
    position: relative;
}

.filterbar-search::before {
    content: "🔍";
    position: absolute;
    left: 0.6rem;
    top: 50%;
    transform: translateY(-50%);
    font-size: 0.85rem;
    opacity: 0.6;
    pointer-events: none;
}

.filterbar-search input {
    width: 100%;
    padding: 0.5rem 0.75rem 0.5rem 2rem;
    border: 1px solid #b8c2c5;
    border-radius: 8px;
    font-size: 0.9rem;
}

.filterbar-pop {
    position: relative;
}

.filterbar-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.4rem 0.75rem;
    border: 1px solid #b8c2c5;
    background: #fff;
    border-radius: 999px;
    font-size: 0.85rem;
    cursor: pointer;
    color: #4d5a5e;
    list-style: none;
    user-select: none;
}

.filterbar-chip::-webkit-details-marker {
    display: none;
}

.filterbar-chip:hover {
    background: #eef3f4;
}

.filterbar-chip--active {
    background: #5a7d8a;
    color: #fff;
    border-color: #5a7d8a;
}

.filterbar-chip-count {
    background: rgba(255, 255, 255, 0.3);
    padding: 0 0.4rem;
    border-radius: 999px;
    font-size: 0.7rem;
    font-weight: 600;
    line-height: 1.4;
}

.filterbar-popover {
    position: absolute;
    top: calc(100% + 0.4rem);
    left: 0;
    z-index: 30;
    background: #fff;
    border: 1px solid #dce4e6;
    border-radius: 10px;
    box-shadow: 0 6px 24px rgba(0, 0, 0, 0.15);
    padding: 0.75rem;
    min-width: 240px;
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
}

.filterbar-popover--list {
    max-height: 320px;
    overflow-y: auto;
}

.filterbar-popover-row {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.85rem;
    color: #4d5a5e;
}

.filterbar-popover-row span {
    min-width: 3rem;
}

.filterbar-popover-row input[type="date"],
.filterbar-popover-row input[type="number"] {
    flex: 1;
    padding: 0.35rem 0.5rem;
    border: 1px solid #b8c2c5;
    border-radius: 6px;
    font-size: 0.85rem;
}

.filterbar-popover-row input[type="number"] {
    width: 6rem;
}

/* "When" chip popover: stacked sections with paired inputs */
.filterbar-popover--when {
    min-width: 280px;
    gap: 0.75rem;
}

.filterbar-popover-section {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}

.filterbar-popover-label {
    font-size: 0.75rem;
    font-weight: 600;
    color: #4d5a5e;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.filterbar-popover-pair {
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

.filterbar-popover-pair input {
    flex: 1;
    min-width: 0;
    padding: 0.35rem 0.5rem;
    border: 1px solid #b8c2c5;
    border-radius: 6px;
    font-size: 0.85rem;
}

.filterbar-popover-sep {
    font-size: 0.78rem;
    color: #7a878a;
}

.filterbar-day-grid {
    display: grid;
    grid-template-columns: repeat(7, minmax(0, 1fr));
    gap: 0.25rem;
}

.filterbar-day {
    position: relative;
    cursor: pointer;
    user-select: none;
}

.filterbar-day input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.filterbar-day span {
    display: block;
    text-align: center;
    padding: 0.3rem 0;
    border: 1px solid #b8c2c5;
    border-radius: 6px;
    font-size: 0.75rem;
    color: #4d5a5e;
    background: #fff;
}

.filterbar-day:hover span {
    background: #eef3f4;
}

.filterbar-day input:checked + span {
    background: #5a7d8a;
    border-color: #5a7d8a;
    color: #fff;
}

.filterbar-day input:focus-visible + span {
    outline: 2px solid #5a7d8a;
    outline-offset: 1px;
}

.filterbar-check {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.2rem 0.25rem;
    cursor: pointer;
    font-size: 0.85rem;
    color: #2d3538;
    border-radius: 4px;
}

.filterbar-check:hover {
    background: #eef3f4;
}

.filterbar-toggle {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.4rem 0.75rem;
    border: 1px solid #b8c2c5;
    background: #fff;
    border-radius: 999px;
    font-size: 0.85rem;
    cursor: pointer;
    color: #4d5a5e;
    user-select: none;
}

.filterbar-toggle input {
    margin: 0;
}

.filterbar-toggle:has(input:checked) {
    background: #5a7d8a;
    color: #fff;
    border-color: #5a7d8a;
}

.filterbar-toggle--disabled {
    opacity: 0.55;
    cursor: not-allowed;
}

.filterbar-submit {
    margin-left: auto;
}

.filterbar-active {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
    align-items: center;
    margin-top: 0.5rem;
    padding-top: 0.5rem;
    border-top: 1px dashed #dce4e6;
}

.filterbar-active-label {
    font-size: 0.78rem;
    color: #7a878a;
}

.filterbar-tag {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    background: #eef3f4;
    color: #3a5a65;
    padding: 0.2rem 0.35rem 0.2rem 0.6rem;
    border-radius: 999px;
    font-size: 0.78rem;
}

.filterbar-tag-x {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1.05rem;
    height: 1.05rem;
    padding: 0;
    margin-left: 0.15rem;
    border: none;
    border-radius: 50%;
    background: transparent;
    color: #6a7a80;
    font-size: 0.95rem;
    line-height: 1;
    cursor: pointer;
}

.filterbar-tag-x:hover {
    background: #d6e0e3;
    color: #2d3538;
}

.filterbar-tag-x:focus-visible {
    outline: 2px solid #5a7d8a;
    outline-offset: 1px;
}

.filterbar-clear {
    background: none;
    border: none;
    color: #5a7d8a;
    font-size: 0.78rem;
    cursor: pointer;
    padding: 0.2rem 0.4rem;
    text-decoration: none;
}

.filterbar-clear:hover {
    text-decoration: underline;
}

/* Results */
.results {
    margin-top: 1rem;
}

.results-header {
    margin-bottom: 1rem;
}

.results-count {
    margin: 0;
    color: #5d6a6e;
    font-size: 0.875rem;
}

/* Activity grid */
.activity-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 0.85rem;
}

/* ── Activity card ───────────────────────────────────────────────────── */
.act-card {
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 1px 6px rgba(0, 0, 0, 0.08);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    position: relative;
    transition: box-shadow 0.15s, transform 0.15s;
}

.act-card:hover {
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12);
    transform: translateY(-1px);
}

.act-card-stripe {
    height: 4px;
    background: var(--code-color, #6b7d83);
}

.act-card-heart {
    position: absolute;
    top: 0.55rem;
    right: 0.55rem;
    width: 30px;
    height: 30px;
    border: none;
    background: rgba(255, 255, 255, 0.95);
    border-radius: 50%;
    cursor: pointer;
    font-size: 1rem;
    color: #aab4b8;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    padding: 0;
}

.act-card-heart:hover {
    color: #e74c3c;
}

.act-card-heart.wishlisted {
    color: #e74c3c;
}

.act-card-heart:disabled {
    color: #d5dde0;
    cursor: not-allowed;
}

.act-card-body {
    padding: 0.85rem 1rem 0.95rem;
    display: flex;
    flex-direction: column;
    gap: 0.45rem;
    flex: 1;
}

.act-card-code {
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-weight: 700;
    color: var(--code-color, #6b7d83);
}

.act-card-title {
    margin: 0;
    font-size: 1rem;
    line-height: 1.3;
    font-weight: 600;
    color: #2d3538;
    padding-right: 2rem; /* leave room for heart */
}

.act-card-title a {
    color: #2d3538;
    text-decoration: none;
}

.act-card-title a:hover {
    color: #3a5a65;
    text-decoration: underline;
}

.act-card-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
    font-size: 0.78rem;
    color: #4d5a5e;
}

.act-card-pill {
    background: #eef3f4;
    padding: 0.15rem 0.5rem;
    border-radius: 4px;
}

.act-card-when-time {
    font-size: 0.85rem;
    font-weight: 600;
    color: #2d3538;
}

.act-card-when-range {
    color: #7a878a;
    font-size: 0.78rem;
}

.act-card-where {
    font-size: 0.8rem;
    color: #4d5a5e;
}

.act-card-where::before {
    content: "📍 ";
    opacity: 0.7;
}

.act-card-avail {
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
    margin-top: 0.1rem;
}

.act-card-avail-bar {
    height: 6px;
    background: #e7ecee;
    border-radius: 3px;
    overflow: hidden;
}

.act-card-avail-fill {
    height: 100%;
    border-radius: 3px;
    background: #3a8a6a;
}

.act-card-avail-bar[data-state="low"] .act-card-avail-fill {
    background: #d4940e;
}

.act-card-avail-bar[data-state="full"] .act-card-avail-fill {
    background: #e74c3c;
}

.act-card-avail-text {
    font-size: 0.74rem;
    color: #7a878a;
}

.act-card-avail-text strong {
    color: #2d3538;
}

.act-card-avail-bar[data-state="full"] + .act-card-avail-text strong {
    color: #e74c3c;
}

.act-card-foot {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    padding: 0.6rem 1rem 0.85rem;
    border-top: 1px solid #dce4e6;
    background: #f6f9fa;
}

.act-card-price {
    display: flex;
    flex-direction: column;
    line-height: 1.2;
}

.act-card-price-big {
    font-size: 1.05rem;
    font-weight: 700;
    color: #3a8a6a;
}

.act-card-price-sub {
    font-size: 0.7rem;
    color: #8a9498;
}

.act-card-foot .btn {
    padding: 0.4rem 0.85rem;
    font-size: 0.8rem;
    white-space: nowrap;
    flex-shrink: 0;
}

.act-card-closed,
.detail-closed {
    font-size: 0.72rem;
    line-height: 1.3;
    color: #7a878a;
    background: #eef3f4;
    padding: 0.3rem 0.55rem;
    border-radius: 6px;
}

.act-card-closed {
    text-align: right;
    max-width: 60%;
}

.detail-closed {
    flex: 1 1 0;
    text-align: center;
    font-size: 0.85rem;
    padding: 0.55rem 0.75rem;
}

/* ── Detail page ─────────────────────────────────────────── */

.detail-page {
    max-width: 800px;
    margin: 0 auto;
    padding: 1.5rem 0 3rem;
}

.detail-card {
    background: white;
    border-radius: 12px;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.12);
    padding: 1.75rem 2rem 2rem;
}

.detail-nav {
    margin-bottom: 1.5rem;
}

.btn-back {
    background-color: transparent;
    border: 1px solid #b8c2c5;
    color: #4d5a5e;
    padding: 0.4rem 0.9rem;
    font-size: 0.875rem;
}

.btn-back:hover {
    background-color: #edf2f3;
    border-color: #9aa4a8;
}

.detail-header {
    margin-bottom: 1rem;
    padding-bottom: 1rem;
    border-bottom: 2px solid #d5dde0;
}

.detail-title {
    margin: 0 0 0.75rem;
    font-size: 1.75rem;
    line-height: 1.2;
    color: #3a5a65;
}

.detail-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.detail-badge {
    display: inline-block;
    padding: 0.2rem 0.6rem;
    background-color: #eef3f4;
    color: #3a5a65;
    border-radius: 3px;
    font-size: 0.8rem;
    font-weight: 500;
}

.detail-body {
    display: flex;
    flex-direction: column;
    gap: 0;
}

.detail-section {
    padding: 1.25rem 0;
    border-bottom: 1px solid #dce4e6;
}

.detail-section:last-child {
    border-bottom: none;
}

.detail-section h2 {
    margin: 0 0 0.75rem;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    color: #7a878a;
    font-weight: 600;
}

.detail-section p {
    margin: 0 0 0.4rem;
    color: #2d3538;
}

.detail-dates {
    font-size: 1rem;
    font-weight: 500;
    color: #2d3538;
}

.detail-subcategory {
    color: #5d6a6e;
}

.detail-patterns {
    margin-top: 0.5rem;
}

.detail-patterns .schedule-item {
    padding: 0.2rem 0;
}

/* Registration dates */
.reg-row {
    display: flex;
    gap: 1rem;
    padding: 0.25rem 0;
    font-size: 0.9rem;
    align-items: baseline;
}

.reg-label {
    color: #5d6a6e;
    min-width: 200px;
    flex-shrink: 0;
}

.reg-value {
    color: #2d3538;
    font-weight: 500;
}

/* Image gallery */
.detail-gallery {
    display: flex;
    gap: 0.75rem;
    overflow-x: auto;
    padding-bottom: 0.5rem;
    margin-bottom: 1.5rem;
    -webkit-overflow-scrolling: touch;
}

.detail-gallery-img {
    height: 200px;
    width: auto;
    border-radius: 6px;
    object-fit: cover;
    flex-shrink: 0;
}

/* Space availability badge */
.space-badge {
    display: inline-block;
    padding: 0.2rem 0.6rem;
    background-color: #eef3f4;
    color: #3a8a6a;
    border-radius: 3px;
    font-size: 0.8rem;
    font-weight: 500;
}

/* Quick facts */
.detail-quickfacts {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.quickfact-chip {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.3rem 0.7rem;
    background-color: #edf2f3;
    border-radius: 4px;
    font-size: 0.85rem;
}

.quickfact-chip--highlight {
    background-color: #eef3f4;
    color: #3a8a6a;
}

.quickfact-label {
    color: #7a878a;
    font-weight: 500;
}

.quickfact-value {
    color: #2d3538;
}

/* Facilities */
.detail-facility {
    color: #2d3538;
    font-size: 0.95rem;
}

/* Center address block */
.detail-center {
    margin-top: 0.5rem;
    padding: 0.75rem;
    background-color: #f0f4f5;
    border-radius: 6px;
}

.detail-center + .detail-center {
    margin-top: 0.5rem;
}

.detail-center-name {
    font-weight: 600;
    color: #2d3538;
    margin: 0 0 0.25rem;
}

.detail-center-address {
    color: #4d5a5e;
    font-size: 0.9rem;
    margin: 0 0 0.25rem;
    line-height: 1.5;
}

.detail-center-phone {
    font-size: 0.9rem;
    margin: 0 0 0.25rem;
}

.detail-map-link {
    font-size: 0.85rem;
    font-weight: 500;
}

.detail-location-note {
    color: #5d6a6e;
    font-size: 0.9rem;
    margin-top: 0.5rem;
}

/* Description sub-sections */
.detail-description--secondary {
    margin-top: 1rem;
    padding-top: 0.75rem;
    border-top: 1px dashed #d5dde0;
}

.detail-desc-subhead {
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #8a9498;
    font-weight: 600;
    margin: 0 0 0.5rem;
}

/* Pricing */
.price-item {
    display: flex;
    align-items: baseline;
    gap: 0.75rem;
    padding: 0.3rem 0;
    font-size: 0.95rem;
}

.price-amount {
    font-size: 1.1rem;
    font-weight: 600;
    color: #3a8a6a;
    min-width: 80px;
}

.price-desc {
    color: #4d5a5e;
}

.price-free {
    font-size: 1rem;
    font-weight: 600;
    color: #3a8a6a;
}

.price-unavailable {
    color: #7a878a;
    font-style: italic;
}

/* Instructors */
.instructor {
    padding: 0.5rem 0;
}

.instructor + .instructor {
    border-top: 1px solid #e8eef0;
}

.instructor-name {
    font-weight: 600;
    color: #2d3538;
    margin: 0 0 0.25rem;
}

.instructor-primary {
    font-weight: 400;
    color: #7a878a;
    font-size: 0.85rem;
}

.instructor-bio {
    color: #4d5a5e;
    font-size: 0.9rem;
    margin: 0.25rem 0 0;
}

.instructor-email {
    font-size: 0.875rem;
    margin: 0.2rem 0 0;
}

/* Description */
.detail-description {
    font-size: 0.95rem;
    line-height: 1.7;
    color: #2d3538;
}

.detail-description p {
    margin: 0 0 0.75rem;
}

.detail-description ul,
.detail-description ol {
    margin: 0 0 0.75rem;
    padding-left: 1.5rem;
}

/* Enroll button */
.detail-actions {
    display: flex;
    gap: 0.5rem;
    margin-top: 2rem;
    padding-top: 1.5rem;
    border-top: 1px solid #dce4e6;
}

.detail-actions .btn {
    flex: 1 1 0;
    text-align: center;
}

/* Pagination */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 1rem;
    margin-top: 2rem;
    padding: 1rem 0;
}

.pagination-info {
    color: #5d6a6e;
    font-size: 0.875rem;
}

/* Responsive */
@media (max-width: 768px) {
    .filter-row {
        flex-direction: column;
    }
    
    .filter-group {
        width: 100%;
    }
    
    .activity-grid {
        grid-template-columns: 1fr;
    }
}

/* ── Results header with view toggle ────────────────────────────────────── */

.results-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 0.75rem;
    margin-bottom: 1rem;
}

.results-header-left {
    flex: 1 1 auto;
}

/* View toggle */
.view-toggle {
    display: flex;
    border: 1px solid #b8c2c5;
    border-radius: 6px;
    overflow: hidden;
    flex-shrink: 0;
}

.view-toggle-btn {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.4rem 0.9rem;
    border: none;
    background: white;
    color: #4d5a5e;
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    line-height: 1.4;
    transition: background 0.15s, color 0.15s;
}

.view-toggle-btn + .view-toggle-btn {
    border-left: 1px solid #b8c2c5;
}

.view-toggle-btn:hover {
    background: #e8eef0;
    color: #2d3538;
}

.view-toggle-btn.active {
    background: #5a7d8a;
    color: white;
}

/* ── Calendar ────────────────────────────────────────────────────────────── */

.calendar {
    margin-top: 0.5rem;
}

.cal-no-events {
    color: #5d6a6e;
    font-size: 0.9rem;
    padding: 2rem 0;
}

/* Month section */
.cal-month {
    margin-bottom: 2.5rem;
}

.cal-month-title {
    font-size: 1.25rem;
    font-weight: 700;
    color: #3a5a65;
    margin: 0 0 0.75rem;
    padding-bottom: 0.4rem;
    border-bottom: 2px solid #c5d3d5;
}

/* Calendar grid */
.cal-grid {
    border: 1px solid #c8d2d5;
    border-radius: 6px;
    overflow: hidden;
    background: white;
    width: 100%;
}

.cal-header-row,
.cal-week-row {
    display: grid;
    grid-template-columns: repeat(7, minmax(0, 1fr));
}

.cal-header-row {
    background-color: #5a7d8a;
}

.cal-header-cell {
    padding: 0.4rem 0.5rem;
    min-width: 0;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: rgba(255, 255, 255, 0.85);
    text-align: center;
}

/* Day cells */
.cal-week-row + .cal-week-row {
    border-top: 1px solid #d5dde0;
}

.cal-day {
    min-height: 5.5rem;
    min-width: 0;
    padding: 0.3rem 0.4rem 0.4rem;
    vertical-align: top;
    border-right: 1px solid #d5dde0;
    position: relative;
    overflow: hidden;
}

.cal-day:last-child {
    border-right: none;
}

/* Days outside the current month */
.cal-day--out {
    background-color: #f2f5f6;
}

/* Today */
.cal-day--today {
    background-color: #eef3f4;
}

.cal-day-num {
    display: inline-block;
    font-size: 0.8rem;
    font-weight: 500;
    color: #4d5a5e;
    line-height: 1.6rem;
    width: 1.6rem;
    text-align: center;
    border-radius: 50%;
}

.cal-day-num--today {
    background-color: #5a7d8a;
    color: white;
}

/* Events list inside a day cell */
.cal-events-list {
    list-style: none;
    margin: 0.2rem 0 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

/* Event pill button */
.cal-event-pill {
    display: block;
    width: 100%;
    padding: 2px 5px;
    border: none;
    border-radius: 3px;
    cursor: pointer;
    text-align: left;
    color: white;
    line-height: 1.3;
    font-family: inherit;
    transition: filter 0.1s;
}

.cal-event-pill:hover {
    filter: brightness(1.15);
}

.cal-event-pill:focus-visible {
    outline: 2px solid #5a7d8a;
    outline-offset: 1px;
}

.cal-event-name {
    display: block;
    font-size: 0.7rem;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.cal-event-time {
    display: block;
    font-size: 0.65rem;
    opacity: 0.9;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* ── Event popup ─────────────────────────────────────────────────────────── */

.cal-popup-backdrop {
    position: fixed;
    inset: 0;
    background: transparent;
    z-index: 99;
}

.cal-popup {
    position: fixed;
    z-index: 100;
    border-radius: 12px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.22);
    width: 300px;
    max-width: calc(100vw - 2rem);
}

.cal-popup[hidden] {
    display: none;
}

.cal-popup-backdrop[hidden] {
    display: none;
}

.cal-popup .act-card {
    box-shadow: none;
    border-radius: 12px;
}

.cal-popup .act-card:hover {
    transform: none;
    box-shadow: none;
}

.cal-popup-close {
    position: absolute;
    top: -14px;
    right: -14px;
    background: #fff;
    border: none;
    font-size: 1rem;
    line-height: 1;
    cursor: pointer;
    color: #4d5a5e;
    padding: 0;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    z-index: 3;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.18);
}

.cal-popup-close:hover {
    color: #2d3538;
}

.wishlist-btn {
    color: #7a878a;
    min-width: 7em;
    text-align: center;
}

.wishlist-btn--icon {
    min-width: 0;
}

.wishlist-btn:hover {
    color: #e74c3c;
    background-color: #fef0ef;
}

.wishlist-btn.wishlisted {
    color: #e74c3c;
    background-color: #fef0ef;
}

.wishlist-btn:disabled {
    color: #b8c2c5;
    cursor: not-allowed;
    background-color: #edf2f3;
}

/* ── Responsive adjustments for calendar ─────────────────────────────────── */

@media (max-width: 768px) {
    .cal-day {
        min-height: 3.5rem;
        padding: 0.2rem 0.2rem 0.3rem;
    }

    .cal-day-num {
        font-size: 0.7rem;
        width: 1.3rem;
        line-height: 1.3rem;
    }

    .cal-header-cell {
        font-size: 0.65rem;
        padding: 0.3rem 0.1rem;
    }

    .cal-event-name {
        font-size: 0.6rem;
    }

    .cal-event-time {
        display: none;
    }
}

/* Login page */
.login-section {
    display: flex;
    justify-content: center;
    padding: 3rem 0;
}

.login-card {
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.12);
    padding: 2rem 2.5rem;
    width: 100%;
    max-width: 420px;
}

.login-card h2 {
    margin: 0 0 0.25rem;
    font-size: 1.5rem;
    color: #3a5a65;
}

.login-subtitle {
    margin: 0 0 1.5rem;
    color: #5d6a6e;
    font-size: 0.9rem;
}

.login-error {
    background-color: #fdecea;
    color: #b71c1c;
    border: 1px solid #f5c6cb;
    border-radius: 4px;
    padding: 0.75rem 1rem;
    margin-bottom: 1rem;
    font-size: 0.9rem;
}

.login-form {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.login-field label {
    display: block;
    margin-bottom: 0.25rem;
    font-weight: 500;
    font-size: 0.9rem;
    color: #2d3538;
}

.login-field input {
    width: 100%;
    padding: 0.6rem 0.75rem;
    border: 1px solid #b8c2c5;
    border-radius: 4px;
    font-size: 1rem;
}

.login-field input:focus {
    outline: none;
    border-color: #5a7d8a;
    box-shadow: 0 0 0 2px rgba(90, 125, 138, 0.2);
}

.login-submit {
    margin-top: 0.5rem;
    width: 100%;
    padding: 0.7rem;
    font-size: 1rem;
}

.login-note {
    margin: 1.25rem 0 0;
    font-size: 0.8rem;
    color: #7a878a;
    text-align: center;
}
