.week-course {
  display: flex;
  align-items: end;
  gap: .5rem;
  margin-block: .6rem;
}
.week-course > .field { flex: 1; min-width: 0; }
.planning-tabs > button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .45rem;
  min-height: 44px;
}
.planning-choice-trigger {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .6rem;
  width: 100%;
  min-width: 0;
  min-height: 48px;
  padding: .65rem .85rem;
  background: var(--surface);
  text-align: start;
  white-space: normal;
}
.planning-choice-trigger > span:first-child { min-width: 0; overflow-wrap: anywhere; }
.planning-choice-chevron { display: inline-flex; flex: none; }
.planning-choice-chevron .ui-icon { width: 18px; height: 18px; }
.planning-choices .context-choice-row { min-height: 50px; }
.planning-choices .context-choice-symbol { width: 34px; height: 34px; }
.planning-content > .empty-state {
  grid-column: 1 / -1;
  min-width: 0;
  overflow-wrap: anywhere;
}
.week-day { display: grid; gap: .25rem; min-width: 0; }
.week-day + .week-day { margin-top: .4rem; }
.week-day h2 {
  margin: .25rem 0 .15rem;
  font-size: .9rem;
  text-align: start;
}
.calendar-entry.week-entry {
  display: flex;
  align-items: center;
  gap: .4rem;
  padding: .38rem .5rem;
  min-height: 53px;
}
.week-entry .week-open {
  display: grid;
  flex: 1;
  align-items: center;
  grid-template-columns: 3.25rem minmax(0, 1fr);
  width: 100%;
  column-gap: .55rem;
  min-height: 44px;
  min-width: 0;
  white-space: normal;
}
.week-entry .week-open:disabled { opacity: 1; cursor: default; }
.week-entry .action-menu { flex: none; }
.week-entry .action-menu > summary { min-width: 44px; min-height: 44px; }
.week-entry .calendar-copy {
  display: grid;
  gap: .18rem;
  min-width: 0;
  overflow-wrap: anywhere;
}
.week-row-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: .2rem .45rem;
  min-width: 0;
}
.week-row-meta > small { margin-top: 0; }
.week-course-name:empty { display: none; }
.week-time { display: grid; font-size: .8rem; font-variant-numeric: tabular-nums; text-align: start; }
.week-time small, .week-course-name { color: var(--muted); font-size: .76rem; }
.week-status {
  max-width: 100%;
  padding: .15rem .35rem;
  color: var(--text);
  background: var(--surface-2, #e0e8ec);
  border: 1px solid var(--line, #c5d4da);
  border-radius: .5rem;
  font-size: .72rem;
  font-weight: 700;
  white-space: normal;
  overflow-wrap: anywhere;
}
.week-status[data-week-status="held"] { color: #075344; background: #d7efe4; border-color: #b9d8cc; }
.week-status[data-week-status="cancelled"] { color: #822b3c; background: #ffe5eb; border-color: #ebc1cc; }
.week-status[data-week-status="unconfirmed"] { color: #6b4108; background: #ffefcc; border-color: #e8d1a0; }
.week-status[data-week-status="free"] { color: #343474; background: #e7e9fa; border-color: #ccd0f0; }
.week-events { display: flex; flex-wrap: wrap; gap: .25rem; }
.week-events button { min-height: 44px; text-align: start; font-size: .82rem; }
.week-followup { display: flex; justify-content: flex-end; }
.week-checks, .week-people { list-style: none; margin: 0; padding: 0; }
.week-checks > li, .week-people > li { border-bottom: 1px solid var(--line); padding-block: .45rem; }
.week-people > li { display: flex; flex-wrap: wrap; align-items: center; gap: .35rem .7rem; justify-content: space-between; }
.week-people > li > div { display: grid; }
.week-checks > li > label { display: flex; align-items: center; gap: .65rem; min-height: 38px; }
.week-checks [type="checkbox"] { flex: none; inline-size: 1.25rem; block-size: 1.25rem; }
.week-history-text { white-space: pre-wrap; overflow-wrap: anywhere; }
.week-history-note { display: grid; gap: .25rem; }
@media (max-width: 460px) {
  .week-entry .week-open { grid-template-columns: 2.8rem minmax(0, 1fr); column-gap: .45rem; }
  .week-entry .calendar-copy strong { font-size: .9rem; }
}

.planning-tabs > button {
  border-radius: 14px;
  box-shadow: none;
}
.planning-tabs > button[aria-pressed="true"] {
  color: var(--text);
  background: var(--selection);
  border-color: var(--brand);
}
.week-course:has(.planning-filter) { position: relative; }
.calendar-bar:has(.week-range) {
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr) 44px 44px;
  gap: .25rem;
}
.calendar-bar .week-range {
  border: 0;
  padding: .25rem;
  min-width: 0;
  min-height: 44px;
  text-align: center;
  font-weight: 700;
}
.calendar-bar .planning-filter > summary, .week-course .planning-filter > summary {
  width: 44px;
  height: 44px;
  padding: 0;
  display: grid;
  place-items: center;
}

.week-inline-detail { display: none; }
@media (min-width: 1100px) {
  #main:has(.week-inline-layout) {
    width: min(100%, 1060px);
    max-width: none;
  }
  .week-inline-layout {
    display: grid;
    grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr);
    align-items: start;
    gap: 1rem;
  }
  .week-inline-detail {
    position: sticky;
    top: 96px;
    max-height: calc(100dvh - 194px);
    overflow: auto;
    display: grid;
    gap: .65rem;
    min-width: 0;
    padding: 1rem;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 1.1rem;
    overflow-wrap: anywhere;
  }
  .week-inline-detail > h2 { margin: 0; font-size: 1.25rem; }
  .week-inline-detail > p { margin: 0; }
  .week-open[aria-current="true"] { background: var(--selection); }
}
