/* The selector and agenda share one calendar model at both widths. */
.week-view {
  display: grid;
  gap: 14px;
  min-width: 0;
  color: #eef4f3;
}
.week-header {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
}
.week-navigation {
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr) 44px;
  align-items: center;
  gap: 4px;
  width: min(100%, 410px);
}
.week-period {
  font-size: clamp(14px, 3.8vw, 18px);
  font-weight: 720;
  line-height: 1.25;
  text-align: center;
  text-wrap: balance;
}
.week-arrow,
.week-return {
  min-height: 44px;
  border: 1px solid #aedce73d;
  border-radius: 12px;
  background: linear-gradient(160deg, #6ea3b831, #10304150);
  box-shadow: inset 0 1px 0 #f4ffff20;
}
.week-arrow { display: grid; width: 44px; place-items: center; padding: 0; }
.week-return { padding-inline: 9px; color: #ccf9ec; font-size: 13px; font-weight: 680; }
.week-selector {
  position: sticky;
  top: max(4px, var(--tg-top));
  z-index: 3;
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 3px;
  padding: 4px;
  border: 1px solid #b6e4ef39;
  border-radius: 16px;
  background: linear-gradient(175deg, #244c5aec, #102d3ce6);
  box-shadow: inset 0 1px 0 #e7ffff28, 0 4px 11px #06152135;
  backdrop-filter: blur(8px);
}
.week-date {
  display: grid;
  min-width: 0;
  min-height: 58px;
  gap: 1px;
  align-content: center;
  justify-items: center;
  padding: 4px 0;
  border: 1px solid transparent;
  border-radius: 11px;
  background: transparent;
  color: #bdd5d9;
  line-height: 1.1;
}
.week-date-name { font-size: 11px; font-weight: 620; text-transform: capitalize; }
.week-date-number { font-size: 17px; font-weight: 750; font-variant-numeric: tabular-nums; color: #e8f4f3; }
.week-date-count { font-size: 11px; font-variant-numeric: tabular-nums; }
.week-date.is-today:not([aria-pressed="true"]) .week-date-number { color: #a4ffdf; }
.week-date[aria-pressed="true"] {
  border-color: #b7f5e886;
  background: linear-gradient(158deg, #80cdbc6b, #5c98aa52);
  box-shadow: inset 0 1px 3px #d5fff55a, inset 0 -1px 0 #95dbc95d;
  color: #e1fbf2;
}
.week-date[aria-pressed="true"] .week-date-number { color: #f2fffa; }
.week-arrow, .week-return, .week-date, .week-entry {
  transition: background-color 140ms ease, border-color 140ms ease, box-shadow 140ms ease;
}
.week-arrow:active, .week-return:active, .week-date:active, .week-entry:active {
  background-color: #92ecdc24;
}
.week-date:focus-visible { outline-offset: -2px; }
.week-calendar { min-width: 0; }
.week-agenda-day { display: none; min-width: 0; }
.week-agenda-day.is-selected { display: block; }
.week-agenda-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 9px;
  padding: 0 2px 6px;
}
.week-agenda-head h2 {
  font-size: clamp(17px, 4.7vw, 20px);
  font-weight: 730;
  text-transform: capitalize;
}
.week-agenda-head > span { color: #b0ccd1; font-size: 13px; white-space: nowrap; }
.week-entries { display: grid; gap: 5px; list-style: none; margin: 0; padding: 0; }
.week-entry {
  display: grid;
  width: 100%;
  min-height: 46px;
  grid-template-columns: minmax(0, 1fr) 15px;
  align-items: center;
  column-gap: 9px;
  row-gap: 2px;
  padding: 8px 11px;
  border: 1px solid #add5e036;
  border-radius: 12px;
  background: linear-gradient(165deg, #436d8050, #122b3969);
  color: #eef8f7;
  text-align: left;
  box-shadow: inset 0 1px 0 #d9fffa12;
}
.week-entry-title { grid-column: 1; overflow-wrap: anywhere; font-weight: 670; }
.week-entry-title > .icon { width: .87em; height: .87em; margin-right: 5px; color: #d3b9fa; }
.week-entry-meta { grid-column: 1; display: flex; flex-wrap: wrap; column-gap: 10px; row-gap: 1px; color: #b4ced3; font-size: 13px; }
.week-entry-meta time { color: #e0f1ef; font-variant-numeric: tabular-nums; }
.week-entry > .icon { grid-column: 2; grid-row: 1 / span 2; color: #9dbec5; }
.week-empty { padding: 8px 2px; color: #b1c9ce; font-size: 14px; }
.week-undated { margin-top: 5px; padding-top: 3px; border-top: 1px solid #a9d8e536; }
.week-undated > summary {
  display: flex;
  min-height: 44px;
  align-items: center;
  gap: 9px;
  padding: 5px 3px;
  cursor: pointer;
  font-weight: 650;
  list-style: none;
}
.week-undated > summary::-webkit-details-marker { display: none; }
.week-undated-count { color: #a9c7cd; font-size: 13px; font-weight: 500; }
.week-undated > summary .icon { margin-left: auto; color: #a9c7cd; }
.week-undated[open] > summary .icon { transform: rotate(90deg); }
.week-undated .week-entries { margin-bottom: 4px; }
@media (hover: hover) {
  .week-entry:hover, .week-arrow:hover, .week-return:hover {
    border-color: #b7ecdf80;
    background-color: #80c0cd16;
  }
}
@media (min-width: 1160px) {
  .week-header { justify-self: start; width: min(100%, 500px); }
  .week-selector { display: none; }
  .week-calendar { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 9px; }
  .week-agenda-day { display: block; border-top: 1px solid #b4deea31; }
  .week-agenda-day.is-today { border-top-color: #a6fce7ac; }
  .week-agenda-head { display: grid; gap: 1px; padding-block: 8px; }
  .week-agenda-head h2 { font-size: 16px; }
  .week-entry { grid-template-columns: minmax(0, 1fr); align-content: center; padding-inline: 8px; }
  .week-entry > .icon { display: none; }
  .week-entry-title { font-size: 14px; }
  .week-empty { font-size: 13px; }
  .week-undated .week-entries { grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); }
}
@media (prefers-reduced-motion: reduce) {
  .week-arrow, .week-return, .week-date, .week-entry { transition: none; }
}
