.jsud-agenda .jsud-view-toggle { display: flex; gap: 8px; margin: 0 0 16px; }
.jsud-agenda .jsud-toggle-btn {
  border: 1px solid #ddd; background: #fff; border-radius: 999px; padding: 8px 16px;
  font-size: 13px; cursor: pointer;
}
.jsud-agenda .jsud-toggle-btn.is-active { background: var(--jsud-navy); color: #fff; border-color: var(--jsud-navy); }

.jsud-agenda .jsud-day-tabs { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 8px; }
.jsud-agenda .jsud-day-tab {
  flex: 0 0 auto; min-width: 64px; border: 1px solid #e2e6ec; background: #fff; border-radius: 12px;
  padding: 8px; cursor: pointer; display: flex; flex-direction: column; align-items: center; gap: 2px;
}
.jsud-agenda .jsud-day-tab.is-active { background: var(--jsud-gradient); color: #fff; border-color: transparent; }
.jsud-agenda .jsud-day-weekday { font-size: 10px; font-weight: 700; letter-spacing: .5px; }
.jsud-agenda .jsud-day-num { font-size: 18px; font-weight: 800; }
.jsud-agenda .jsud-day-count { font-size: 10px; opacity: .8; }

.jsud-agenda .jsud-filters { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }
.jsud-agenda .jsud-venue-chips { display: flex; gap: 8px; flex-wrap: wrap; }

.jsud-agenda .jsud-selected-date { display: flex; justify-content: space-between; align-items: baseline; font-size: 16px; }
.jsud-agenda .jsud-selected-date span { font-size: 12px; color: var(--jsud-muted); font-weight: 400; }

.jsud-agenda .jsud-venue-heading { display: flex; align-items: center; gap: 8px; font-size: 13px; text-transform: uppercase; letter-spacing: .5px; color: var(--jsud-muted); margin: 16px 0 8px; }
/* Flexbox, not CSS Grid — see disciplinas.css for why (grid's auto-fit only
   collapses a column when no row anywhere uses it, so a short last row
   under a full row still leaves a reserved blank gap). */
.jsud-agenda .jsud-card-grid { display: flex; flex-wrap: wrap; gap: 12px; }
.jsud-agenda .jsud-card { flex: 0 0 230px; border: 1px solid #e2e6ec; border-radius: 12px; padding: 14px; cursor: pointer; background: #fff; transition: box-shadow .15s ease; display: flex; gap: 12px; align-items: flex-start; }
.jsud-agenda .jsud-card:hover { box-shadow: 0 4px 16px rgba(13,27,42,.1); }
.jsud-agenda .jsud-card-icon { flex: 0 0 auto; width: 40px; height: 40px; border-radius: 10px; padding: 8px; }
.jsud-agenda .jsud-card-icon svg { width: 100%; height: 100%; }
.jsud-agenda .jsud-card-icon--modal { width: 64px; height: 64px; background: none !important; padding: 0; }
.jsud-agenda .jsud-card-body { flex: 1 1 auto; min-width: 0; }
.jsud-agenda .jsud-card h4 { margin: 0 0 4px; font-size: 15px; }
.jsud-agenda .jsud-card-jornada { margin: 6px 0 0; font-size: 12px; }
.jsud-agenda .jsud-card-badges { margin-top: 8px; display: flex; gap: 6px; flex-wrap: wrap; }
.jsud-agenda .jsud-badge { font-size: 10px; font-weight: 700; padding: 3px 8px; border-radius: 999px; text-transform: uppercase; }
.jsud-agenda .jsud-badge-start { background: #E6F4EA; color: #1E7B34; }
.jsud-agenda .jsud-badge-invited { background: #FFF1E0; color: #B85C00; }

.jsud-agenda .jsud-upcoming { margin-top: 24px; border-top: 1px solid #eef1f5; padding-top: 16px; }
.jsud-agenda .jsud-upcoming h3 { font-size: 14px; margin: 0 0 10px; }
.jsud-agenda .jsud-upcoming-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 12px; }
.jsud-agenda .jsud-upcoming-day { background: #f7f9fb; border-radius: 10px; padding: 12px; font-size: 12px; cursor: pointer; transition: box-shadow .15s ease; }
.jsud-agenda .jsud-upcoming-day:hover, .jsud-agenda .jsud-upcoming-day:focus-visible { box-shadow: 0 4px 16px rgba(13,27,42,.1); outline: none; }
.jsud-agenda .jsud-upcoming-day p { margin: 4px 0 0; color: var(--jsud-muted); }

/* The day-header row lives in its own box (.jsud-grid-headwrap), separate
   from the horizontally-scrolling body (.jsud-grid-scroll) below it, and JS
   keeps their scrollLeft in sync. This split exists because a position:sticky
   element can't reliably stick to the page from inside an ancestor that
   itself has overflow-x:auto for horizontal scroll — the two jobs (floating
   vertically vs. scrolling horizontally) need two different boxes. */
.jsud-agenda .jsud-grid-headwrap { overflow: hidden; background: #fff; }
.jsud-agenda .jsud-grid-scroll { overflow-x: auto; }
.jsud-agenda .jsud-grid-table { border-collapse: collapse; table-layout: fixed; width: 100%; font-size: 12px; }
.jsud-agenda .jsud-grid-table th, .jsud-agenda .jsud-grid-table td { border-bottom: 1px solid #eef1f5; padding: 8px; text-align: center; white-space: nowrap; width: 70px; }
.jsud-agenda .jsud-grid-table th:first-child, .jsud-agenda .jsud-grid-table td:first-child {
  text-align: left; white-space: normal; width: 200px;
  /* Only the day columns (with the dots) scroll sideways; this first column stays put. */
  position: sticky;
  left: 0;
  background: #fff;
  z-index: 1;
}
/* Floats above the rows as the page scrolls, so the day stays visible even
   once the top of the table has scrolled out of view — desktop and mobile
   alike. Only once the table is expanded (Ver más) and actually has enough
   rows to scroll past its own header; collapsed (10 rows), it stays put. */
.jsud-agenda .jsud-grid-headwrap.is-expanded {
  position: sticky;
  top: 0;
  z-index: 2;
}
.jsud-agenda .jsud-grid-row { cursor: pointer; }
.jsud-agenda .jsud-grid-row:hover { background: #f7f9fb; }
.jsud-agenda .jsud-dot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; }

.jsud-agenda .jsud-modal-venue { font-size: 13px; }

.jsud-agenda .jsud-source { font-size: 11px; color: var(--jsud-muted); margin: 0; }

@container jsud-widget (max-width: 600px) {
  .jsud-agenda .jsud-filters { flex-direction: column; align-items: stretch; }
  .jsud-agenda .jsud-upcoming { display: none; }

  /* Per-city discipline cards become a swipeable carousel: each page is its
     own flex-wrap box (2 cards per row). Flexbox rows aren't shared tracks
     like grid rows/columns are, so a page with fewer cards than a full
     page just wraps to fewer rows on its own — cards fill left-to-right
     first (2 sit side by side instead of stacking), and there's never a
     reserved blank cell. */
  .jsud-agenda .jsud-card-grid {
    display: flex;
    flex-wrap: nowrap; /* the desktop rule sets flex-wrap:wrap; without this reset, pages stack vertically instead of overflowing sideways */
    align-items: flex-start;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    scroll-behavior: smooth;
    gap: 10px;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
  }
  .jsud-agenda .jsud-card-grid::-webkit-scrollbar { display: none; }
  .jsud-agenda .jsud-card-grid .jsud-hcarousel-page {
    display: flex;
    flex-wrap: wrap;
    align-content: flex-start;
    gap: 10px;
    flex: 0 0 100%;
    width: 100%;
    scroll-snap-align: start;
    scroll-snap-stop: always;
  }

  /* Compact card, two per row: icon on top, name/location below — no overlap. */
  .jsud-agenda .jsud-card-grid .jsud-hcarousel-page .jsud-card {
    flex: 0 0 calc(50% - 5px);
  }
  .jsud-agenda .jsud-card {
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding: 14px 8px;
    gap: 8px;
  }
  .jsud-agenda .jsud-card-icon {
    width: 56px;
    height: 56px;
    padding: 0;
    background: none !important;
  }
  .jsud-agenda .jsud-card-icon svg {
    width: 100%;
    height: 100%;
  }
  .jsud-agenda .jsud-card-location { justify-content: center; }
  .jsud-agenda .jsud-card-jornada,
  .jsud-agenda .jsud-card-badges { display: none; }
}
