.cm-week-calendar {
  max-width: 1080px;
  min-width: 0;
}

.cm-week-calendar-card {
  padding: clamp(12px, 2.8vw, 23px);
  min-width: 0;
}

.cm-week-top, .cm-calendar-month-controls {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 9px;
}

.cm-week-range {
  min-width: 0;
  font-size: 15px;
  line-height: 1.4;
}

.cm-week-month {
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  gap: 6px;
  min-width: 0;
  min-height: 44px;
  padding: 6px 8px;
  border: 0;
  border-radius: 8px;
  color: var(--accent);
  background: transparent;
  font: inherit;
  font-size: 13px;
  text-align: right;
}

.cm-week-month svg, .cm-week-event-open > svg {
  width: 15px;
  height: 15px;
  flex: none;
}

.cm-week-month:hover, .cm-week-day:hover {
  background: var(--soft);
}

.cm-calendar-week-strip, .cm-calendar-month-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: clamp(3px, .7vw, 8px);
  text-align: center;
}

.cm-calendar-week-strip {
  touch-action: pan-y;
}

.cm-week-day {
  display: grid;
  justify-items: center;
  align-content: center;
  gap: 4px;
  min-width: 0;
  min-height: 69px;
  padding: 5px 0;
  background: transparent;
  border: 1px solid transparent;
  border-radius: 10px;
  color: var(--text);
}

.cm-week-day[aria-current='date'] {
  border-color: var(--line);
}

.cm-week-day.selected {
  border-color: var(--accent);
  background: var(--accent-soft);
}

.cm-week-day:focus-visible,
.cm-week-month:focus-visible,
.cm-week-event-open:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: -2px;
}

.cm-week-weekday {
  color: var(--muted);
  font-size: 11px;
  line-height: 1.25;
}

.cm-week-day.selected .cm-week-weekday {
  color: var(--accent);
}

.cm-week-number {
  position: relative;
  font-size: 18px;
  line-height: 1.15;
  font-weight: 750;
  font-variant-numeric: tabular-nums;
}

.cm-week-day.outside-month .cm-week-number {
  color: var(--muted);
}

.cm-week-dot {
  width: 5px;
  height: 5px;
  border-radius: 50%;
}

.cm-week-dot.has-event {
  background: var(--accent);
}

.cm-calendar-holiday {
  display: none;
}

.cm-winter .cm-calendar-holiday {
  display: block;
  position: absolute;
  top: 0;
  left: calc(100% + 1px);
  color: var(--gold);
  font-size: 9px;
  line-height: 1;
}

.cm-week-agenda {
  margin-top: 15px;
  padding-top: 15px;
  border-top: 1px solid var(--line);
}

.cm-week-agenda-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 9px 16px;
  margin-bottom: 11px;
}

.cm-week-agenda-head h2 {
  margin: 0;
  font-size: clamp(16px, 3vw, 21px);
  line-height: 1.3;
  overflow-wrap: anywhere;
}

.cm-week-agenda-head p, .cm-week-empty {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 12px;
}

.cm-week-create {
  min-height: 44px;
  white-space: normal;
}

.cm-week-events {
  display: grid;
  gap: 8px;
}

.cm-week-event {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--card);
  background: color-mix(in srgb, var(--card) 74%, var(--bg));
}

.cm-week-event.selected, .cm-week-event:hover {
  border-color: var(--accent);
}

.cm-week-event-open {
  display: grid;
  grid-template-columns: 58px minmax(0, 1fr) 15px;
  align-items: start;
  gap: 7px 12px;
  width: 100%;
  min-height: 44px;
  padding: 11px 12px;
  border: 0;
  border-radius: inherit;
  background: transparent;
  color: var(--text);
  font: inherit;
  text-align: left;
}

.cm-week-event-open time {
  color: var(--accent);
  font-size: 13px;
  font-weight: 730;
  font-variant-numeric: tabular-nums;
}

.cm-week-event-open > svg {
  align-self: center;
  color: var(--muted);
}

.cm-week-event-copy {
  display: grid;
  min-width: 0;
  gap: 4px;
  overflow-wrap: anywhere;
}

.cm-week-event-copy strong {
  font-size: 13px;
  line-height: 1.45;
}

.cm-week-event-copy small {
  color: var(--muted);
  font-size: 11px;
  line-height: 1.45;
  white-space: pre-wrap;
}

.cm-week-empty {
  padding: 7px 0 9px;
}

.cm-calendar-month-picker {
  width: min(100%, 430px);
}

.cm-calendar-month-controls strong {
  text-align: center;
}

.cm-week-month-step {
  flex: none;
  width: 40px;
  height: 40px;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.cm-week-month-step.prev svg {
  transform: rotate(180deg);
}

.cm-calendar-month-grid .cm-week-day {
  min-height: 38px;
  border-radius: 7px;
}

.cm-calendar-month-grid .cm-week-number { font-size: 13px; }
.cm-calendar-month-grid > .cm-week-weekday { padding-block: 4px; }

.cm-calendar-month-footer {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 4px 11px;
  margin-top: 8px;
}

.cm-calendar-month-footer .button { min-height: 40px; }
.cm-calendar-month-footer p, .cm-calendar-event-modal p { margin: 4px 0; color: var(--muted); font-size: 13px; }
.cm-calendar-event-modal p { white-space: pre-wrap; overflow-wrap: anywhere; }

@media (max-width: 490px) {
  .cm-week-range, .cm-week-month { font-size: 12px; }
  .cm-week-month { padding-inline: 5px; }
  .cm-week-day { min-height: 57px; border-radius: 8px; }
  .cm-week-number { font-size: 16px; }
  .cm-week-agenda { margin-top: 12px; padding-top: 12px; }
  .cm-week-event-open { grid-template-columns: 44px minmax(0, 1fr) 12px; gap: 7px; padding: 9px; }
}
