.search input:not([type=checkbox]) {
  padding-left: 48px;
}

.public-shell .demo-list .list-row {
  min-height: 66px;
  padding: 10px 0;
}

.demo-list .avatar {
  width: 38px;
  height: 38px;
  border-radius: 13px;
}

.app-shell {
  min-width: 0;
}

.week-nav {
  display: flex;
  align-items: center;
  gap: 2px;
  margin-bottom: 18px;
}

.week-strip {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  flex: 1;
  min-width: 0;
}

.week-day {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 6px 0;
  font-size: 12px;
  color: var(--muted);
}

.week-day strong {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  font-size: 17px;
  color: var(--ink);
  border-radius: 50%;
}

.week-day.is-today strong {
  color: var(--danger);
}

.week-day.selected strong {
  background: var(--ink);
  color: var(--surface);
}

.week-arrow {
  display: grid;
  place-items: center;
  min-width: 40px;
  min-height: 54px;
  font-size: 26px;
}

.calendar-filters {
  display: flex;
  gap: 8px;
  overflow: auto;
  padding-bottom: 16px;
  scrollbar-width: none;
}

.master-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--master);
  flex: none;
}

.calendar-scroll {
  overflow: auto;
  max-height: 70dvh;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--surface);
  overscroll-behavior: contain;
  isolation: isolate;
}

.calendar-grid {
  display: grid;
  grid-template-columns: 52px repeat(var(--columns), minmax(176px, 1fr));
  min-width: calc(52px + var(--columns)*176px);
  position: relative;
}

.axis-header,
.master-header {
  position: sticky;
  top: 0;
  z-index: 5;
  height: 58px;
  background: var(--surface);
  border-bottom: 1px solid var(--line);
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 7px;
  font-size: 14px;
  font-weight: 650;
}

.axis-header {
  left: 0;
  z-index: 8;
  font-size: 11px;
  color: var(--muted);
}

.master-header {
  border-right: 1px solid var(--line);
  flex-wrap: wrap;
  align-content: center;
}

.master-header small {
  width: 100%;
  text-align: center;
  font-size: 12px;
  color: var(--muted);
  font-weight: 400;
}

.time-axis {
  position: sticky;
  left: 0;
  z-index: 4;
  background: var(--surface);
  height: var(--grid-height);
  border-right: 1px solid var(--line);
}

.time-axis>span {
  position: absolute;
  right: 8px;
  font-size: 12px;
  color: var(--muted);
  transform: translateY(3px);
}

.master-column {
  height: var(--grid-height);
  position: relative;
  border-right: 1px solid var(--line);
  background: repeating-linear-gradient(
    to bottom, transparent 0, transparent calc(var(--hour-height) - 1px),
    var(--line) calc(var(--hour-height) - 1px), var(--line) var(--hour-height)
  );
}

.day-off {
  background-color: var(--day-off);
}

/* Пустые клетки: одна форма на колонку, у кнопки только время; мастер и дата — скрытые поля */
.slot-column {
  position: absolute;
  inset: 0;
  display: grid;
  grid-auto-rows: var(--slot-height);
}

.slot-column button {
  border: 0;
  padding: 0 6px;
  background: none;
  color: transparent;
  font: 600 11px/var(--slot-height) var(--font);
  text-align: left;
  overflow: hidden;
}

.slot-column button:hover,
.slot-column button:focus-visible {
  background: color-mix(in srgb, var(--accent) 7%, transparent);
  color: var(--accent-text);
}

.slot-column button:focus-visible {
  z-index: 3;
}

.calendar-event {
  container-type: inline-size;
  overflow-wrap: normal;
  word-break: normal;
  position: absolute;
  z-index: 2;
  border: 0;
  border-left: 3px solid var(--master);
  border-radius: 5px;
  background: color-mix(in srgb, var(--master) 14%, white);
  color: color-mix(in srgb, var(--master) 55%, var(--ink));
  text-align: left;
  padding: 5px 6px;
  overflow: hidden;
  font-size: 12px;
  line-height: 1.35;
}

.calendar-event strong,
.calendar-event>span {
  display: block;
}

.calendar-event strong {
  font-weight: 650;
}

.calendar-event>span {
  font-size: 11px;
  margin-top: 2px;
}

.calendar-event.status-no_show {
  opacity: .5;
  text-decoration: line-through;
}

.calendar-event.kind-block {
  background: var(--block-bg);
  border-color: var(--block-line);
  color: var(--muted);
}

/* Только что записанная или перенесённая запись: видно, куда она встала */
.calendar-event[aria-current] {
  z-index: 3;
  outline: 2px solid var(--ink);
  outline-offset: 1px;
}

/* Закрытый визит отходит на задний план: видно, что на сегодня осталось */
.calendar-event.status-done {
  background: color-mix(in srgb, var(--master) 6%, var(--sidebar-bg));
  border-left-color: color-mix(in srgb, var(--master) 40%, var(--line));
  color: color-mix(in srgb, var(--master) 25%, var(--done-ink));
}

.online-badge {
  display: inline-block;
  background: var(--online-soft);
  color: var(--online-ink);
  border-radius: 4px;
  padding: 1px 5px;
  margin-top: 2px;
  font-size: 10px;
  font-weight: 650;
}

.now-line {
  position: absolute;
  width: 100%;
  height: 1px;
  background: var(--danger);
  z-index: 3;
  pointer-events: none;
}

.now-badge {
  position: absolute;
  right: 1px;
  background: var(--danger);
  color: var(--surface);
  border-radius: 4px;
  padding: 1px 3px;
  font-size: 11px;
  transform: translateY(-50%);
}

.floating-action {
  z-index: 18;
}

@media(max-width:679px) {
  .sheet-dialog {
    margin: 0;
    inset: auto 0 0;
    width: 100%;
    max-height: 92dvh;
    border-radius: 24px 24px 0 0;
  }

  #sheet-content {
    padding: 20px 20px max(24px, env(safe-area-inset-bottom));
  }

  .calendar-scroll {
    margin: 0 -8px;
    padding-bottom: 64px;
  }

  .upcoming-row {
    gap: 8px;
  }
}

.service-chip[hidden] {
  display: none;
}

#request-error {
  position: fixed;
  z-index: 80;
  bottom: 100px;
  left: 20px;
  right: 20px;
  color: white;
}

@media(min-width:1024px) {
  .main:has(.calendar-scroll) {
    max-width: none;
    padding-left: 24px;
    padding-right: 24px;
  }

  .calendar-grid {
    grid-template-columns: 48px repeat(var(--columns), minmax(0, 1fr));
    min-width: 0;
  }

  .calendar-event {
    padding: 4px;
    font-size: 12px;
    overflow-wrap: normal;
  }

  .master-column,
  .master-header {
    min-width: 0;
  }
}

.calendar-event strong,
.calendar-event > span {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

@container (width < 58px) {
  .event-services,
  .calendar-event > span,
  .online-badge {
    display: none;
  }
}

.calendar-event.status-cancelled {
  background: var(--surface-2);
  border-color: var(--muted);
  color: var(--muted);
}
