/* Customer Portal – Sessions & Classes Section */

/* Single-session detail view */
.session-detail-back-bar {
  margin-bottom: 12px;
}
.session-detail-back-btn {
  background: transparent;
  border: none;
  color: #0955a1;
  font-size: 14px;
  font-weight: 600;
  padding: 6px 0;
  cursor: pointer;
}
.session-detail-back-btn:hover {
  text-decoration: underline;
}
.session-group-card-detail {
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

/* ============================================================================
   LANDING PAGE PREVIEW
   ============================================================================ */

.sessions-preview-container {
  display: flex;
  gap: 12px;
  overflow-x: auto;
  padding-bottom: 8px;
  -webkit-overflow-scrolling: touch;
}

.session-preview-card {
  flex: 0 0 260px;
  border: 1px solid #e0e0e0;
  border-radius: 10px;
  padding: 16px;
  background: #fff;
  cursor: pointer;
  transition:
    box-shadow 0.2s ease,
    border-color 0.2s ease;
}

.session-preview-card:hover {
  box-shadow: 0 3px 12px rgba(0, 0, 0, 0.1);
  border-color: #bdbdbd;
}

.session-preview-name {
  font-size: 15px;
  font-weight: 700;
  color: #212121;
  margin: 0 0 4px;
}

.session-preview-instructor {
  font-size: 13px;
  color: #777;
  margin: 0 0 6px;
}

.session-preview-when {
  display: flex;
  flex-direction: column;
  gap: 2px;
  margin: 0 0 8px;
}

.session-preview-when-row {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  line-height: 1.35;
}

.session-preview-when-row::before {
  content: "";
  display: inline-block;
  width: 14px;
  height: 14px;
  flex-shrink: 0;
  background-repeat: no-repeat;
  background-position: center;
  background-size: contain;
  opacity: 0.7;
}

.session-preview-when-dates {
  color: #212121;
  font-weight: 600;
}

.session-preview-when-dates::before {
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23555' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><rect x='3' y='4' width='18' height='18' rx='2' ry='2'/><line x1='16' y1='2' x2='16' y2='6'/><line x1='8' y1='2' x2='8' y2='6'/><line x1='3' y1='10' x2='21' y2='10'/></svg>");
}

.session-preview-when-time {
  color: #555;
}

.session-preview-when-time::before {
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23555' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><circle cx='12' cy='12' r='10'/><polyline points='12 6 12 12 16 14'/></svg>");
}

.session-preview-classes {
  font-size: 12px;
  color: #999;
  margin: 0 0 10px;
}

.session-preview-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.session-preview-price {
  font-size: 14px;
  font-weight: 700;
  color: #212121;
}

/* ============================================================================
   SESSION GROUP CARD (full view)
   ============================================================================ */

.session-group-card {
  border: 1px solid #e0e0e0;
  border-radius: 10px;
  margin-bottom: 16px;
  background: #fff;
  overflow: hidden;
}

.session-group-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px;
  cursor: pointer;
  transition: background-color 0.15s ease;
}

.session-group-header:hover {
  background-color: #fafafa;
}

.session-group-info {
  flex: 1;
}

.session-group-name {
  font-size: 16px;
  font-weight: 700;
  color: #212121;
  margin-bottom: 2px;
}

.session-group-instructor {
  font-size: 13px;
  color: #777;
  margin-bottom: 4px;
}

.session-group-dates {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  font-weight: 600;
  color: #212121;
  margin-bottom: 4px;
}

.session-group-dates::before {
  content: "";
  display: inline-block;
  width: 14px;
  height: 14px;
  flex-shrink: 0;
  opacity: 0.75;
  background-repeat: no-repeat;
  background-position: center;
  background-size: contain;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23212121' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><rect x='3' y='4' width='18' height='18' rx='2' ry='2'/><line x1='16' y1='2' x2='16' y2='6'/><line x1='8' y1='2' x2='8' y2='6'/><line x1='3' y1='10' x2='21' y2='10'/></svg>");
}

.session-group-schedule {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  color: #555;
  margin-bottom: 6px;
}

.session-group-schedule::before {
  content: "";
  display: inline-block;
  width: 14px;
  height: 14px;
  flex-shrink: 0;
  opacity: 0.7;
  background-repeat: no-repeat;
  background-position: center;
  background-size: contain;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23555' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><circle cx='12' cy='12' r='10'/><polyline points='12 6 12 12 16 14'/></svg>");
}

.session-group-meta {
  display: flex;
  gap: 12px;
  align-items: center;
  flex-wrap: wrap;
  font-size: 13px;
}

.session-group-count {
  color: #777;
}

.session-group-price {
  font-weight: 600;
  color: #212121;
}

.session-group-toggle {
  padding: 0 8px;
  font-size: 14px;
  color: #999;
}

.session-toggle-arrow {
  transition: transform 0.2s ease;
}

/* ============================================================================
   SESSION GROUP BODY (expandable)
   ============================================================================ */

.session-group-body {
  border-top: 1px solid #e0e0e0;
  padding: 16px;
}

.session-group-card.session-group-auto-expanded {
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
}

.session-group-card.session-group-auto-expanded .session-group-header {
  background-color: #fafafa;
}

.session-group-card.session-group-auto-expanded .session-group-header:hover {
  background-color: #f1f1f1;
}

.session-pricing-tiers {
  background: #e3f2fd;
  border-radius: 8px;
  padding: 10px 14px;
  margin-bottom: 14px;
  font-size: 12px;
}

.session-select-all-bar {
  padding: 8px 0;
  margin-bottom: 8px;
  border-bottom: 1px solid #f0f0f0;
}

.session-select-all-label {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  font-size: 14px;
  font-weight: 600;
  color: #333;
}

.session-select-all-checkbox {
  width: 18px;
  height: 18px;
  cursor: pointer;
  accent-color: #2e7d32;
}

/* ============================================================================
   INSTANCE ROWS
   ============================================================================ */

.session-instances-list {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.session-instance-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  padding: 10px 8px;
  border-radius: 6px;
  transition: background-color 0.15s ease;
}

.session-instance-row:hover {
  background-color: #f9f9f9;
}

.session-instance-row.enrolled {
  background-color: #e8f5e9;
}

.session-instance-row.full {
  opacity: 0.5;
}

.session-instance-checkbox-col {
  flex: 0 0 28px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.session-instance-checkbox {
  width: 18px;
  height: 18px;
  cursor: pointer;
  accent-color: #2e7d32;
}

.session-enrolled-check {
  color: #2e7d32;
  font-size: 18px;
  font-weight: bold;
}

.session-no-check {
  display: inline-block;
  width: 18px;
  height: 18px;
}

.session-instance-info {
  flex: 1;
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
}

.session-instance-date {
  font-size: 14px;
  font-weight: 600;
  color: #212121;
}

.session-instance-time {
  font-size: 13px;
  color: #555;
}

.session-instance-event-name {
  flex-basis: 100%;
  width: 100%;
  font-size: 14px;
  font-weight: 600;
  color: #2e7d32;
}

.session-instance-included {
  flex-basis: 100%;
  width: 100%;
  margin-top: 2px;
  font-size: 12px;
  font-weight: 600;
  color: #2e7d32;
}

.session-instance-desc {
  flex-basis: 100%;
  width: 100%;
  margin-top: 2px;
  font-size: 12px;
  line-height: 1.35;
  color: #777;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  word-break: break-word;
  white-space: pre-line;
}

.session-instance-status {
  flex: 0 0 auto;
}

/* Badges */

.enrolled-badge {
  display: inline-block;
  background: #2e7d32;
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 10px;
  letter-spacing: 0.5px;
}

.enrolled-session-badge {
  display: inline-block;
  background: #2e7d32;
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 10px;
  letter-spacing: 0.5px;
}

.full-badge {
  display: inline-block;
  background: #dc3545;
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 10px;
  letter-spacing: 0.5px;
}

.spots-badge {
  font-size: 13px;
  font-weight: 600;
}

.spots-badge.spots-available {
  color: #1e7a37;
}

.session-instance-unenroll {
  padding: 4px 12px;
  font-size: 12px;
  min-width: auto;
}

/* ============================================================================
   ENROLL BAR
   ============================================================================ */

.session-enroll-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid #e0e0e0;
  flex-wrap: wrap;
}

.session-enroll-price-summary {
  flex: 1;
}

.session-discount-note {
  font-size: 12px;
  color: #2e7d32;
  font-weight: 600;
}

.session-enroll-btn {
  padding: 10px 24px;
  font-size: 14px;
  min-width: 200px;
}

.session-enroll-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* ============================================================================
   SESSION ADD-ONS (e.g. Lunch)
   ============================================================================ */

.session-addons-hint {
  font-size: 12px;
  color: #777;
  font-style: italic;
  margin: 8px 0 4px;
}

.session-instance-addons {
  flex: 0 0 100%;
  width: 100%;
  margin-top: 8px;
  padding: 8px 8px 4px;
  border-top: 1px dashed #e0e0e0;
  background: #fafafa;
  border-radius: 6px;
}

.session-instance-addons[hidden] {
  display: none;
}

.session-instance-addons-label {
  font-size: 12px;
  font-weight: 600;
  color: #333;
  margin: 0 0 4px;
}

.session-addon-fixed-toggle {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 14px;
  color: #2e7d32;
  cursor: pointer;
  white-space: nowrap;
}

.session-addon-fixed-toggle input[type="checkbox"] {
  width: 18px;
  height: 18px;
  accent-color: #2e7d32;
  cursor: pointer;
}

.session-addon-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 6px 0;
  flex-wrap: wrap;
}

.session-addon-info {
  display: flex;
  flex-direction: column;
}

.session-addon-name {
  font-size: 14px;
  color: #333;
}

.session-addon-unit {
  font-size: 12px;
  color: #777;
}

.session-addon-controls {
  display: flex;
  align-items: center;
  gap: 8px;
}

.session-addon-step {
  width: 30px;
  height: 30px;
  border: 1px solid #ccc;
  border-radius: 4px;
  background: #f7f7f7;
  color: #2e7d32;
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

.session-addon-step:hover {
  background: #eef5ef;
}

.session-addon-qty {
  width: 52px;
  height: 30px;
  text-align: center;
  font-size: 14px;
  border: 1px solid #ccc;
  border-radius: 4px;
  accent-color: #2e7d32;
}

/* ============================================================================
   UNENROLL BAR
   ============================================================================ */

.session-unenroll-bar {
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid #e0e0e0;
  text-align: center;
}

.session-paid-note {
  margin: 0;
  font-size: 12px;
  color: #777;
  font-style: italic;
}

.session-unenroll-session-btn {
  width: 100%;
  padding: 10px;
}

/* ============================================================================
   SECONDARY BUTTON (shared)
   ============================================================================ */

.booky-secondary-btn {
  display: inline-block;
  padding: 8px 20px;
  font-size: 14px;
  background: none;
  border: 1px solid #999;
  border-radius: 4px;
  color: #555;
  cursor: pointer;
  min-width: 100px;
  transition:
    border-color 0.2s,
    color 0.2s;
}

.booky-secondary-btn:hover {
  border-color: #dc3545;
  color: #dc3545;
}

/* ============================================================================
   MY CLASSES (user-bookings page) — kept from previous implementation
   ============================================================================ */

.my-class-card {
  border: 1px solid #e0e0e0;
  border-radius: 10px;
  margin-bottom: 12px;
  padding: 16px;
  background: #fff;
}

.my-class-card .class-badge {
  display: inline-block;
  background: #2196f3;
  color: #fff;
  font-size: 11px;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 10px;
  margin-bottom: 6px;
  text-transform: uppercase;
  letter-spacing: 0.4px;
}

.my-class-card .class-name {
  font-size: 16px;
  font-weight: 700;
  margin-bottom: 4px;
}

.my-class-card .class-meta {
  font-size: 14px;
  color: #555;
  margin-bottom: 2px;
}

.my-class-card .class-actions {
  margin-top: 10px;
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.my-class-card.past-class {
  opacity: 0.7;
}

.my-class-card.cancelled-class {
  opacity: 0.5;
}

/* ============================================================================
   RESPONSIVE
   ============================================================================ */

@media (max-width: 576px) {
  .sessions-preview-container {
    gap: 10px;
  }

  .session-preview-card {
    flex: 0 0 220px;
    padding: 12px;
  }

  .session-group-header {
    padding: 12px;
  }

  .session-group-body {
    padding: 12px;
  }

  .session-instance-row {
    gap: 8px;
    padding: 8px 4px;
  }

  .session-instance-info {
    flex-direction: column;
    gap: 2px;
    align-items: flex-start;
  }

  .session-enroll-btn {
    width: 100%;
    min-width: auto;
  }

  .session-enroll-bar {
    flex-direction: column;
    align-items: stretch;
  }
}

/* ===== Attendance Mode (Customer Portal) ===== */
.attendance-mode-badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 10px;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.3px;
  vertical-align: middle;
  margin-left: 4px;
}

.attendance-mode-badge.in-person {
  background: #e3f2fd;
  color: #1565c0;
}

.attendance-mode-badge.virtual {
  background: #f3e5f5;
  color: #7b1fa2;
}

.attendance-mode-badge.hybrid {
  background: #fff3e0;
  color: #e65100;
}

/* Mode toggle for hybrid sessions */
.session-mode-toggle {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
  background: #f5f5f5;
  border-bottom: 1px solid #e0e0e0;
}

.session-mode-toggle-label {
  font-size: 13px;
  font-weight: 600;
  color: #555;
}

.session-mode-btn {
  padding: 6px 16px;
  border: 2px solid #e0e0e0;
  border-radius: 20px;
  background: #fff;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  color: #666;
}

.session-mode-btn:hover {
  border-color: #2196f3;
  color: #2196f3;
}

.session-mode-btn.active {
  background: #2196f3;
  border-color: #2196f3;
  color: #fff;
}

/* Dual spots display */
.dual-spots-display {
  display: inline-flex;
  gap: 6px;
  align-items: center;
}

.dual-spots-display .spots-badge {
  font-size: 11px;
}

/* Capacity bar dual (reused from admin) */
.capacity-bar-dual {
  margin: 12px 0;
}

.capacity-bar-dual-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 6px;
}

.capacity-bar-dual-label {
  font-size: 12px;
  font-weight: 600;
  min-width: 70px;
  color: #555;
}

body.pcal-active .main-content-customer-portal {
  margin-left: 0 !important;
  margin-right: 0 !important;
}

body.pcal-active .main-content-customer-portal > #form-body,
body.pcal-active #form-body > #services-list-content {
  width: 100%;
}

.sessions-view-toggle:empty {
  display: none;
}

.sessions-view-toggle {
  display: flex;
  justify-content: flex-end;
  margin-bottom: 12px;
}

.pcal-view-toggle {
  background: transparent;
  border-bottom: none;
  padding: 0;
  gap: 6px;
}

.pcal-root {
  --pcal-border: #e0e0e0;
  --pcal-muted: #777;
  position: relative;
  width: 100%;
}

.pcal-loading {
  text-align: center;
  padding: 30px;
}

.pcal-error {
  text-align: center;
  color: #dc3545;
  padding: 24px 12px;
}

.pcal-header {
  position: sticky;
  top: 0;
  z-index: 5;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 8px 0 12px;
  background: #fff;
}

.pcal-nav {
  display: flex;
  align-items: center;
  gap: 4px;
}

.pcal-nav-btn {
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--pcal-border);
  border-radius: 8px;
  background: #fff;
  color: #212121;
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
  transition:
    border-color 0.15s ease,
    background-color 0.15s ease;
}

.pcal-nav-btn:hover:not(:disabled) {
  border-color: var(--primary-button-color);
  background: #fafafa;
}

.pcal-nav-btn:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}

.pcal-month {
  margin: 0 6px;
  font-size: 17px;
  font-weight: 700;
  letter-spacing: 0.06em;
  color: #212121;
  white-space: nowrap;
}

.pcal-today-btn {
  padding: 8px 16px;
  border: 1px solid var(--pcal-border);
  border-radius: 20px;
  background: #fff;
  font-size: 13px;
  font-weight: 600;
  color: #555;
  cursor: pointer;
}

.pcal-today-btn:hover:not(:disabled) {
  border-color: var(--primary-button-color);
  color: #212121;
}

.pcal-today-btn[hidden] {
  display: none;
}

.pcal-programmings {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 10px;
  font-size: 12px;
}

.pcal-programmings[hidden],
.pcal-notice[hidden] {
  display: none;
}

.pcal-programmings-label {
  color: var(--pcal-muted);
  font-weight: 600;
}

.pcal-programming-chip {
  padding: 3px 10px;
  border: 1px solid var(--pcal-border);
  border-radius: 12px;
  color: #555;
  background: #fafafa;
}

.pcal-programming-chip.is-active {
  border-color: #2e7d32;
  background: #e8f5e9;
  color: #1e7a37;
  font-weight: 600;
}

.pcal-notice {
  margin-bottom: 12px;
  padding: 10px 14px;
  border-radius: 8px;
  background: #fff3e0;
  color: #8a4b00;
  font-size: 13px;
  line-height: 1.4;
}

.pcal-weekdays,
.pcal-grid {
  display: grid;
  gap: 6px;
  grid-auto-rows: 1fr;
}

/*
 * The open day panel is inserted as a SIBLING of the cells (.pcal-week is display:contents),
 * so it occupies its own implicit row. With 1fr rows every track matches the tallest, which
 * made the panel's height propagate into every cell. Stop equalising while it is open — rows
 * fall back to their own content, which is what they did before the equalisation existed.
 */
.pcal-grid:has(.pcal-panel--inline) {
  grid-auto-rows: auto;
}

.pcal-cols-1 {
  grid-template-columns: repeat(1, minmax(0, 1fr));
}
.pcal-cols-2 {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}
.pcal-cols-3 {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}
.pcal-cols-4 {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}
.pcal-cols-5 {
  grid-template-columns: repeat(5, minmax(0, 1fr));
}
.pcal-cols-6 {
  grid-template-columns: repeat(6, minmax(0, 1fr));
}
.pcal-cols-7 {
  grid-template-columns: repeat(7, minmax(0, 1fr));
}

.pcal-weekdays {
  margin-bottom: 6px;
}

.pcal-weekday {
  text-align: center;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.08em;
  color: var(--pcal-muted);
  text-transform: uppercase;
}

.pcal-weekday abbr {
  text-decoration: none;
  border-bottom: none;
  cursor: default;
}

.pcal-weekday-min {
  display: none;
}

.pcal-week {
  display: contents;
}

.pcal-cell {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-height: 104px;
  padding: 6px 7px;
  border: 1px solid var(--pcal-border);
  border-radius: 8px;
  background: #fff;
  overflow: hidden;
  transition:
    box-shadow 0.15s ease,
    border-color 0.15s ease;
}

.pcal-cell--outside {
  border-color: transparent;
  background: transparent;
}

.pcal-cell.is-empty {
  background: #fcfcfc;
}

.pcal-date {
  font-size: 14px;
  font-weight: 700;
  color: #212121;
  line-height: 1.2;
}

.pcal-cell.is-empty .pcal-date,
.pcal-cell.is-past .pcal-date {
  color: #9a9a9a;
}

.pcal-cell.is-today {
  border-color: var(--primary-button-color);
}

.pcal-cell.is-today::before {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  left: 0;
  width: 3px;
  border-radius: 8px 0 0 8px;
  background: var(--primary-button-color);
}

.pcal-cell.is-today .pcal-date {
  color: var(--primary-button-color);
}

.pcal-cell.is-past {
  opacity: 0.5;
}

.pcal-cell.is-interactive {
  cursor: pointer;
}

.pcal-cell.is-interactive:hover {
  border-color: #bdbdbd;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.07);
}

.pcal-cell.is-interactive:focus-visible {
  outline: 2px solid var(--primary-button-color);
  outline-offset: 2px;
}

.pcal-cell.is-selected {
  border-color: var(--primary-button-color);
  outline: 2px solid var(--primary-button-color);
  outline-offset: -2px;
}

.pcal-cell.is-selected.is-interactive:focus-visible {
  outline-offset: 2px;
}

.pcal-cell.is-enrolled {
  background: #e8f5e9;
  border-color: #a5d6a7;
}

.pcal-cell.is-open {
  border-color: var(--primary-button-color);
}

.pcal-cell.is-other-programming .pcal-chips,
.pcal-cell.is-other-programming .pcal-dots {
  opacity: 0.55;
}

.pcal-cell.is-closed {
  background-image: repeating-linear-gradient(
    45deg,
    #f7f7f7,
    #f7f7f7 5px,
    #efefef 5px,
    #efefef 10px
  );
}

.pcal-closed-tag {
  align-self: flex-start;
  margin-top: 2px;
  padding: 2px 7px;
  border-radius: 10px;
  background: #9a9a9a;
  color: #fff;
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.06em;
}

.pcal-closed-reason {
  font-size: 11px;
  line-height: 1.25;
  color: #6b6b6b;
  word-break: break-word;
}

.pcal-chips {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}

.pcal-chip {
  display: flex;
  flex-direction: column;
  gap: 1px;
  min-width: 0;
  padding: 4px 6px;
  border-left: 3px solid #1e7a37;
  border-radius: 4px;
  background: #f6f9f6;
}

.pcal-chip--enrolled {
  border-left-color: #2e7d32;
  background: #e8f5e9;
}

.pcal-chip--full {
  border-left-color: #dc3545;
  background: #fdf3f4;
}

.pcal-chip--past,
.pcal-chip--cancelled,
.pcal-chip--unavailable {
  border-left-color: #bdbdbd;
  background: #f7f7f7;
}

.pcal-chip-name {
  font-size: 12px;
  font-weight: 700;
  color: #212121;
  line-height: 1.25;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  word-break: break-word;
}

.pcal-chip-time {
  font-size: 11px;
  color: #555;
}

.pcal-chip-desc {
  font-size: 11px;
  line-height: 1.3;
  color: var(--pcal-muted);
  overflow: hidden;
  display: -webkit-box;
  /* Cells are sized to fit this many lines; keep the two in step if either changes. */
  -webkit-line-clamp: 5;
  -webkit-box-orient: vertical;
  word-break: break-word;
  white-space: pre-line;
}

.pcal-chip-status {
  margin-top: 2px;
}

.pcal-status-muted {
  font-size: 11px;
  color: #9a9a9a;
}

.spots-badge.pcal-spots-low {
  color: #b45309;
}

.pcal-more {
  font-size: 11px;
  font-weight: 600;
  color: var(--primary-button-color);
}

.pcal-tick {
  position: absolute;
  top: 4px;
  right: 5px;
  font-size: 12px;
  font-weight: 700;
  color: var(--primary-button-color);
}

.pcal-dots {
  display: none;
  align-items: center;
  justify-content: center;
  gap: 3px;
  flex: 1;
}

.pcal-dot {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: #1e7a37;
}

.pcal-dot--enrolled {
  background: #2e7d32;
}

.pcal-dot--full {
  background: #dc3545;
}

.pcal-dot--past,
.pcal-dot--cancelled,
.pcal-dot--unavailable {
  background: #bdbdbd;
}

.pcal-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 16px;
  height: 16px;
  padding: 0 4px;
  border-radius: 8px;
  background: var(--primary-button-color);
  color: #fff;
  font-size: 10px;
  font-weight: 700;
}

.pcal-empty {
  text-align: center;
  padding: 28px 16px 8px;
}

.pcal-empty-img {
  width: 72px;
  opacity: 0.5;
  margin-bottom: 10px;
}

.pcal-empty-text {
  margin: 0;
  color: #999;
  font-size: 14px;
}

/* Outranks the per-tier floors below, which are declared later at equal specificity —
   without the extra qualifier an empty month still rendered full-height cells. */
.pcal-root .pcal-grid.is-empty-month .pcal-cell {
  min-height: 64px;
}

.pcal-panel {
  position: relative;
  margin: 4px 0 8px;
  padding: 14px 16px 12px;
  border: 1px solid var(--pcal-border);
  border-radius: 10px;
  background: #fff;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.06);
  animation: pcal-panel-in 0.18s ease-out;
}

.pcal-panel--inline {
  grid-column: 1 / -1;
}

@keyframes pcal-panel-in {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.pcal-panel-grab {
  display: none;
}

.pcal-panel-close {
  position: absolute;
  top: 8px;
  right: 10px;
  min-width: 32px;
  min-height: 32px;
  line-height: 1;
}

.pcal-panel-head {
  margin-bottom: 10px;
  padding-right: 40px;
}

.pcal-panel-date {
  font-size: 15px;
  font-weight: 700;
  color: #212121;
}

.pcal-panel-sub {
  font-size: 12px;
  color: var(--pcal-muted);
}

.pcal-panel .session-instances-list {
  max-height: 60vh;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

/* The panel is where the description is read, and the list above scrolls — no clamp here. */
.pcal-panel .session-instance-desc {
  display: block;
  -webkit-line-clamp: none;
  overflow: visible;
}

.pcal-panel .session-mode-toggle {
  margin-bottom: 10px;
  border-bottom: none;
  border-radius: 6px;
}

.pcal-row-locked {
  opacity: 0.55;
}

.pcal-row-past {
  opacity: 0.5;
}

.pcal-bar {
  position: sticky;
  bottom: 0;
  z-index: 4;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 12px;
  padding: 12px 0 calc(12px + env(safe-area-inset-bottom, 0px));
  border-top: 1px solid var(--pcal-border);
  background: #fff;
}

.pcal-bar[hidden] {
  display: none;
}

.pcal-bar-info {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 4px 10px;
  min-width: 0;
  font-size: 13px;
}

.pcal-bar-count {
  font-weight: 700;
  color: #212121;
}

.pcal-bar-programming {
  color: var(--pcal-muted);
}

.pcal-bar-price {
  font-weight: 700;
  color: #212121;
}

.pcal-bar-savings {
  color: #2e7d32;
  font-weight: 600;
  font-size: 12px;
}

.pcal-bar-deposit {
  flex-basis: 100%;
  color: #8a4b00;
  font-size: 12px;
}

.pcal-bar-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.pcal-bar-clear {
  padding: 8px 14px;
  border: 1px solid var(--pcal-border);
  border-radius: 6px;
  background: #fff;
  color: #555;
  font-size: 13px;
  cursor: pointer;
}

.pcal-bar-clear:hover:not(:disabled) {
  border-color: #dc3545;
  color: #dc3545;
}

.pcal-bar-enroll {
  width: auto;
  min-width: 200px;
  text-align: center;
}

.pcal-root.pcal--wide .pcal-cell {
  min-height: 118px;
}

.pcal-root.pcal--wide .pcal-chip-desc {
  -webkit-line-clamp: 8;
}

.pcal-root.pcal--mid .pcal-cell {
  min-height: 96px;
}

/* Was display:none — a two-line summary is more useful than nothing at this width. */
.pcal-root.pcal--mid .pcal-chip-desc {
  -webkit-line-clamp: 2;
}

.pcal-root.pcal--mid .pcal-chip-name {
  -webkit-line-clamp: 1;
}

@media (max-width: 600px) {
  .pcal-root.pcal--compact {
    margin-left: -10px;
    margin-right: -10px;
  }

  .pcal-root.pcal--compact .pcal-header,
  .pcal-root.pcal--compact .pcal-programmings,
  .pcal-root.pcal--compact .pcal-notice,
  .pcal-root.pcal--compact .pcal-weekdays,
  .pcal-root.pcal--compact .pcal-grid,
  .pcal-root.pcal--compact .pcal-bar,
  .pcal-root.pcal--compact .pcal-empty {
    padding-left: 10px;
    padding-right: 10px;
  }
}

.pcal-root.pcal--compact .pcal-weekdays,
.pcal-root.pcal--compact .pcal-grid {
  gap: 4px;
}

.pcal-root.pcal--compact .pcal-cell {
  aspect-ratio: 1 / 1;
  min-height: 44px;
  align-items: center;
  gap: 1px;
  padding: 4px 2px;
  border-radius: 6px;
}

.pcal-root.pcal--compact .pcal-date {
  font-size: 13px;
}

.pcal-root.pcal--compact .pcal-chips,
.pcal-root.pcal--compact .pcal-closed-reason {
  display: none;
}

.pcal-root.pcal--compact .pcal-dots {
  display: flex;
}

.pcal-root.pcal--compact .pcal-closed-tag {
  align-self: center;
  margin-top: 0;
  padding: 1px 4px;
  font-size: 7px;
  letter-spacing: 0;
}

.pcal-root.pcal--compact .pcal-tick {
  top: 2px;
  right: 3px;
  font-size: 10px;
}

.pcal-root.pcal--compact .pcal-month {
  font-size: 15px;
  margin: 0 2px;
}

.pcal-root.pcal--compact .pcal-header {
  padding-top: 6px;
  padding-bottom: 8px;
}

.pcal-root.pcal--compact .pcal-nav-btn,
.pcal-root.pcal--compact .pcal-today-btn {
  min-height: 44px;
}

.pcal-root.pcal--compact .pcal-today-btn {
  padding: 8px 12px;
}

.pcal-root.pcal--compact .pcal-weekdays.pcal-cols-6 .pcal-weekday-short,
.pcal-root.pcal--compact .pcal-weekdays.pcal-cols-7 .pcal-weekday-short {
  display: none;
}

.pcal-root.pcal--compact .pcal-weekdays.pcal-cols-6 .pcal-weekday-min,
.pcal-root.pcal--compact .pcal-weekdays.pcal-cols-7 .pcal-weekday-min {
  display: inline;
}

.pcal-root.pcal--compact .pcal-panel--sheet {
  margin: 10px 0 0;
  padding-top: 20px;
  border-left: none;
  border-right: none;
  border-bottom: none;
  border-radius: 12px 12px 0 0;
  box-shadow: 0 -6px 20px rgba(0, 0, 0, 0.12);
}

.pcal-root.pcal--compact .pcal-panel-grab {
  display: block;
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 100%;
  max-width: 120px;
  height: 20px;
  padding: 0;
  border: none;
  background: transparent;
  cursor: pointer;
}

.pcal-root.pcal--compact .pcal-panel-grab::after {
  content: "";
  display: block;
  width: 36px;
  height: 4px;
  margin: 8px auto 0;
  border-radius: 2px;
  background: #e0e0e0;
}

.pcal-root.pcal--compact .pcal-panel-close {
  min-width: 44px;
  min-height: 44px;
}

.pcal-root.pcal--compact .session-addon-step {
  width: 40px;
  height: 40px;
}

.pcal-root.pcal--compact .pcal-bar {
  flex-direction: column;
  align-items: stretch;
}

.pcal-root.pcal--compact .pcal-bar-actions {
  width: 100%;
}

.pcal-root.pcal--compact .pcal-bar-enroll {
  flex: 1;
  min-width: 0;
}

@media (prefers-reduced-motion: reduce) {
  .pcal-panel {
    animation: none;
  }

  .pcal-cell,
  .pcal-nav-btn {
    transition: none;
  }
}
