/* Extracted from templates/communities/community_calendar_embed.html (Phase 3.1). Page-local styles; global rules belong in the design system sheets. */
    /* ── Reset / Base ── */
    *, *::before, *::after { box-sizing: border-box; }
    :root {
      --primary: var(--primary);
      --primary-dark: var(--primary-dark);
      --mint: var(--mint);
      --mint-rgb: 117, 201, 167;
      --t-text: #111827;
      --t-text-muted: #6b7280;
      --t-text-secondary: #4b5563;
      --t-border: #e5e7eb;
      --t-surface: #fff;
      --t-bg: #fff;
      --t-hover-bg: #f3f4f6;
      --danger: var(--danger);
      --warning: var(--warning);
      --info: var(--info);
    }
    body {
      margin: 0; padding: 0;
      font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
      color: var(--t-text); background: #fff;
      -webkit-font-smoothing: antialiased;
    }
    .d-none { display: none !important; }
    .embed-wrap {
      max-width: 100%; padding: 0.75rem;
      display: flex; flex-direction: column;
    }
    /* No min-height/flex:1 here on purpose: this page is always iframed, and
       a 100vh wrap would stretch to the iframe's fixed height, pinning the
       footer to the bottom and leaving blank space on short months. Letting
       the wrap collapse to its content height also lets the postMessage
       auto-resize below report an accurate height so the iframe fits exactly. */
    .embed-calendar-area { flex: 0 0 auto; }

    /* ── Legend dots ── */
    .cp-cal-dot--league { background: var(--green); }
    .cp-cal-dot--ladder { background: var(--danger); }
    .cp-cal-dot--tournament { background: var(--info); }
    .cp-cal-dot--program { background: #a855f7; }
    .cp-cal-dot--openplay { background: var(--warning); }

    /* ── Filter legend ── */
    .cal-legend {
      display: flex; flex-wrap: wrap; gap: 0.5rem;
      margin-bottom: 1rem; padding: 0.25rem 0;
    }
    .cal-legend-btn {
      display: inline-flex; align-items: center; gap: 0.4rem;
      padding: 0.4rem 0.85rem; border-radius: 999px;
      font-size: 0.78rem; font-weight: 600;
      border: 1.5px solid #e5e7eb; background: #fff;
      color: #6b7280; cursor: pointer;
      transition: all 0.2s ease;
      -webkit-tap-highlight-color: transparent;
    }
    .cal-legend-btn:hover { border-color: #d1d5db; background: #f9fafb; }
    .cal-legend-btn--active { border-color: var(--primary); color: var(--primary); background: rgba(29,64,81,0.04); }
    .cal-legend-btn--active:hover { background: rgba(29,64,81,0.08); }
    .cal-legend-dot {
      width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0;
      transition: transform 0.15s;
    }
    .cal-legend-dot--all {
      width: 10px; height: 10px;
      background: conic-gradient(var(--green) 0deg 90deg, var(--info) 90deg 180deg, #a855f7 180deg 270deg, #f97316 270deg 360deg);
    }
    .cal-legend-btn:not(.cal-legend-btn--active) .cal-legend-dot { transform: scale(0.7); opacity: 0.4; }

    /* ── Loading Shimmer ── */
    .community-calendar-loading { padding: 0; }
    .cal-loading-shimmer { padding: 1rem 0; }
    .cal-shimmer-bar {
      height: 2.5rem; border-radius: 8px; margin-bottom: 1rem;
      background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
      background-size: 200% 100%;
      animation: shimmer 1.5s infinite ease-in-out;
    }
    .cal-shimmer-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; }
    .cal-shimmer-cell {
      height: 4.5rem; border-radius: 6px;
      background: linear-gradient(90deg, #f5f5f5 25%, #ebebeb 50%, #f5f5f5 75%);
      background-size: 200% 100%;
      animation: shimmer 1.5s infinite ease-in-out;
    }
    .cal-shimmer-cell:nth-child(2) { animation-delay: 0.1s; }
    .cal-shimmer-cell:nth-child(3) { animation-delay: 0.2s; }
    .cal-shimmer-cell:nth-child(4) { animation-delay: 0.3s; }
    .cal-shimmer-cell:nth-child(5) { animation-delay: 0.4s; }
    .cal-shimmer-cell:nth-child(6) { animation-delay: 0.5s; }
    .cal-shimmer-cell:nth-child(7) { animation-delay: 0.6s; }
    @keyframes shimmer { 0% { background-position: 200% 0; } 100% { background-position: -200% 0; } }

    /* ── FullCalendar Base ── */
    .community-calendar-wrap {
      --fc-border-color: #e5e7eb;
      --fc-page-bg-color: transparent;
      --fc-neutral-bg-color: #f9fafb;
      --fc-today-bg-color: rgba(117,201,167,0.08);
      --fc-event-border-color: transparent;
      --fc-more-link-bg-color: transparent;
      --fc-more-link-text-color: var(--mint);
      --fc-list-event-hover-bg-color: rgba(117,201,167,0.06);
      border-radius: 12px; overflow: hidden;
    }

    /* ── Filter hide classes ── */
    .cal-hide-league .fc-event[data-event-type="league"],
    .cal-hide-ladder .fc-event[data-event-type="ladder"],
    .cal-hide-tournament .fc-event[data-event-type="tournament"],
    .cal-hide-program .fc-event[data-event-type="program"],
    .cal-hide-openplay .fc-event[data-event-type="openplay"],
    .cal-hide-league tr.fc-event[data-event-type="league"],
    .cal-hide-ladder tr.fc-event[data-event-type="ladder"],
    .cal-hide-tournament tr.fc-event[data-event-type="tournament"],
    .cal-hide-program tr.fc-event[data-event-type="program"],
    .cal-hide-openplay tr.fc-event[data-event-type="openplay"] {
      display: none !important;
    }

    /* ── Toolbar ── */
    .community-calendar-wrap .fc-toolbar {
      padding: 0.5rem 0 0.75rem; gap: 0.5rem; flex-wrap: wrap;
    }
    .community-calendar-wrap .fc-toolbar-title {
      font-size: 1.2rem !important; font-weight: 800 !important;
      color: var(--primary) !important; letter-spacing: -0.01em;
    }
    .community-calendar-wrap .fc-button {
      background: #fff !important; border: 1.5px solid #e5e7eb !important;
      color: #374151 !important; font-size: 0.8rem !important;
      font-weight: 600 !important; padding: 0.4rem 0.85rem !important;
      border-radius: 8px !important; transition: all 0.15s ease;
      box-shadow: none !important; text-transform: capitalize; min-height: 36px;
    }
    .community-calendar-wrap .fc-button:hover {
      background: #f3f4f6 !important; color: #111827 !important; border-color: #d1d5db !important;
    }
    .community-calendar-wrap .fc-button:focus { box-shadow: 0 0 0 2px rgba(117,201,167,0.3) !important; }
    .community-calendar-wrap .fc-button-active,
    .community-calendar-wrap .fc-button.fc-button-active {
      background: var(--primary) !important; border-color: var(--primary) !important; color: #fff !important;
    }
    .community-calendar-wrap .fc-button-group { border-radius: 8px; overflow: hidden; }
    .community-calendar-wrap .fc-button-group .fc-button { border-radius: 0 !important; }
    .community-calendar-wrap .fc-button-group .fc-button:first-child { border-radius: 8px 0 0 8px !important; }
    .community-calendar-wrap .fc-button-group .fc-button:last-child { border-radius: 0 8px 8px 0 !important; }
    .community-calendar-wrap .fc-today-button { border-radius: 8px !important; }
    .community-calendar-wrap .fc-prev-button,
    .community-calendar-wrap .fc-next-button { padding: 0.4rem 0.55rem !important; min-width: 36px; }

    /* ── Column Headers ── */
    .community-calendar-wrap .fc-col-header { background: #f8fafc; }
    .community-calendar-wrap .fc-col-header-cell { padding: 0.65rem 0; border-bottom: 2px solid #e5e7eb; }
    .community-calendar-wrap .fc-col-header-cell-cushion {
      font-size: 0.72rem; font-weight: 700; text-transform: uppercase;
      letter-spacing: 0.06em; color: #9ca3af; text-decoration: none !important;
    }

    /* ── Day Cells ── */
    .community-calendar-wrap .fc-daygrid-day { min-height: 5.5rem; transition: background 0.15s; }
    .community-calendar-wrap .fc-daygrid-day:hover { background: #f9fafb; }
    .community-calendar-wrap .fc-daygrid-day-number {
      font-size: 0.82rem; font-weight: 600; color: #6b7280; padding: 0.4rem 0.55rem;
      text-decoration: none !important;
    }
    .community-calendar-wrap .fc-day-today .fc-daygrid-day-number {
      background: var(--primary); color: #fff; border-radius: 50%;
      width: 1.75rem; height: 1.75rem; display: flex; align-items: center;
      justify-content: center; margin: 0.25rem 0.35rem; padding: 0; font-weight: 700;
    }
    .community-calendar-wrap .fc-day-other .fc-daygrid-day-number { color: #d1d5db; }

    /* ── Events (month grid — CourtReserve-style cards) ── */
    .community-calendar-wrap .fc-daygrid-event {
      border: none !important; border-radius: 8px !important;
      padding: 0 !important; margin: 0 3px 4px !important;
      cursor: pointer; background: transparent !important;
      overflow: hidden; white-space: normal !important;
    }
    .community-calendar-wrap .fc-daygrid-event:hover { background: transparent !important; }
    .community-calendar-wrap .fc-daygrid-event-dot { display: none; }
    .community-calendar-wrap .fc-daygrid-event-harness { margin: 0 !important; }

    /* Colored event card */
    .cr-card {
      border-radius: 8px; padding: 6px 7px 7px; line-height: 1.2;
      color: #fff; background: #6b7280; overflow: hidden;
      box-shadow: 0 1px 2px rgba(0,0,0,0.12);
    }
    .cr-card:hover { filter: brightness(1.05); }
    .cr-card-title {
      font-size: 0.7rem; font-weight: 700; text-align: center;
      white-space: normal; word-break: break-word;
    }
    .cr-card-time {
      font-size: 0.68rem; font-weight: 600; text-align: center;
      opacity: 0.95; margin-top: 2px; white-space: nowrap;
    }
    .cr-card-spots {
      font-size: 0.62rem; font-style: italic; text-align: center;
      opacity: 0.95; margin-top: 2px;
    }
    .cr-card-action {
      display: block; text-align: center; margin-top: 3px;
      font-size: 0.66rem; font-weight: 700; text-decoration: underline;
    }
    .cr-card-full {
      display: block; width: fit-content; margin: 4px auto 0;
      padding: 0 8px; border-radius: 5px; background: rgba(0,0,0,0.28);
      font-size: 0.62rem; font-weight: 700; text-transform: uppercase;
    }
    .cr-card-min {
      display: block; width: fit-content; margin: 3px auto 0;
      padding: 0 8px; border-radius: 5px; background: rgba(0,0,0,0.28);
      font-size: 0.6rem; font-weight: 600; text-align: center;
    }

    /* Card color by event type (matches the calendar's per-type palette) */
    [data-event-type="league"]     .cr-card { background: var(--green); }
    [data-event-type="ladder"]     .cr-card { background: var(--danger); }
    [data-event-type="tournament"] .cr-card { background: var(--info); }
    [data-event-type="program"]    .cr-card { background: #a855f7; }
    [data-event-type="court"]      .cr-card { background: #f97316; }
    [data-event-type="openplay"]   .cr-card { background: var(--warning); }

    /* Week/time grid events — solid colored blocks with white text */
    .community-calendar-wrap .fc-timegrid-event {
      border: none !important; border-radius: 6px !important;
      font-size: 0.72rem !important; font-weight: 500 !important;
      padding: 2px 6px !important; overflow: hidden;
    }
    .community-calendar-wrap .fc-timegrid-event .fc-event-main {
      padding: 2px 4px !important; overflow: hidden;
    }
    .community-calendar-wrap .fc-timegrid-event[data-event-type="league"]    { background: var(--green) !important; color: #fff !important; }
    .community-calendar-wrap .fc-timegrid-event[data-event-type="ladder"]    { background: var(--danger) !important; color: #fff !important; }
    .community-calendar-wrap .fc-timegrid-event[data-event-type="tournament"]{ background: var(--info) !important; color: #fff !important; }
    .community-calendar-wrap .fc-timegrid-event[data-event-type="program"]   { background: #a855f7 !important; color: #fff !important; }
    .community-calendar-wrap .fc-timegrid-event[data-event-type="openplay"]  { background: var(--warning) !important; color: #fff !important; }
    .community-calendar-wrap .fc-timegrid-event .fc-event-time,
    .community-calendar-wrap .fc-timegrid-event .fc-event-title {
      color: #fff !important;
    }
    .community-calendar-wrap .fc-timegrid-event .fc-event-time {
      font-size: 0.65rem; font-weight: 700; white-space: nowrap;
    }
    .community-calendar-wrap .fc-timegrid-event .fc-event-title {
      font-weight: 600; font-size: 0.7rem;
      overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
    }

    /* Week view custom event content */
    .cal-week-ev { padding: 1px 0; overflow: hidden; }
    .cal-week-ev-title {
      font-size: 0.7rem; font-weight: 700; color: #fff;
      overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
      line-height: 1.3;
    }
    .cal-week-ev-time {
      font-size: 0.6rem; font-weight: 500; color: rgba(255,255,255,0.85);
      white-space: nowrap; line-height: 1.2;
    }
    .cal-week-ev-spots {
      font-size: 0.58rem; font-style: italic; color: rgba(255,255,255,0.9);
      line-height: 1.2; margin-top: 1px;
      white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
    }
    .cal-week-ev-action {
      font-size: 0.6rem; font-weight: 700; color: #fff;
      text-decoration: underline; line-height: 1.3; margin-top: 1px;
      white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
    }
    .cal-week-ev-full {
      display: inline-block; margin-top: 2px; padding: 0 5px; border-radius: 4px;
      background: rgba(0,0,0,0.28); color: #fff;
      font-size: 0.55rem; font-weight: 700; text-transform: uppercase;
    }

    .cal-ev-icon { font-size: 0.7rem; margin-right: 1px; }

    /* List view + general event cursor */
    .community-calendar-wrap .fc-event { cursor: pointer; }

    /* ── More link ── */
    .community-calendar-wrap .fc-daygrid-more-link {
      font-size: 0.7rem; font-weight: 500; color: #374151 !important;
      padding: 1px 4px; margin: 0 2px;
    }
    .community-calendar-wrap .fc-daygrid-more-link:hover { background: rgba(0,0,0,0.04); border-radius: 4px; }

    /* ── FC Popover (+N more) ── */
    .community-calendar-wrap .fc-popover {
      background: #fff !important; border: 1px solid #e5e7eb !important;
      border-radius: 12px !important; box-shadow: 0 12px 32px rgba(0,0,0,0.12) !important; overflow: hidden;
    }
    .community-calendar-wrap .fc-popover-header {
      background: #f8fafc !important; color: #111827 !important;
      font-size: 0.82rem; font-weight: 700; padding: 0.6rem 0.85rem !important;
      border-bottom: 1px solid #e5e7eb;
    }
    .community-calendar-wrap .fc-popover-body { padding: 0.4rem !important; }

    /* ── List View ── */
    .community-calendar-wrap .fc-list { border: 1px solid #e5e7eb; border-radius: 12px; overflow: hidden; }
    .community-calendar-wrap .fc-list-day-cushion {
      background: #f8fafc !important; padding: 0.65rem 1rem !important;
      font-weight: 700; font-size: 0.85rem; color: var(--primary);
    }
    .community-calendar-wrap .fc-list-event td {
      padding: 0.75rem 1rem !important; border-bottom: 1px solid #f3f4f6; vertical-align: middle;
    }
    .community-calendar-wrap .fc-list-event:last-child td { border-bottom: none; }
    .community-calendar-wrap .fc-list-event-dot {
      border-radius: 50% !important; border: none !important; width: 10px !important; height: 10px !important;
    }
    .community-calendar-wrap .fc-list-event-time {
      font-size: 0.78rem; font-weight: 600; color: #6b7280; white-space: nowrap; min-width: 5rem;
    }
    .community-calendar-wrap .fc-list-event-title { cursor: pointer; }
    .community-calendar-wrap .fc-list-event-title a { text-decoration: none !important; color: #111827 !important; }
    .cal-ev-name { font-weight: 700; font-size: 0.88rem; display: block; color: #111827; line-height: 1.3; }
    .cal-ev-price {
      display: inline-block; margin-top: 0.2rem; margin-right: 0.5rem;
      padding: 0.15rem 0.5rem; border-radius: 999px;
      font-size: 0.7rem; font-weight: 700;
      background: rgba(117,201,167,0.12); color: #15803d;
    }
    .cal-ev-location {
      display: inline-flex; align-items: center; gap: 0.25rem;
      margin-top: 0.2rem; font-size: 0.72rem; font-weight: 500; color: #9ca3af;
    }
    .cal-ev-location svg { flex-shrink: 0; }
    .cal-ev-spots {
      display: inline-block; margin-top: 0.2rem; margin-right: 0.5rem;
      font-size: 0.72rem; font-weight: 600; font-style: italic; color: #6b7280;
    }
    .cal-ev-list-full {
      display: inline-block; margin-top: 0.2rem; margin-right: 0.5rem;
      padding: 0.15rem 0.5rem; border-radius: 999px;
      font-size: 0.7rem; font-weight: 700;
      background: rgba(239,68,68,0.12); color: #b91c1c;
    }

    /* ── Week View (Google Calendar style) ── */
    .community-calendar-wrap .fc-timegrid-slot { height: 1.5rem; }
    .community-calendar-wrap .fc-timegrid-slot-label-cushion { font-size: 0.7rem; color: #70757a; font-weight: 400; }
    .community-calendar-wrap .fc-timegrid-now-indicator-line { border-color: #ea4335 !important; border-width: 2px; }
    .community-calendar-wrap .fc-timegrid-now-indicator-arrow {
      border-top-color: #ea4335 !important;
      border-width: 5px !important; margin-top: -5px;
    }
    .community-calendar-wrap .fc-timegrid-col { border-color: #dadce0 !important; }
    /* Keep the overflow column itself invisible; only the label is a pill */
    .community-calendar-wrap .fc-timegrid-more-link {
      background: transparent !important; box-shadow: none !important;
      padding: 0 !important; border: 0 !important;
      display: flex; align-items: flex-start; justify-content: center;
    }
    .community-calendar-wrap .fc-timegrid-more-link .fc-timegrid-more-link-inner {
      display: inline-block; margin-top: 2px; white-space: nowrap;
      font-size: 0.68rem; font-weight: 700; color: #fff !important;
      background: var(--primary); padding: 3px 9px; border-radius: 999px;
      box-shadow: 0 1px 3px rgba(0,0,0,0.28); letter-spacing: 0.01em;
    }
    .community-calendar-wrap .fc-timegrid-more-link:hover .fc-timegrid-more-link-inner { background: var(--primary-dark); }

    /* Week view column headers — large day numbers like Google */
    .community-calendar-wrap .fc-col-header-cell {
      padding: 0.5rem 0 !important; border-bottom: 1px solid #dadce0 !important;
    }
    .community-calendar-wrap .fc-col-header-cell-cushion {
      display: flex !important; flex-direction: column; align-items: center; gap: 2px;
      text-decoration: none !important;
    }

    /* ── Custom Popover ── */
    .cal-popover {
      position: absolute; z-index: 9999; background: #fff; border-radius: 16px;
      box-shadow: 0 20px 60px rgba(0,0,0,0.15), 0 0 0 1px rgba(0,0,0,0.05);
      overflow: hidden; animation: calPopIn 0.2s ease; max-width: 360px;
    }
    @keyframes calPopIn {
      from { opacity: 0; transform: translateY(8px) scale(0.97); }
      to   { opacity: 1; transform: translateY(0) scale(1); }
    }
    .cal-popover-header { display: flex; align-items: center; justify-content: space-between; padding: 0.75rem 1rem 0.5rem; }
    .cal-popover-badge {
      display: inline-block; padding: 0.2rem 0.65rem; border-radius: 999px;
      font-size: 0.68rem; font-weight: 700; color: #fff; text-transform: uppercase; letter-spacing: 0.04em;
    }
    .cal-popover-close {
      background: none; border: none; font-size: 1.4rem; color: #9ca3af; cursor: pointer; padding: 0 0.25rem; line-height: 1;
    }
    .cal-popover-close:hover { color: #374151; }
    .cal-popover-title { padding: 0 1rem; font-size: 1.05rem; font-weight: 700; color: #111827; line-height: 1.3; }
    .cal-popover-meta { padding: 0.35rem 1rem 0.75rem; font-size: 0.8rem; color: #6b7280; line-height: 1.5; }
    .cal-popover-spots { padding: 0 1rem 0.5rem; font-size: 0.75rem; font-weight: 600; }
    .cal-popover-actions { display: flex; gap: 0.5rem; padding: 0 1rem 1rem; }
    .cal-popover-action {
      display: inline-flex; align-items: center; justify-content: center; gap: 0.35rem;
      padding: 0.55rem 1.25rem; border-radius: 8px; font-size: 0.82rem; font-weight: 700;
      text-decoration: none !important; transition: background 0.15s;
    }
    .cal-popover-action--primary { flex: 1; background: var(--primary); color: #fff !important; }
    .cal-popover-action--primary:hover { background: var(--primary-dark); }
    .cal-popover-action--secondary {
      background: transparent; border: 1.5px solid #e5e7eb; color: #374151 !important; white-space: nowrap;
    }
    .cal-popover-action--secondary:hover { background: #f9fafb; }

    /* ── Empty ── */
    .cal-empty { display: flex; flex-direction: column; align-items: center; gap: 0.5rem; padding: 3rem 1rem; color: #9ca3af; }
    .cal-empty p { font-size: 0.88rem; font-weight: 600; margin: 0; }

    /* ── Scrollbar ── */
    .community-calendar-wrap .fc-scroller::-webkit-scrollbar { width: 4px; }
    .community-calendar-wrap .fc-scroller::-webkit-scrollbar-thumb { background: #e5e7eb; border-radius: 4px; }

    /* ── Coming Up strip ── */
    .cal-upcoming { margin-bottom: 1rem; }
    .cal-upcoming-title {
      font-size: 0.75rem; font-weight: 700; text-transform: uppercase;
      letter-spacing: 0.05em; color: var(--t-text-muted); margin: 0 0 0.5rem;
      display: flex; align-items: center; gap: 0.3rem;
    }
    .cal-upcoming-scroll {
      display: flex; gap: 0.6rem; overflow-x: auto; -webkit-overflow-scrolling: touch;
      scroll-snap-type: x mandatory; padding-bottom: 0.5rem; scrollbar-width: none;
    }
    .cal-upcoming-scroll::-webkit-scrollbar { display: none; }
    .cal-upcoming-card {
      flex-shrink: 0; width: 180px; scroll-snap-align: start;
      background: #fff; border: 1px solid #e5e7eb;
      border-left: 3px solid; border-radius: 10px;
      padding: 0.65rem 0.75rem; text-decoration: none; color: inherit;
      transition: transform 0.15s, box-shadow 0.15s;
    }
    .cal-upcoming-card:hover { transform: translateY(-2px); box-shadow: 0 4px 12px rgba(0,0,0,0.1); }
    .cal-upcoming-card-date { font-size: 0.68rem; font-weight: 600; color: #6b7280; }
    .cal-upcoming-card-title {
      font-size: 0.82rem; font-weight: 700; margin-top: 0.15rem; line-height: 1.3;
      overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
    }
    .cal-upcoming-card-meta { font-size: 0.7rem; color: #6b7280; margin-top: 0.2rem; }

    /* ── Mobile Day View ── */
    .cal-mobile-day-nav {
      display: flex; align-items: center; justify-content: center; gap: 0.75rem; margin-bottom: 0.75rem;
    }
    .cal-mobile-day-arrow {
      width: 42px; height: 42px; border-radius: 50%;
      border: 1.5px solid #e5e7eb; background: #fff; color: #374151;
      font-size: 1.4rem; font-weight: 600; cursor: pointer;
      display: flex; align-items: center; justify-content: center;
      transition: all 0.15s; -webkit-tap-highlight-color: transparent; line-height: 1;
    }
    .cal-mobile-day-arrow:active { background: var(--primary); color: #fff; border-color: var(--primary); transform: scale(0.92); }
    .cal-mobile-day-today {
      padding: 0.45rem 1rem; border-radius: 999px;
      border: 1.5px solid #e5e7eb; background: #fff; color: #374151;
      font-size: 0.8rem; font-weight: 700; cursor: pointer;
      transition: all 0.15s; -webkit-tap-highlight-color: transparent;
    }
    .cal-mobile-day-today:active { background: var(--primary); color: #fff; border-color: var(--primary); }
    .cal-mobile-day-title {
      text-align: center; font-size: 1.15rem; font-weight: 800;
      color: var(--primary); margin: 0 0 1rem; letter-spacing: -0.01em;
    }
    .cal-mobile-day-events { display: flex; flex-direction: column; gap: 0.6rem; }
    .cal-mobile-day-card {
      display: flex; align-items: stretch;
      background: #fff; border: 1px solid #e5e7eb;
      border-radius: 12px; overflow: hidden;
      text-decoration: none; color: inherit;
      transition: transform 0.15s, box-shadow 0.15s;
      box-shadow: 0 1px 4px rgba(0,0,0,0.06);
    }
    .cal-mobile-day-card:active { transform: scale(0.98); box-shadow: 0 1px 2px rgba(0,0,0,0.08); }
    .cal-mobile-day-card-bar { width: 4px; flex-shrink: 0; }
    .cal-mobile-day-card-body { flex: 1; min-width: 0; padding: 0.75rem 0.85rem; }
    .cal-mobile-day-card-top { display: flex; align-items: center; gap: 0.5rem; margin-bottom: 0.3rem; }
    .cal-mobile-day-card-time { font-size: 0.72rem; font-weight: 700; color: #6b7280; }
    .cal-mobile-day-card-type {
      font-size: 0.6rem; font-weight: 700; color: #fff; padding: 0.1rem 0.45rem;
      border-radius: 999px; text-transform: uppercase; letter-spacing: 0.04em;
    }
    .cal-mobile-day-card-title {
      font-size: 0.92rem; font-weight: 700; color: #111827; line-height: 1.3;
      overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
    }
    .cal-mobile-day-card-meta {
      font-size: 0.75rem; color: #6b7280; margin-top: 0.2rem;
      overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
    }
    .cal-mobile-day-spots { font-size: 0.7rem; font-weight: 600; margin-top: 0.2rem; }
    .cal-mobile-day-card-cta {
      display: flex; align-items: center; padding: 0 0.85rem; flex-shrink: 0;
      font-size: 0.72rem; font-weight: 700; color: var(--primary);
      white-space: nowrap; border-left: 1px solid #f3f4f6;
    }
    .cal-section-label {
      font-size: 0.7rem; font-weight: 700; text-transform: uppercase;
      letter-spacing: 0.06em; color: #9ca3af;
      margin: 0.75rem 0 0.5rem; padding-bottom: 0.35rem;
      border-bottom: 1px solid #e5e7eb;
    }

    /* ── Mobile month grid (tap a day → events below) ── */
    .cal-m-monthnav { display: flex; align-items: center; justify-content: space-between; margin-bottom: 0.35rem; }
    .cal-m-monthtitle { font-size: 1.15rem; font-weight: 800; color: var(--primary); margin: 0; }
    .cal-m-todayrow { text-align: right; margin-bottom: 0.5rem; }
    .cal-m-grid { width: 100%; border-collapse: collapse; table-layout: fixed; }
    .cal-m-grid th {
      font-size: 0.68rem; font-weight: 700; color: #9ca3af; text-transform: uppercase;
      padding: 0.3rem 0; text-align: center;
    }
    .cal-m-cell {
      height: 3rem; vertical-align: top; text-align: center; padding: 0.2rem 0 0;
      border: 1px solid #f1f5f9; cursor: pointer; position: relative;
    }
    .cal-m-cell.cal-m-empty { background: #fafafa; cursor: default; }
    .cal-m-daynum {
      font-size: 0.82rem; font-weight: 600; color: #374151;
      display: inline-flex; width: 1.65rem; height: 1.65rem; align-items: center;
      justify-content: center; border-radius: 50%;
    }
    .cal-m-cell.cal-m-today .cal-m-daynum { border: 1.5px solid var(--primary); }
    .cal-m-cell.cal-m-sel .cal-m-daynum { background: var(--primary); color: #fff; }
    .cal-m-dots { display: flex; gap: 3px; justify-content: center; flex-wrap: wrap; margin-top: 2px; }
    .cal-m-dot { width: 6px; height: 6px; border-radius: 50%; flex-shrink: 0; }
    .cal-m-empty-day { color: #9ca3af; font-size: 0.85rem; text-align: center; padding: 1.25rem 0; }

    /* ── Day sheet (mobile) ── */
    .cal-day-sheet-backdrop {
      position: fixed; inset: 0; z-index: 9999; background: rgba(0,0,0,0.3);
      opacity: 0; transition: opacity 0.3s;
    }
    .cal-day-sheet-backdrop.is-open { opacity: 1; }
    .cal-day-sheet {
      position: fixed; bottom: 0; left: 0; right: 0; z-index: 10000;
      background: #fff; border-radius: 20px 20px 0 0;
      box-shadow: 0 -8px 30px rgba(0,0,0,0.15);
      max-height: 65vh; overflow-y: auto;
      transform: translateY(100%); transition: transform 0.3s ease;
      padding-bottom: env(safe-area-inset-bottom, 0.5rem);
    }
    .cal-day-sheet.is-open { transform: translateY(0); }
    .cal-day-sheet-handle { width: 36px; height: 4px; background: #d1d5db; border-radius: 2px; margin: 0.6rem auto 0.3rem; }
    .cal-day-sheet-header {
      display: flex; justify-content: space-between; align-items: center; padding: 0.25rem 1rem 0.5rem;
    }
    .cal-day-sheet-header h4 { margin: 0; font-size: 1rem; font-weight: 700; color: #111827; }
    .cal-day-sheet-close {
      background: none; border: none; font-size: 1.5rem; color: #9ca3af;
      cursor: pointer; padding: 0.25rem; line-height: 1;
    }
    .cal-day-sheet-body { padding: 0 1rem 1rem; }
    .cal-day-event {
      display: flex; align-items: flex-start; gap: 0.75rem;
      padding: 0.75rem 0; border-bottom: 1px solid #f3f4f6;
      text-decoration: none; color: inherit;
    }
    .cal-day-event:last-child { border-bottom: none; }
    .cal-day-event-dot { width: 10px; height: 10px; border-radius: 50%; flex-shrink: 0; margin-top: 0.3rem; }
    .cal-day-event-info { flex: 1; min-width: 0; }
    .cal-day-event-title { font-size: 0.88rem; font-weight: 600; line-height: 1.3; }
    .cal-day-event-meta { font-size: 0.75rem; color: #6b7280; margin-top: 0.15rem; }
    .cal-day-event-cta {
      flex-shrink: 0; align-self: center;
      padding: 0.35rem 0.75rem; border-radius: 6px;
      font-size: 0.72rem; font-weight: 700;
      background: var(--primary); color: #fff;
      text-decoration: none; white-space: nowrap;
    }

    /* ── Day panel (desktop) ── */
    .cal-day-panel-backdrop {
      position: fixed; inset: 0; z-index: 9998;
      background: rgba(0,0,0,0.2);
      opacity: 0; transition: opacity 0.25s;
      display: none;
    }
    .cal-day-panel-backdrop.is-open { opacity: 1; }
    .cal-day-panel {
      position: fixed; top: 0; right: 0; bottom: 0; z-index: 9999;
      width: 380px; max-width: 90vw;
      background: #fff; box-shadow: -8px 0 30px rgba(0,0,0,0.12);
      display: none; flex-direction: column;
      transform: translateX(100%); transition: transform 0.3s ease;
    }
    .cal-day-panel.is-open { transform: translateX(0); }
    .cal-day-panel-header {
      display: flex; justify-content: space-between; align-items: flex-start;
      padding: 1.25rem 1.25rem 0.75rem; border-bottom: 1px solid #e5e7eb;
      flex-shrink: 0;
    }
    .cal-day-panel-title {
      font-size: 1.1rem; font-weight: 800; color: var(--primary); line-height: 1.3;
    }
    .cal-day-panel-count {
      font-size: 0.78rem; font-weight: 600; color: #6b7280; margin-top: 0.15rem;
    }
    .cal-day-panel-close {
      background: none; border: none; font-size: 1.6rem; color: #9ca3af;
      cursor: pointer; padding: 0; line-height: 1; flex-shrink: 0;
      transition: color 0.15s;
    }
    .cal-day-panel-close:hover { color: #374151; }
    .cal-day-panel-events {
      flex: 1; overflow-y: auto; padding: 0.75rem 1.25rem 1.25rem;
    }
    .cal-day-panel-events::-webkit-scrollbar { width: 4px; }
    .cal-day-panel-events::-webkit-scrollbar-thumb { background: #e5e7eb; border-radius: 4px; }
    .cal-day-panel-group { margin-bottom: 0.75rem; }
    .cal-day-panel-group:last-child { margin-bottom: 0; }
    .cal-day-panel-group-label {
      display: flex; align-items: center; gap: 0.4rem;
      font-size: 0.7rem; font-weight: 700; text-transform: uppercase;
      letter-spacing: 0.06em; color: #9ca3af;
      margin: 0 0 0.5rem; padding-bottom: 0.35rem;
      border-bottom: 1px solid #e5e7eb;
    }
    .cal-day-panel-group-dot {
      width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0;
    }
    .cal-day-panel-card {
      display: flex; align-items: stretch;
      background: #fff; border: 1px solid #e5e7eb;
      border-radius: 10px; overflow: hidden;
      text-decoration: none; color: inherit;
      transition: transform 0.15s, box-shadow 0.15s;
      margin-bottom: 0.5rem;
    }
    .cal-day-panel-card:last-child { margin-bottom: 0; }
    .cal-day-panel-card:hover { transform: translateY(-1px); box-shadow: 0 4px 12px rgba(0,0,0,0.08); }
    .cal-day-panel-card-bar { width: 4px; flex-shrink: 0; }
    .cal-day-panel-card-body { flex: 1; min-width: 0; padding: 0.65rem 0.75rem; }
    .cal-day-panel-card-top { display: flex; align-items: center; gap: 0.5rem; margin-bottom: 0.2rem; }
    .cal-day-panel-card-time { font-size: 0.72rem; font-weight: 700; color: #6b7280; }
    .cal-day-panel-card-title {
      font-size: 0.88rem; font-weight: 700; color: #111827; line-height: 1.3;
      overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
    }
    .cal-day-panel-card-meta {
      font-size: 0.72rem; color: #6b7280; margin-top: 0.15rem;
      overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
    }
    .cal-day-panel-card-spots { font-size: 0.68rem; font-weight: 600; margin-top: 0.15rem; }
    .cal-day-panel-card-cta {
      display: flex; align-items: center; padding: 0 0.75rem; flex-shrink: 0;
      font-size: 0.72rem; font-weight: 700; color: var(--primary);
      white-space: nowrap; border-left: 1px solid #f3f4f6;
    }
    .cal-day-panel-empty {
      text-align: center; padding: 2rem 1rem; color: #9ca3af;
      font-size: 0.85rem; font-weight: 600;
    }
    @media (max-width: 640px) {
      .cal-day-panel, .cal-day-panel-backdrop { display: none !important; }
    }

    /* ── Powered-by footer ── */
    .embed-powered-by {
      text-align: center; padding: 0.75rem 0.5rem 0.25rem;
      font-size: 0.7rem; color: #9ca3af;
    }
    .embed-powered-by a {
      color: var(--primary); text-decoration: none; font-weight: 600;
    }
    .embed-powered-by a:hover { text-decoration: underline; }

    /* ── Responsive ── */
    @media (max-width: 640px) {
      .embed-wrap { padding: 0.5rem; }
      .community-calendar-wrap .fc-toolbar-title { font-size: 1rem !important; }
      .community-calendar-wrap .fc-button { font-size: 0.72rem !important; padding: 0.3rem 0.6rem !important; min-height: 32px; }
    }
  
