/* Weekly agenda: chronological days and readable cards at every screen size. */
.calendar-surface:has(> .week-grid) {
  min-height: 0;
  overflow: visible;
  border: 0;
  background: transparent;
  box-shadow: none;
}

.week-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  min-width: 0;
  gap: 9px;
  align-items: start;
}

.week-grid > .day-column,
.week-grid > .day-column:last-child {
  min-width: 0;
  min-height: 220px;
  padding-bottom: 2px;
  overflow: hidden;
  border: 1px solid #2b3d44;
  border-radius: 15px;
  background: #0d1b21;
}

.week-grid > .day-column.today {
  border-color: #cfe73c;
  background: #13231f;
}

.week-grid .day-label {
  position: static;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-content: center;
  min-height: 78px;
  padding: 13px 12px;
  border-bottom: 1px solid #2b3d44;
  background: #13232a;
  box-shadow: none;
}

.week-grid .day-label b {
  grid-column: 1;
  color: #f6f8f7;
  font-size: 14px;
  font-weight: 780;
  line-height: 1.35;
}

.week-grid .day-label span {
  grid-column: 1;
  color: #b9c8cc;
  font-size: 14px;
  line-height: 1.4;
}

.week-grid .day-label .day-count {
  grid-column: 2;
  grid-row: 1 / span 2;
  align-self: center;
  padding: 4px 6px;
  border-radius: 7px;
  background: #203239;
  color: #c8d5d9;
  text-align: center;
  font-variant-numeric: tabular-nums;
}

.week-grid .today .day-label {
  border-bottom-color: #4f6036;
  background: #243326;
}

.week-grid .today .day-label b {
  color: #e9ff3f;
}

.week-grid .event-card {
  display: grid;
  grid-template-columns: 26px minmax(0, 1fr);
  align-items: start;
  gap: 7px;
  margin: 8px 6px;
  padding: 12px 10px 10px 12px;
  border: 1px solid #33474e;
  border-radius: 11px;
  background: #122229;
  box-shadow: none;
  overflow-wrap: break-word;
  word-break: normal;
}

.week-grid .event-card::before {
  top: 10px;
  bottom: 10px;
  width: 3px;
}

.week-grid .event-card > time {
  grid-column: 1 / -1;
  grid-row: 1;
  min-width: 0;
  color: #e6eff1;
  font-size: 14px;
  font-weight: 750;
  line-height: 1.35;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.week-grid .event-card > .activity-mark {
  float: none;
  grid-column: 1;
  grid-row: 2;
  width: 26px;
  height: 28px;
  margin: 0;
  border-radius: 8px;
  font-size: 15px;
}

.week-grid .event-card > div:not(.event-actions) {
  grid-column: 2;
  grid-row: 2;
  min-width: 0;
}

.week-grid .event-card b {
  margin-top: 0;
  color: #f6f8f7;
  font-size: 14px;
  line-height: 1.35;
}

.week-grid .event-card small {
  margin-top: 4px;
  color: #c0d0d5;
  font-size: 14px;
  line-height: 1.5;
}

.week-grid .event-card .transport-summary {
  grid-column: 1 / -1;
  padding-top: 8px;
  margin-top: 2px;
  border-top: 1px solid #293f46;
}

.week-grid .event-actions {
  grid-column: 1 / -1;
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding-top: 3px;
  margin: 0;
}

.week-grid .event-actions button {
  width: 100%;
  min-height: 40px;
  padding: 8px 5px;
  border: 1px solid #42575e;
  border-radius: 8px;
  background: #203239;
  color: #e6eff1;
  font-size: 14px;
  line-height: 1.35;
  white-space: normal;
  overflow-wrap: normal;
  word-break: normal;
}

.week-grid .event-actions button:last-child {
  background: #17292f;
  color: #e9ff77;
}

.week-grid .event-actions button.done {
  border-color: #58774c;
  background: #2a402c;
  color: #e4f5d9;
}

.week-grid .event-note,
.week-grid .complete-badge {
  grid-column: 1 / -1;
  margin: 0;
}

.week-grid .complete-badge {
  position: static;
  order: 1;
  justify-self: start;
}

.week-grid .empty-day {
  margin: 0;
  padding: 17px 12px;
  color: #a5b9bf;
  font-size: 14px;
  line-height: 1.5;
}

@media (min-width: 761px) and (max-width: 1100px) {
  .week-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
  }
  .week-grid > .day-column {
    min-height: 0;
  }
  .week-grid .event-actions {
    flex-direction: row;
  }
}

@media (max-width: 760px) {
  .week-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 16px;
  }
  .week-grid > .day-column,
  .week-grid > .day-column:last-child {
    min-height: 0;
    padding-bottom: 2px;
    border-radius: 16px;
  }
  .week-grid .day-label {
    min-height: 58px;
    padding: 10px 14px;
  }
  .week-grid .day-label b {
    font-size: 15px;
  }
  .week-grid .event-card {
    grid-template-columns: 34px minmax(0, 1fr);
    gap: 7px 10px;
    margin: 9px;
    padding: 13px 13px 11px 15px;
  }
  .week-grid .event-card > time {
    grid-column: 2;
    grid-row: 1;
    font-size: 14px;
  }
  .week-grid .event-card > .activity-mark {
    grid-row: 1 / span 2;
    width: 34px;
    height: 38px;
    font-size: 18px;
  }
  .week-grid .event-card > div:not(.event-actions) {
    grid-row: 2;
  }
  .week-grid .event-card b {
    font-size: 16px;
  }
  .week-grid .event-card small {
    font-size: 14px;
  }
  .week-grid .event-card .transport-summary {
    padding-top: 8px;
  }
  .week-grid .event-actions {
    flex-direction: row;
    gap: 8px;
  }
  .week-grid .event-actions button {
    min-height: 44px;
    padding: 9px 7px;
    font-size: 14px;
  }
  .week-grid .empty-day {
    padding: 12px 14px;
  }
}

@media (hover: hover) {
  .week-grid .event-card:hover {
    border-color: #70858b;
    background: #182d34;
  }
  .week-grid .event-actions button:hover {
    border-color: #c7e644;
    background: #2d4033;
  }
}
