.calendar-shell {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 16px;
  align-items: start;
}

.day-summary-section {
  display: grid;
  gap: 8px;
  margin-top: 12px;
}

.day-summary-section:first-of-type {
  margin-top: 0;
}

.day-summary-section__title {
  font-size: 45px;
  font-weight: 800;
  letter-spacing: 0.02em;
  color: var(--muted);
  text-transform: uppercase;
}


.calendar-mini-month {
  background: rgba(255,255,255,0.72);
  border-radius: 18px;
  padding: 14px;
  border: 1px solid rgba(219, 227, 239, 0.7);
  min-width: 0;
}

.calendar-month-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.calendar-month-title {
  margin: 0;
  font-size: 45px;
  line-height: 1.1;
}

.calendar-month-actions {
  display: flex;
  gap: 8px;
}

.calendar-weekdays {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 8px;
  margin-bottom: 8px;
}

.calendar-weekday {
  text-align: center;
  font-size: 45px;
  font-weight: 700;
  color: var(--muted);
  padding: 4px 0;
  min-width: 0;
}

.calendar-mini-month__grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 8px;
  min-width: 0;
}

.calendar-day,
.calendar-day--empty {
  aspect-ratio: 1 / 1;
  min-width: 0;
  border-radius: 16px;
  padding: 8px;
  overflow: hidden;
  box-sizing: border-box;
}

.calendar-day {
  border: 1px solid rgba(190, 204, 224, 0.8);
  background: #fff;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  text-align: left;
  transition: transform 140ms ease, box-shadow 140ms ease, border-color 140ms ease;
}

.calendar-day:hover {
  transform: translateY(-1px);
}

.calendar-day--empty {
  background: rgba(255,255,255,0.35);
  border: 1px dashed rgba(190, 204, 224, 0.45);
}

.calendar-day__num {
  font-weight: 700;
  font-size: clamp(11px, 1vw, 45px);
  line-height: 1;
}

.calendar-day__dots {
  display: flex;
  gap: 4px;
  flex-wrap: wrap;
  align-items: center;
  min-height: 12px;
}

.calendar-day.is-today {
  border-color: #7aa2ff;
  box-shadow: 0 0 0 3px rgba(122, 162, 255, 0.18);
}

.calendar-day.is-selected {
  border-color: #4f7fe8;
  box-shadow: 0 0 0 3px rgba(79, 127, 232, 0.22);
  background: #f4f8ff;
}

.calendar-day.is-today .calendar-day__num {
  color: #315aa7;
}

.calendar-day.is-selected .calendar-day__num {
  color: #214783;
}

.dot {
  width: 32px;
  height: 32px;
  border-radius: 999px;
  flex: 0 0 auto;
}

.event-color-swatches {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 6px;
}

.event-color-swatch {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  border: 1px solid #dbe3ef;
  border-radius: 999px;
  background: #fff;
  cursor: pointer;
  transition: transform 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
}

.event-color-swatch:hover {
  transform: translateY(-1px);
  border-color: #b9c9df;
}

.event-color-swatch.is-selected {
  border-color: #7aa2ff;
  box-shadow: 0 0 0 3px rgba(122, 162, 255, 0.16);
}

.event-color-swatch__dot {
  width: 32px;
  height: 32px;
  border-radius: 999px;
  border: 1px solid rgba(0, 0, 0, 0.12);
  flex: 0 0 auto;
}

.event-color-swatch__label {
  font-size: 45px;
  line-height: 1;
  white-space: nowrap;
}

.day-summary-panel {
  background: rgba(255,255,255,0.72);
  border-radius: 18px;
  padding: 14px;
  border: 1px solid rgba(219, 227, 239, 0.7);
  min-width: 0;
  max-height: 650px;
  overflow: scroll;
  border-radius: 14px;
}

.day-summary-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 8px;
}

.day-event-list {
  display: grid;
  gap: 10px;
}

.day-event-item {
  /*display: grid*/
  grid-template-columns: 92px 1fr;
  gap: 10px;
  padding: 10px 0;
  border-bottom: 1px dashed rgba(57, 76, 96, 0.18);
}

.event-time {
  color: var(--muted);
  font-weight: 700;
}

.calendar-month-headline {
  display: grid;
  gap: 8px;
  min-width: 0;
}

.calendar-weather-switch {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.calendar-weather-switch__btn {
  appearance: none;
  border: 1px solid rgba(190, 204, 224, 0.9);
  background: #fff;
  color: #29415f;
  border-radius: 999px;
  padding: 8px 14px;
  font-size: 24px;
  font-weight: 700;
  line-height: 1;
  cursor: pointer;
  transition: transform 140ms ease, box-shadow 140ms ease, border-color 140ms ease, background 140ms ease;
}

.calendar-weather-switch__btn:hover {
  transform: translateY(-1px);
  border-color: #b9c9df;
}

.calendar-weather-switch__btn.is-active {
  border-color: #7aa2ff;
  box-shadow: 0 0 0 3px rgba(122, 162, 255, 0.16);
  background: #f4f8ff;
  color: #214783;
}

.calendar-day {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.calendar-day__top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 6px;
}

.calendar-day__bottom {
  margin-top: auto;
}

.calendar-day__weather {
  display: grid;
  justify-items: end;
  gap: 2px;
  min-width: 0;
  text-align: right;
}

.calendar-day__weather--empty {
  min-height: 34px;
}

.calendar-day__weather-icon {
  font-size: 22px;
  line-height: 1;
}

.calendar-day__weather-temps {
  font-size: 13px;
  font-weight: 700;
  color: var(--muted);
  line-height: 1;
  white-space: nowrap;
}

.calendar-day__num {
  font-weight: 700;
  font-size: clamp(11px, 1vw, 45px);
  line-height: 1;
}

.calendar-day__dots {
  display: flex;
  gap: 4px;
  flex-wrap: wrap;
  align-items: center;
  min-height: 12px;
  margin-top: 6px;
}

@media (min-width: 1000px) {
.calendar-weekday {
    font-size: 12px;
}

.calendar-weather-switch__btn {
    font-size: 10px;
    font-weight: 700;
}

.calendar-day__weather {
  justify-items: end;
  gap: 2px;
  min-width: 0;
  text-align: right;
}

.calendar-day__weather--empty {
  min-height: 12px;
}

.calendar-day__weather-icon {
  font-size: 12px;
  line-height: 1;
}

.calendar-day__weather-temps {
  font-size: 12px;
  font-weight: 700;
  color: var(--muted);
  line-height: 1;
  white-space: nowrap;
}

.event-color-swatch__dot {
  width: 10px;
  height: 10px;
  border-radius: 999px;
  border: 1px solid rgba(0, 0, 0, 0.12);
  flex: 0 0 auto;
}

.event-color-swatch__label {
  font-size: 20px;
  line-height: 1;
  white-space: nowrap;
}

.dot {
  width: 6px;
  height: 6px;
  border-radius: 999px;
  flex: 0 0 auto;
}

.day-summary-section__title {
    font-size: 14px;
    font-weight: 800;
    letter-spacing: 0.02em;
    color: var(--muted);
    text-transform: uppercase;
}

.day-event-item {
    /* display: grid; */
    grid-template-columns: 92px 1fr;
    gap: 10px;
    padding: 0 0;
    border-bottom: 1px dashed rgba(57, 76, 96, 0.18);
}

.calendar-mini-month {
    background: rgba(255, 255, 255, 0.72);
    border-radius: 18px;
    padding: 2px 4px 0px 4px;
    border: 1px solid rgba(219, 227, 239, 0.7);
    min-width: 0;
}

.day-summary-panel {
    background: rgba(255, 255, 255, 0.72);
    border-radius: 18px;
    padding: 6px 0px 10px 6px;
    border: 1px solid rgba(219, 227, 239, 0.7);
    min-width: 0;
    max-height: 650px;
    overflow: scroll;
    border-radius: 14px;
	max-height: 232px;
}

.calendar-shell {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 5px;
    align-items: start;
}

}

/* =========================================================
   DAY SUMMARY MODAL — 1280x720 optimized
   Add near the bottom of calendar.css or modals.css
   ========================================================= */

.day-summary-modal {
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-height: 0;
  height: 100%;
}

.day-summary-modal__head {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.day-summary-modal .mini-heading {
  margin: 0;
  font-size: clamp(18px, 2vw, 24px);
  line-height: 1.15;
}

.day-summary-modal__actions {
  flex: 0 0 auto;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

/* Make sure the global modal can hold a wide landscape layout */
#globalModalBackdrop.is-open #globalModalBody {
  min-height: 0;
}

#globalModalBody:has(.day-summary-modal) {
  width: min(1180px, 96vw);
  max-width: min(1180px, 96vw);
}

#globalModalBackdrop.is-open .modal-shell:has(.day-summary-modal),
#globalModalBackdrop.is-open .modal-card:has(.day-summary-modal),
#globalModalBackdrop.is-open .modal-panel:has(.day-summary-modal),
#globalModalBackdrop.is-open .global-modal:has(.day-summary-modal) {
  width: min(1220px, 97vw);
  max-width: min(1220px, 97vw);
  max-height: min(660px, 92vh);
}

/* Fallback in case your modal shell uses another wrapper */
#globalModalBody .day-summary-modal {
  max-height: min(620px, 84vh);
}

/* ---------------------------------------------------------
   COLUMN ROW
   --------------------------------------------------------- */

.day-summary-group-grid {
  display: grid !important;
  grid-auto-flow: column;
  grid-auto-columns: minmax(185px, 1fr);
  grid-template-columns: none !important;
  gap: 12px;
  align-items: stretch;
  overflow-x: auto;
  overflow-y: hidden;
  padding-bottom: 6px;
  min-height: 0;
  flex: 1 1 auto;

  scrollbar-width: thin;
}

.day-summary-group-grid::-webkit-scrollbar {
  height: 10px;
}

.day-summary-group-grid::-webkit-scrollbar-thumb {
  background: rgba(120, 145, 180, 0.35);
  border-radius: 999px;
}

.day-summary-group-grid::-webkit-scrollbar-track {
  background: rgba(0, 0, 0, 0.04);
  border-radius: 999px;
}

/* If the family count is small, stretch nicely across the row */
.day-summary-group-grid[data-columns="1"],
.day-summary-group-grid[data-columns="2"],
.day-summary-group-grid[data-columns="3"],
.day-summary-group-grid[data-columns="4"],
.day-summary-group-grid[data-columns="5"],
.day-summary-group-grid[data-columns="6"] {
  grid-auto-columns: minmax(180px, 1fr);
}

/* ---------------------------------------------------------
   INDIVIDUAL COLUMN CARD
   --------------------------------------------------------- */

.day-summary-group {
  display: flex;
  flex-direction: column;
  min-height: 0;
  height: 100%;
  max-height: 470px;

  border: 1px solid rgba(189, 203, 224, 0.95);
  border-radius: 18px;
  background: linear-gradient(
    180deg,
    rgba(255, 255, 255, 0.92) 0%,
    rgba(248, 251, 255, 0.84) 100%
  );
  box-shadow:
    0 10px 24px rgba(40, 70, 120, 0.08),
    inset 0 1px 0 rgba(255, 255, 255, 0.75);
  overflow: hidden;
}

.day-summary-group > div:first-child {
  flex: 0 0 auto;
  padding-bottom: 2px;
  border-bottom: 1px solid rgba(223, 231, 242, 0.9);
  margin-bottom: 10px !important;
}

.day-summary-group strong {
  color: #24324a;
}

.day-summary-group .muted {
  color: #6f7d93;
}

/* ---------------------------------------------------------
   EVENT STACK INSIDE EACH COLUMN
   --------------------------------------------------------- */

.day-summary-group > div:last-child {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  padding-right: 4px;

  scrollbar-width: thin;
}

.day-summary-group > div:last-child::-webkit-scrollbar {
  width: 9px;
}

.day-summary-group > div:last-child::-webkit-scrollbar-thumb {
  background: rgba(120, 145, 180, 0.32);
  border-radius: 999px;
}

.day-summary-group > div:last-child::-webkit-scrollbar-track {
  background: rgba(0, 0, 0, 0.035);
  border-radius: 999px;
}

.day-summary-group .day-event-item {
  transition: transform 0.14s ease, box-shadow 0.14s ease;
}

.day-summary-group .day-event-item:hover {
  transform: translateY(-1px);
  box-shadow: 0 8px 18px rgba(38, 66, 110, 0.08);
}

/* Event title clamp */
.day-summary-group .day-event-item strong,
.day-summary-group .event-title {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  white-space: normal !important;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.22;
}

/* Button row inside event cards */
.day-summary-group .day-event-item .btn,
.day-summary-group .day-event-item .btn-soft {
  min-height: 34px;
  padding: 6px 10px;
  border-radius: 12px;
}

/* Empty state */
.day-summary-group .empty-state {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 90px;
  border: 1px dashed rgba(190, 205, 225, 0.95);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.58);
  color: #7a8798;
  font-size: 13px;
  text-align: center;
  padding: 12px;
}

/* ---------------------------------------------------------
   AVATARS
   --------------------------------------------------------- */

.day-summary-group img,
.day-summary-group [aria-label][title] {
  flex: 0 0 auto;
}

.day-summary-group img {
  background: #fff;
}

.day-summary-group [aria-label][title] {
  font-size: 14px;
  letter-spacing: 0.02em;
}

/* ---------------------------------------------------------
   MODAL BODY POLISH
   --------------------------------------------------------- */

#globalModalBody .day-summary-modal {
  padding-top: 2px;
}

#globalModalBody .day-summary-modal .btn {
  min-height: 38px;
  border-radius: 14px;
}

#globalModalBody .day-summary-modal .btn-soft {
  border-radius: 14px;
}

/* ---------------------------------------------------------
   1280 x 720 tuning
   --------------------------------------------------------- */

@media (max-width: 1280px) {
  #globalModalBody:has(.day-summary-modal) {
    width: min(1160px, 95vw);
    max-width: min(1160px, 95vw);
  }

  .day-summary-group-grid {
    gap: 10px;
    grid-auto-columns: minmax(172px, 1fr);
  }

  .day-summary-group {
    max-height: 445px;
  }

  .day-summary-modal .mini-heading {
    font-size: 20px;
  }
}

@media (max-width: 640px) {
  .day-summary-group-grid {
    grid-auto-columns: minmax(220px, 220px);
  }
  
  .calendar-month-title {
    margin: 0;
    font-size: 20px;
    line-height: 1.1;
}

.calendar-month-actions {
    display: flex;
    gap: 8px;
}

.js-calendar-open-overlay {
	font-size: 8px;
}	

.js-calendar-toggle-weeks {
	font-size: 8px;
}	
 
.js-calendar-prev-month 
.js-calendar-next-month{
  font-size: 8px;
  
}

.calendar-weather-switch__btn {
    appearance: none;
    border: 1px solid rgba(190, 204, 224, 0.9);
    background: #fff;
    color: #29415f;
    border-radius: 8px;
    padding: 3px 7px;
    font-size: 7px;
    font-weight: 700;
    line-height: 1;
    cursor: pointer;
    transition: transform 140ms ease, box-shadow 140ms ease, border-color 140ms ease, background 140ms ease;
}

.calendar-month-headline {
    display: flex;
    gap: 8px;
    min-width: 0;
    align-items: center;
}

.calendar-weekday {
    text-align: center;
    font-size: 14px;
    font-weight: 700;
    color: var(--muted);
    padding: 4px 0;
    min-width: 0;
}
.calendar-mini-month__grid {
    display: grid;
    grid-template-columns: repeat(7, minmax(0, 1fr));
    gap: 3px;
    min-width: 0;
}

.calendar-day, .calendar-day--empty {
    aspect-ratio: 1 / 1;
    min-width: 0;
    border-radius: 8px;
    padding: 4px;
    overflow: hidden;
    box-sizing: border-box;
}

calendar-day__top {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 0;
}

.calendar-day__weather-temps {
    font-size: 7px;
    font-weight: 700;
    color: var(--muted);
    line-height: 1;
    white-space: nowrap;
}

.calendar-day__weather-icon {
    font-size: 12px;
    line-height: 1;
}

.dot {
    width: 4px;
    height: 4px;
    border-radius: 999px;
    flex: 0 0 auto;
}

.day-summary-section__title {
    font-size: 12px;
    font-weight: 800;
    letter-spacing: 0.02em;
    color: var(--muted);
    text-transform: uppercase;
}

.event-color-swatch__label {
    font-size: 12px;
    line-height: 1;
    white-space: nowrap;
}

.event-color-swatch__dot {
    width: 12px;
    height: 12px;
    border-radius: 999px;
    border: 1px solid rgba(0, 0, 0, 0.12);
    flex: 0 0 auto;
}

.color-picker {
	display: none;
}

.form-row--split {
    display: flex;
    gap: 14px;
    flex-direction: row;
}

    .form-actions > * {
        width: 100%;
        height: 24px;
    }

#form-row-notes {
	display: none;
}

}

.day-event-row {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  flex-wrap: nowrap;
}

.event-dot {
  display: inline-block;
  width: 10px;
  height: 10px;
  border-radius: 999px;
  flex: 0 0 auto;
}

.event-time {
  flex: 0 0 auto;
}

.event-title {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  flex: 1 1 auto;
  font-size: 15px;
}

.event-source-label {
  font-size: 10px;
  white-space: nowrap;
  flex: 0 0 auto;
}

.event-actions-wrap {
  display: flex;
  align-items: center;
  gap: 6px;
  flex: 0 0 auto;
  position: relative;
}

.event-actions-inline {
  display: flex;
  align-items: center;
  gap: 6px;
}

.event-actions-menu {
  display: none;
  position: relative;
}

.event-actions-trigger {
  min-width: 36px;
  min-height: 36px;
  padding: 0 10px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
  font-size: 20px;
}

.event-actions-dropdown {
  display: none;
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  z-index: 9999;
  min-width: 140px;
  padding: 6px;
  border-radius: 10px;
  background: #fff;
  border: 1px solid rgba(0, 0, 0, 0.12);
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.18);
}

.event-actions-menu.is-open .event-actions-dropdown {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.event-actions-dropdown .btn {
  width: 100%;
  justify-content: flex-start;
  text-align: left;
}

.event-source-label-short {
  display: none;
}

@media (max-width: 640px) {
.calendar-day__top {
    display: flex;
    align-items: flex-start;
    justify-content: unset;
    gap: 0;
  }	
	
  .event-actions-inline {
    display: none !important;
  }

  .event-actions-menu {
    display: inline-block;
  }

/*  .event-source-label {
    display: none;
  }*/
  
  .event-time {
    color: var(--muted);
    font-weight: 700;
	font-size: 12px
}

.event-title {
    min-width: 0;
    overflow: scroll;
    text-overflow: ellipsis;
    white-space: nowrap;
    flex: 1 1 auto;
    font-size: 10px;
}

  .event-source-label-full {
    display: none;
  }

  .event-source-label-short {
    display: inline;
  }
  
}

/* ---------------------------------------------------------
   Optional: tighter event cards for dense days
   --------------------------------------------------------- */

.day-summary-group .day-event-item {
  padding: 9px 9px !important;
}

.day-summary-group .day-event-item .muted {
  font-size: 11px !important;
}

.day-summary-group .day-event-item strong {
  font-size: 13px !important;
}