.calendar-page { display: grid; gap: 16px; min-width: 0; }
.calendar-controls { display: grid; gap: 10px; min-width: 0; }
.calendar-period-bar, .calendar-filter-bar, .calendar-date-controls {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  min-width: 0;
}
.calendar-period-bar { justify-content: space-between; }
.calendar-period-bar h2 {
  margin: 0;
  color: var(--navy);
  font: 400 clamp(21px, 2vw, 28px)/1.18 var(--serif);
}
.calendar-date-controls .icon-button { width: 38px; min-height: 38px; }
.calendar-date-controls .button { min-height: 38px; }
.calendar-filter-bar .scope-control button { min-height: 32px; }
.calendar-filter-bar .scope-control + .scope-control { margin-right: 4px; }
.calendar-filter-bar .filter { min-height: 38px; }
.calendar-filter-bar .filter-reset { margin-left: auto; }

.calendar-grid-wrap {
  container-type: inline-size;
  min-width: 0;
  overflow: hidden;
  border: 1px solid #dde2ef;
  border-radius: 15px;
  background: #fff;
}
.calendar-table {
  width: 100%;
  table-layout: fixed;
  border-spacing: 0;
  font-variant-numeric: tabular-nums;
}
.calendar-table th {
  padding: 9px 7px;
  border-bottom: 1px solid #dde2ef;
  color: var(--soft-ink);
  background: #f2f4fa;
  text-align: left;
  font-size: 11px;
  font-weight: 690;
}
.calendar-table th:nth-last-child(-n+2) { background: #ecf0f8; }
.calendar-weekday-short { display: none; }
.calendar-day {
  height: 103px;
  padding: 4px;
  border-right: 1px solid #e7eaf3;
  border-bottom: 1px solid #e7eaf3;
  vertical-align: top;
}
.calendar-table-week .calendar-day { height: 175px; }
.calendar-day:last-child { border-right: 0; }
.calendar-table tr:last-child > td { border-bottom: 0; }
.calendar-day:nth-last-child(-n+2) { background: #fcfcff; }
.calendar-day.calendar-day-outside { color: #626a81; background: #f6f7fb; }
.calendar-day.calendar-day-selected { background: #fff7da; }
.calendar-day-button {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 2px;
  width: 100%;
  min-height: 28px;
  min-width: 0;
  padding: 0 4px;
  border: 0;
  border-radius: 5px;
  color: inherit;
  background: transparent;
  text-align: left;
  font-size: 12px;
  line-height: 1;
}
.calendar-day-button:hover, .calendar-day-more:hover { background: #e9edf8; }
.calendar-day-button:focus-visible, .calendar-day-more:focus-visible, .calendar-post:focus-visible { outline-offset: -3px; }
.calendar-day-button time {
  display: grid;
  place-items: center;
  min-width: 23px;
  height: 23px;
  padding-inline: 2px;
  border-radius: 8px;
  font-weight: 650;
}
.calendar-day-today .calendar-day-button time { color: #fff; background: var(--indigo); }
.calendar-day-selected .calendar-day-button time { color: #29200b; background: var(--yellow); }
.calendar-day-count {
  color: var(--muted);
  font-size: 10px;
  font-weight: 680;
}
.calendar-day-posts {
  display: grid;
  gap: 3px;
  margin: 2px 0 0;
  padding: 0;
  list-style: none;
}
.calendar-post {
  --calendar-network-ink: #475377;
  --calendar-network-wash: #edf0f7;
  position: relative;
  display: grid;
  grid-template-columns: 25px minmax(0, 1fr);
  align-items: center;
  gap: 4px;
  min-width: 0;
  min-height: 32px;
  padding: 3px;
  border: 1px solid transparent;
  border-radius: 7px;
  color: var(--navy);
  background: var(--calendar-network-wash);
}
.calendar-post[data-network="instagram"] { --calendar-network-ink: #85365d; --calendar-network-wash: #f7edf3; }
.calendar-post[data-network="facebook"] { --calendar-network-ink: #245387; --calendar-network-wash: #eaf1fb; }
.calendar-post[data-network="tiktok"] { --calendar-network-ink: #28635b; --calendar-network-wash: #e6f2ef; }
.calendar-post[data-network="youtube"] { --calendar-network-ink: #8e3850; --calendar-network-wash: #f9edf0; }
.calendar-post:hover { border-color: var(--calendar-network-ink); }
.calendar-post-thumb {
  display: grid;
  place-items: center;
  width: 25px;
  height: 25px;
  overflow: hidden;
  border-radius: 4px;
  background: #fff8;
  color: var(--calendar-network-ink);
}
.calendar-post-thumb img, .calendar-post-thumb video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  pointer-events: none;
}
.calendar-post-thumb > .icon { width: 14px; height: 14px; }
.calendar-post-title {
  display: block;
  overflow: hidden;
  color: inherit;
  font-size: 11px;
  font-weight: 690;
  line-height: 1.25;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.calendar-post-meta {
  display: flex;
  align-items: center;
  gap: 3px;
  overflow: hidden;
  color: var(--calendar-network-ink);
  font-size: 9px;
  line-height: 1.2;
  white-space: nowrap;
}
.calendar-post-meta .icon { width: 10px; height: 10px; }
.calendar-post-meta time { font-weight: 560; }
.calendar-post-network-icon { display: none; }
.calendar-day-more {
  width: 100%;
  min-height: 26px;
  padding: 2px 3px;
  border: 0;
  border-radius: 4px;
  color: var(--indigo);
  background: transparent;
  text-align: left;
  font-size: 10px;
  font-weight: 700;
}
.calendar-selected-row > td { padding: 12px; border-bottom: 1px solid #e4d289; background: #fffdf3; }
.calendar-day-detail { display: grid; gap: 10px; min-width: 0; }
.calendar-day-detail-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 5px;
}
.calendar-day-detail-head h3 { color: var(--navy); font: 400 21px/1.2 var(--serif); }
.calendar-day-detail-head .button { min-height: 32px; }
.calendar-day-detail .card-grid { grid-template-columns: repeat(auto-fill, minmax(min(100%, 190px), 1fr)); }
.calendar-undated > h2 { margin-bottom: 9px; font: 400 23px/1.2 var(--serif); color: var(--navy); }
@container (max-width: 635px) {
  .calendar-table th { text-align: center; padding-inline: 1px; }
  .calendar-weekday-full { display: none; }
  .calendar-weekday-short { display: inline; }
  .calendar-day, .calendar-table-week .calendar-day { height: 66px; padding: 2px; }
  .calendar-day-button { min-height: 25px; padding: 0 2px; }
  .calendar-day-button time { min-width: 19px; height: 19px; }
  .calendar-day-count { font-size: 9px; }
  .calendar-day-posts li + li, .calendar-day-more, .calendar-post-text { display: none; }
  .calendar-post { display: block; min-height: 29px; padding: 2px; }
  .calendar-post-thumb { height: 25px; width: 100%; }
  .calendar-post-network-icon {
    display: grid;
    position: absolute;
    right: 0;
    bottom: 0;
    place-items: center;
    width: 16px;
    height: 16px;
    border-radius: 4px;
    color: var(--calendar-network-ink);
    background: var(--calendar-network-wash);
  }
  .calendar-post-network-icon .icon { width: 11px; height: 11px; }
}
@media (max-width: 630px) {
  .calendar-page { gap: 12px; }
  .calendar-controls { gap: 7px; }
  .calendar-period-bar, .calendar-filter-bar, .calendar-date-controls { gap: 5px; }
  .calendar-date-controls .icon-button, .calendar-date-controls .button { min-height: 40px; }
  .calendar-date-controls .icon-button { width: 40px; }
  .calendar-filter-bar { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .calendar-filter-bar .scope-control + .scope-control { margin-right: 0; }
  .calendar-filter-bar .scope-control button { flex: 1; min-height: 35px; }
  .calendar-filter-bar .filter select { flex: 1; width: 100%; min-width: 0; max-width: none; }
  .calendar-filter-bar .filter-reset { justify-self: start; margin-left: 0; }
  .calendar-selected-row > td { padding: 9px; }
}
