/* Termine & Kalender (PV-08): Monats- und Wochenansicht, Tagesliste.
   Ab 320 px ohne waagerechtes Scrollen; Fokus sichtbar über style.css. */
.cal-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 14px;
}
.cal-views,
.cal-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.cal-views button[aria-pressed="true"] {
  background: var(--brand);
  border-color: var(--brand);
  color: #fff;
}
.cal-nav button {
  min-width: 44px;
}
.cal-title {
  margin: 4px 0 12px;
}
.cal-layout {
  display: grid;
  gap: 18px;
  min-width: 0;
}
.cal-sheet {
  min-width: 0;
}
.cal-month {
  width: 100%;
  table-layout: fixed;
  border-collapse: separate;
  border-spacing: 3px;
}
.cal-month th {
  font-size: 12px;
  font-weight: 650;
  color: var(--muted);
  padding: 4px 0;
}
.cal-month abbr {
  text-decoration: none;
}
.cal-month td {
  padding: 0;
  vertical-align: top;
}
.cal-day {
  width: 100%;
  min-height: 52px;
  padding: 4px 3px;
  border-radius: 8px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  font-weight: 550;
  overflow: hidden;
}
.cal-other .cal-day {
  color: var(--muted);
  background: transparent;
}
.cal-day.selected {
  border: 2px solid var(--brand);
  background: #eee8f4;
}
.cal-num {
  line-height: 1.6;
  padding: 0 5px;
  border-radius: 999px;
}
.cal-day.today .cal-num {
  background: var(--brand);
  color: #fff;
}
.cal-count {
  min-width: 20px;
  border-radius: 999px;
  background: var(--accent);
  color: var(--ink);
  font-size: 12px;
  line-height: 20px;
  text-align: center;
}
.cal-previews {
  display: none;
}
.cal-keys {
  font-size: 13px;
  margin-top: 6px;
}
.cal-week {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 10px;
}
.cal-weekday {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 8px;
  min-width: 0;
}
.cal-weekday.selected {
  border-color: var(--brand);
}
.cal-weekday h3 {
  margin-bottom: 6px;
}
.cal-day.cal-day-wide {
  flex-direction: row;
  flex-wrap: wrap;
  justify-content: flex-start;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  padding: 8px 10px;
  text-align: left;
}
.cal-day-wide .badge {
  white-space: nowrap;
}
.cal-entries {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 12px;
}
.cal-entry {
  display: grid;
  gap: 2px;
  overflow-wrap: anywhere;
  min-width: 0;
}
.cal-time {
  font-size: 13px;
  font-weight: 650;
  color: var(--brand);
}
.cal-daypanel {
  margin-bottom: 0;
}
.cal-daypanel .panelhead {
  flex-wrap: wrap;
}
@media (min-width: 900px) {
  .cal-day {
    min-height: 92px;
    align-items: stretch;
    text-align: left;
  }
  .cal-day .cal-num,
  .cal-day .cal-count {
    align-self: flex-start;
  }
  .cal-previews {
    display: grid;
    gap: 1px;
    font-size: 12px;
    font-weight: 450;
    min-width: 0;
  }
  .cal-preview {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }
}
@media (min-width: 721px) {
  .cal-weekday {
    display: grid;
    grid-template-columns: minmax(150px, 220px) minmax(0, 1fr);
    gap: 14px;
    align-items: start;
  }
  .cal-weekday h3 {
    margin-bottom: 0;
  }
}
@media (min-width: 1100px) {
  .cal-layout-monat {
    grid-template-columns: minmax(0, 2fr) minmax(260px, 1fr);
    align-items: start;
  }
}
@media (max-width: 420px) {
  .cal-month {
    border-spacing: 1px;
  }
  .cal-day {
    padding: 3px 1px;
    font-size: 14px;
  }
  .cal-count {
    min-width: 18px;
    line-height: 18px;
    font-size: 11px;
  }
}
