:root{--bg:#fff9fb;--surface:#fff;--text:#3b3037;--muted:#8e7c86;--line:#f0dfe7;--pink:#c66d92;--pink2:#f6e4ec;--shadow:0 8px 26px #9c6d8310}
*{box-sizing:border-box}body{margin:0;background:var(--bg);color:var(--text);font-family:system-ui,-apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif}body.dark{--bg:#201b20;--surface:#2c252c;--text:#f7edf2;--muted:#c0aeb9;--line:#493b46;--pink:#e8a0bf;--pink2:#4b3442;--shadow:0 8px 26px #0002}
header{display:flex;align-items:center;gap:12px;padding:20px max(18px,calc((100vw - 1000px)/2));background:var(--surface);border-bottom:1px solid var(--line)}.brand-mark{display:grid;place-items:center;width:46px;height:46px;border-radius:15px;background:linear-gradient(135deg,#f8d7e5,#e5a7c1);color:#9b4d70;font-size:30px}h1{font-size:20px;margin:0}header p{margin:2px 0 0;color:var(--muted);font-size:12px}.icon-button{margin-left:auto}
button,input,select{font:inherit}button{border:1px solid var(--line);background:var(--surface);color:var(--text);border-radius:12px;padding:10px 13px;cursor:pointer}button:active{transform:scale(.98)}.primary{background:var(--pink);color:white;border-color:var(--pink);font-weight:650}.main-nav{display:flex;gap:8px;max-width:1000px;margin:16px auto 0;padding:0 16px}.main-nav button{flex:1;border-radius:14px}.main-nav button.active{background:var(--pink2);border-color:#e4b4c8;color:var(--text);font-weight:700}main{max-width:1000px;margin:0 auto;padding:22px 16px 60px}.view{display:block}.hidden{display:none!important}.section-head{display:flex;align-items:center;justify-content:space-between;gap:12px;margin-bottom:16px}h2{font-size:25px;margin:2px 0 0}.eyebrow{font-size:10px;letter-spacing:.16em;color:var(--pink);font-weight:800;margin:0}.nav-buttons{display:flex;gap:5px}.week-label{color:var(--muted);margin:0 0 10px;font-size:13px}.week-grid{display:grid;grid-template-columns:repeat(7,minmax(0,1fr));gap:7px}.day{background:var(--surface);border:1px solid var(--line);border-radius:14px;padding:9px 5px;min-height:88px;text-align:center}.day.today{border:2px solid var(--pink)}.day strong{display:block;font-size:12px}.day span{display:block;color:var(--muted);font-size:11px;margin-top:5px}.card{background:var(--surface);border:1px solid var(--line);border-radius:18px;padding:18px;margin-top:18px;box-shadow:var(--shadow)}h3{margin:0 0 14px;font-size:17px}form{display:grid;gap:12px}label{display:grid;gap:6px;font-size:12px;color:var(--muted)}input,select{width:100%;min-width:0;padding:11px;border:1px solid var(--line);border-radius:11px;background:var(--bg);color:var(--text)}.form-row{display:grid;grid-template-columns:1fr 1fr;gap:10px}.booking-list{margin-top:18px;display:grid;gap:8px}.booking{display:flex;align-items:center;justify-content:space-between;gap:10px;background:var(--surface);border:1px solid var(--line);border-radius:13px;padding:12px}.booking small{display:block;color:var(--muted);margin-top:4px}.booking-actions{display:flex;gap:5px}.client-row,.slot-day{background:var(--surface);border:1px solid var(--line);border-radius:14px;padding:13px;margin:8px 0}.client-row{display:flex;align-items:center;justify-content:space-between;gap:10px}.client-row small{display:block;color:var(--muted);margin-top:4px}.search{margin-bottom:10px}.slot-day h3{margin-bottom:7px}.slot-chip{display:inline-block;margin:4px;padding:7px 9px;border-radius:10px;background:var(--pink2);font-size:12px}.empty{padding:18px;color:var(--muted);text-align:center;background:var(--surface);border:1px dashed var(--line);border-radius:14px}#toast {
  position: fixed;
  bottom: 18px;
  left: 50%;
  transform: translateX(-50%);
  background: #3b3037;
  color: white;
  border-radius: 12px;
  padding: 12px 16px;
  opacity: 0;
  pointer-events: none;
  transition: opacity .2s;
  max-width: min(90vw, 420px);
  z-index: 110;
  text-align: center;
}
#toast.show { opacity: 1; }

@media (max-width: 620px) {
  #toast {
    bottom: calc(76px + env(safe-area-inset-bottom, 0px));
    max-width: calc(100vw - 24px);
  }
}
@media(max-width:620px){header{padding:14px 16px}.week-grid{grid-template-columns:repeat(4,minmax(0,1fr))}.day{min-height:70px}.form-row{grid-template-columns:1fr}.section-head{align-items:flex-start}h2{font-size:22px}.booking{align-items:flex-start;flex-direction:column}.booking-actions{width:100%}.booking-actions button{flex:1}}

/* Calendar day mode */
.day.selected{background:var(--pink2);border:2px solid var(--pink);font-weight:700}
.day-heading{display:flex;align-items:center;justify-content:space-between;gap:12px;margin:8px 0 12px;padding:14px;background:var(--surface);border:1px solid var(--line);border-radius:14px}
.day-heading h3{margin:4px 0 0;text-transform:capitalize}
.day-actions{display:flex;justify-content:flex-end;margin-top:12px}
#booking-editor{margin-top:12px;scroll-margin-top:12px}
#bookings{margin-top:12px}
@media(max-width:620px){
  .week-grid{grid-template-columns:repeat(4,minmax(0,1fr))}
  .day-heading{align-items:flex-start;flex-direction:column}
  .day-actions .primary{width:100%;padding:13px}
  .nav-buttons button{padding:9px 11px}
}

/* Calendar layout correction: keep week visible in every mode */
.day-actions {
  display: flex;
  flex-direction: row;
  justify-content: flex-end;
  align-items: center;
  gap: 8px;
}
.day-actions .primary {
  width: auto;
  white-space: nowrap;
}
.day-heading {
  flex-direction: row;
  align-items: center;
}
@media(max-width:620px) {
  .day-actions {
    flex-direction: row;
    justify-content: stretch;
  }
  .day-actions .primary {
    width: 100%;
  }
  .day-heading {
    flex-direction: row;
    align-items: center;
  }
}


/* Единый компактный календарь: 7 дней в одну строку */
.week-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 4px;
  width: 100%;
}

.day {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  gap: 3px;
  min-width: 0;
  min-height: 78px;
  padding: 5px 1px;
  border: 1px solid transparent;
  border-radius: 10px;
  background: transparent;
  overflow: hidden;
}

.day .day-weekday {
  color: var(--muted);
  font-size: 10px;
  line-height: 1.2;
  margin: 0;
  text-transform: uppercase;
}

.day .day-number {
  display: grid;
  place-items: center;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  font-size: 13px;
  line-height: 1;
}

.day.today .day-number {
  background: var(--pink);
  color: #fff;
}

.day.selected {
  background: var(--pink2);
  border-color: var(--pink);
}

.day .booking-marks {
  display: flex;
  flex-direction: column;
  gap: 2px;
  width: 75%;
  min-height: 10px;
  margin-top: 1px;
}

.booking-mark {
  display: block;
  width: 100%;
  height: 3px;
  border-radius: 5px;
  background: #3988cc;
}

.day .booking-extra {
  margin: 0;
  color: var(--muted);
  font-size: 9px;
  line-height: 1.2;
  font-weight: 650;
}

.day .empty-count {
  visibility: hidden;
}

@media (max-width: 620px) {
  .week-grid {
    grid-template-columns: repeat(7, minmax(0, 1fr));
    gap: 1px;
  }
  .day {
    min-height: 0;
    padding: 4px 0;
    gap: 2px;
    border-radius: 8px;
  }
  .day .day-weekday {
    font-size: 9px;
  }
  .day .day-number {
    width: 23px;
    height: 23px;
    font-size: 12px;
  }
  .day .booking-marks {
    width: 72%;
    gap: 2px;
  }
  .booking-mark {
    height: 3px;
  }
  .day .booking-extra {
    font-size: 8px;
  }
  .section-head {
    gap: 6px;
  }
  .nav-buttons {
    gap: 3px;
  }
  .nav-buttons button {
    padding: 8px 10px;
  }
}


/* Фиксированная кнопка создания записи на мобильном */
@media (max-width: 620px) {
  body:has(#calendar:not(.hidden)) {
    padding-bottom: calc(92px + env(safe-area-inset-bottom, 0px));
  }

  #calendar .day-actions {
    position: fixed;
    z-index: 20;
    left: 12px;
    right: 12px;
    bottom: calc(12px + env(safe-area-inset-bottom, 0px));
    margin: 0;
    padding: 0;
  }

  #calendar .day-actions .primary {
    width: 100%;
    min-height: 50px;
    border-radius: 14px;
    box-shadow: 0 4px 18px #9c6d8330;
  }

  #calendar #booking-editor:not(.hidden) {
    margin-bottom: 12px;
  }
}


/* Month navigation */
.calendar-toolbar { align-items: center; }
.month-picker-wrap { position: relative; min-width: 0; }
.month-title {
  border: 0;
  background: transparent;
  padding: 6px 0;
  font-size: 21px;
  font-weight: 750;
  text-transform: capitalize;
  text-align: left;
}
.month-picker {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  z-index: 30;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  width: min(300px, calc(100vw - 36px));
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface);
  box-shadow: var(--shadow);
}
.month-picker.hidden { display: none !important; }
.month-picker .primary { grid-column: 1 / -1; }
@media(max-width:620px) {
  .calendar-toolbar { gap: 6px; }
  .month-title { font-size: 18px; }
  .calendar-toolbar .nav-buttons { gap: 3px; }
  .calendar-toolbar .nav-buttons button { padding: 9px 10px; }
}


/* Полноэкранный месячный обзор */
.month-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 3px;
  width: 100%;
}
.month-weekday {
  text-align: center;
  color: var(--muted);
  font-size: 11px;
  padding: 6px 0;
}
.month-day {
  min-width: 0;
  min-height: 55px;
  padding: 5px 1px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  border-radius: 9px;
}
.month-day > span:first-child {
  font-size: 13px;
}
.month-day.other-month { opacity: .35; }
.month-day.selected {
  border: 2px solid var(--pink);
  background: var(--pink2);
}
.month-day.today > span:first-child {
  background: var(--pink);
  color: white;
  border-radius: 50%;
  width: 23px;
  height: 23px;
  display: grid;
  place-items: center;
}
.month-day .booking-marks {
  display: flex;
  flex-direction: column;
  gap: 2px;
  width: 70%;
  min-height: 6px;
}
.month-day .booking-mark {
  display: block;
  width: 100%;
  height: 3px;
  border-radius: 4px;
  background: #3988cc;
}
.month-day small { font-size: 9px; color: var(--muted); }
@media(max-width:620px) {
  .month-day { min-height: 48px; padding: 4px 0; }
  .month-day > span:first-child { font-size: 12px; }
}


/* Month/week toggle button */
.calendar-toolbar .month-title {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 42px;
  max-width: 100%;
  padding: 9px 13px;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: var(--surface);
  color: var(--text);
  box-shadow: 0 2px 6px #9c6d8312;
  font-size: 18px;
  font-weight: 750;
  line-height: 1.2;
  text-transform: capitalize;
  white-space: nowrap;
  cursor: pointer;
  transition: background .15s, border-color .15s, transform .15s;
}
.calendar-toolbar .month-title:active {
  background: var(--pink2);
  border-color: var(--pink);
  transform: scale(.97);
}
@media(max-width:620px) {
  .calendar-toolbar .month-title {
    min-height: 40px;
    padding: 8px 10px;
    font-size: 16px;
    border-radius: 12px;
  }
}

/* Увеличенные области нажатия для мобильных устройств */
@media (max-width: 620px) {
  .nav-buttons button {
    min-width: 44px;
    min-height: 44px;
    padding: 8px 12px;
    font-size: 22px;
    touch-action: manipulation;
  }

  /* Кнопки закрытия окон и редакторов */
  .modal-close,
  .close-modal,
  .editor-close,
  [aria-label="Закрыть"],
  button.close,
  .modal .close {
    min-width: 44px;
    min-height: 44px;
    padding: 8px;
    font-size: 22px;
    touch-action: manipulation;
  }
}

/* Окошки: адаптивная сетка */
.slots-grid{
  display:grid;
  grid-template-columns:repeat(3,minmax(0,1fr));
  gap:12px;
  align-items:start;
}
.slots-grid .slot-day{
  min-width:0;
  margin:0;
  padding:12px;
  border-radius:15px;
}
.slot-day-title{
  display:block;
  width:100%;
  padding:7px 8px;
  margin-bottom:8px;
  border:0;
  border-radius:9px;
  background:var(--pink2);
  text-align:left;
  text-transform:capitalize;
  font-size:14px;
  font-weight:700;
  overflow-wrap:anywhere;
}
.slot-day-title:active{transform:scale(.98)}
.slot-times{min-width:0}
.slot-times .empty{
  padding:10px 5px;
  font-size:12px;
  border-radius:9px;
}
.slot-chip{
  margin:3px 2px;
  padding:7px 8px;
  font-weight:600;
  white-space:nowrap;
}
.slots-toolbar{align-items:center}
#slots-range{margin:5px 0 0}
@media(max-width:620px){
  .slots-grid{grid-template-columns:repeat(2,minmax(0,1fr));gap:8px}
  .slots-grid .slot-day{padding:9px}
  .slot-day-title{font-size:13px;padding:8px 6px}
  .slot-chip{font-size:11px;padding:6px}
  .slots-toolbar{align-items:flex-start;flex-direction:column}
  .slots-toolbar .nav-buttons{width:100%}
  .slots-toolbar .nav-buttons button{flex:1;min-height:44px}
}

/* Исправление переполнения полей даты и времени в Safari iOS */
#booking-editor,
#booking-editor form,
#booking-editor label,
#booking-editor .form-row {
  min-width: 0;
  max-width: 100%;
}

#booking-editor input,
#booking-editor select {
  box-sizing: border-box;
  min-width: 0;
  max-width: 100%;
}

#booking-start {
  display: block;
  width: 100%;
  min-width: 0;
  max-width: 100%;
  font-size: 16px;
}

@supports (-webkit-touch-callout: none) {
  #booking-start {
    -webkit-appearance: none;
    appearance: none;
  }
}

/* Единый размер текста во всех полях формы записи на iPhone */
#booking-editor input,
#booking-editor select,
#booking-editor textarea {
  font-size: 16px !important;
  line-height: 1.4;
  box-sizing: border-box;
  min-width: 0;
  max-width: 100%;
  width: 100%;
}

#booking-editor label {
  font-size: 16px;
}

/* Поиск клиента в форме новой записи */
.client-picker{
  position:relative;
  width:100%;
  min-width:0;
}
.client-picker-options{
  position:absolute;
  z-index:30;
  top:calc(100% + 5px);
  left:0;
  right:0;
  max-height:260px;
  overflow-y:auto;
  overscroll-behavior:contain;
  background:var(--surface);
  border:1px solid var(--line);
  border-radius:13px;
  box-shadow:0 8px 26px #0002;
}
.client-picker-option{
  display:flex;
  flex-direction:column;
  align-items:flex-start;
  gap:3px;
  width:100%;
  padding:12px;
  border:0;
  border-bottom:1px solid var(--line);
  border-radius:0;
  text-align:left;
  font-size:16px;
}
.client-picker-option:last-child{border-bottom:0}
.client-picker-option:active{background:var(--pink2)}
.client-picker-option small{
  color:var(--muted);
  font-size:13px;
}
.client-picker-empty{
  padding:14px;
  color:var(--muted);
  font-size:14px;
}
#booking-client-search{font-size:16px!important}

/* Окно настроек */
.settings-modal{
  position:fixed;
  inset:0;
  z-index:100;
  display:flex;
  align-items:center;
  justify-content:center;
  padding:18px;
  background:#21151d80;
}
.settings-modal.hidden{display:none!important}
.settings-panel{
  display:flex;
  flex-direction:column;
  width:min(760px,100%);
  max-height:min(780px,90dvh);
  overflow:hidden;
  background:var(--surface);
  color:var(--text);
  border:1px solid var(--line);
  border-radius:20px;
  box-shadow:0 18px 60px #0003;
}
.settings-header,.settings-footer{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
  padding:16px 20px;
}
.settings-header{border-bottom:1px solid var(--line)}
.settings-header h2{font-size:23px}
.settings-header .eyebrow{margin-bottom:4px}
.settings-layout{
  display:grid;
  grid-template-columns:180px minmax(0,1fr);
  min-height:280px;
  overflow:auto;
}
.settings-nav{
  display:flex;
  flex-direction:column;
  gap:5px;
  padding:12px;
  border-right:1px solid var(--line);
}
.settings-tab{
  width:100%;
  text-align:left;
  border-color:transparent;
  padding:11px;
  border-radius:10px;
}
.settings-tab.active{
  background:var(--pink2);
  border-color:#e4b4c8;
  font-weight:700;
}
.settings-content{padding:20px;min-width:0}
.settings-page h3{margin:0 0 16px}
.settings-page p{font-size:14px;line-height:1.5;color:var(--muted)}
.settings-page label{margin-top:12px}
.settings-note{margin-top:10px}
.settings-footer{justify-content:flex-end;border-top:1px solid var(--line)}
@media(max-width:620px){
  .settings-modal{padding:8px;align-items:center}
  .settings-panel{max-height:92dvh;border-radius:16px}
  .settings-layout{grid-template-columns:minmax(0,1fr)}
  .settings-nav{
    flex-direction:row;
    overflow-x:auto;
    border-right:0;
    border-bottom:1px solid var(--line);
    padding:8px;
  }
  .settings-tab{width:auto;flex:0 0 auto;white-space:nowrap;padding:10px}
  .settings-content{padding:16px}
  .settings-header,.settings-footer{padding:13px 16px}
}


/* Настройки: постоянное рабочее расписание */
.schedule-days{display:flex;flex-direction:column;gap:10px;margin-top:14px}
.schedule-day{display:grid;grid-template-columns:minmax(140px,1fr) minmax(100px,130px) minmax(100px,130px);gap:12px;align-items:center;padding:12px;border:1px solid var(--border,#eadde3);border-radius:12px}
.schedule-day-toggle{display:flex;align-items:center;gap:9px;font-weight:600}
.schedule-day-toggle input{width:18px;height:18px;accent-color:var(--accent,#c66b91)}
.schedule-time-label{display:flex;flex-direction:column;gap:5px;font-size:12px;color:var(--muted,#777)}
.schedule-time-label input{box-sizing:border-box;width:100%;min-width:0;padding:9px;border:1px solid var(--border,#eadde3);border-radius:9px;background:var(--surface,#fff);color:inherit;font:inherit;font-size:16px}
.schedule-time-label input:disabled{opacity:.45}
.schedule-day-off{opacity:.72}
.settings-actions{display:flex;justify-content:flex-end;margin-top:16px}
#save-schedule:disabled{opacity:.6;cursor:wait}
@media(max-width:600px){
  .schedule-day{grid-template-columns:minmax(0,1fr) minmax(82px,1fr) minmax(82px,1fr);gap:7px;padding:9px}
  .schedule-day-toggle{grid-column:1/-1}
  .schedule-time-label input{padding:8px 4px}
  .settings-actions .primary{width:100%}
}


/* Компактный редактор перерывов внутри строки рабочего дня */
.schedule-day{grid-template-columns:minmax(140px,1fr) minmax(90px,115px) minmax(90px,115px) minmax(120px,175px)}
.schedule-break-cell{min-width:0;align-self:center}
.break-toggle{display:block;width:100%;padding:9px 7px;border:1px solid var(--border,#eadde3);border-radius:9px;background:transparent;color:inherit;font:inherit;font-size:13px;cursor:pointer;text-align:center}
.break-editor{display:none;grid-column:1/-1;margin-top:9px;padding:10px;border-radius:10px;background:var(--background,#fff7f9)}
.break-editor.open{display:block}
.break-list{display:flex;flex-direction:column;gap:8px}
.break-row{display:grid;grid-template-columns:minmax(0,1fr) minmax(0,1fr) auto;gap:7px;align-items:end}
.break-row .schedule-time-label input{box-sizing:border-box;width:100%;min-width:0;padding:8px 4px;border:1px solid var(--border,#eadde3);border-radius:8px;background:var(--surface,#fff);color:inherit;font:inherit}
.break-remove,.break-add{padding:8px;border:1px solid var(--border,#eadde3);border-radius:8px;background:transparent;color:inherit;cursor:pointer}
.break-add{margin-top:9px}
@media(max-width:700px){
  .schedule-day{grid-template-columns:minmax(0,1fr) minmax(80px,1fr) minmax(80px,1fr)}
  .schedule-day-toggle{grid-column:1/-1}
  .schedule-break-cell{grid-column:1/-1}
  .break-toggle{text-align:left}
  .break-row{grid-template-columns:minmax(0,1fr) minmax(0,1fr) auto}
}

/* Исправление прокрутки окна настроек на мобильных экранах */
.settings-panel {
  min-height: 0;
}

.settings-layout {
  flex: 1 1 auto;
  min-height: 0;
  overflow: hidden;
}

.settings-content {
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
}

.settings-page {
  min-width: 0;
}

.settings-footer,
.settings-header {
  flex-shrink: 0;
}

@media (max-width: 620px) {
  .settings-layout {
    display: flex;
    flex-direction: column;
  }

  .settings-nav {
    flex-shrink: 0;
  }

  .settings-content {
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
    padding-bottom: 20px;
  }

  .settings-actions {
    position: sticky;
    bottom: 0;
    z-index: 2;
    padding: 12px 0;
    margin-top: 12px;
    background: var(--surface);
  }

  #save-schedule {
    width: 100%;
    min-height: 44px;
  }
}


/* Notification settings */
.notification-card{display:flex;align-items:center;justify-content:space-between;gap:14px;padding:14px;border:1px solid var(--border-color,#e5dce1);border-radius:14px;margin-top:14px}
.notification-card p{margin:6px 0 0}
.notification-card button{flex-shrink:0}
.notification-card button:disabled,.settings-actions button:disabled{opacity:.5;cursor:not-allowed}


.login-overlay {
  position: fixed;
  inset: 0;
  z-index: 10000;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(65, 38, 51, .42);
  backdrop-filter: blur(9px);
}
.login-overlay.hidden { display: none; }
.login-card {
  width: min(100%, 390px);
  padding: 30px;
  border: 1px solid rgba(190, 130, 155, .25);
  border-radius: 24px;
  background: var(--card, #fffafc);
  color: var(--text, #392b32);
  box-shadow: 0 24px 80px rgba(48, 25, 37, .22);
}
.login-card h2 { margin: 10px 0 4px; text-align: center; }
.login-card > p { text-align: center; }
.login-card label { display: block; margin: 22px 0 8px; }
.login-card input {
  box-sizing: border-box;
  width: 100%;
  min-height: 46px;
  padding: 12px;
  border: 1px solid #d8b9c7;
  border-radius: 12px;
  font: inherit;
}
.login-card button { width: 100%; margin-top: 12px; min-height: 44px; }
.login-mark { text-align: center; font-size: 42px; color: #c16c91; }
.login-error { min-height: 1.3em; color: #b42345; font-size: .9rem; }
#logout-button { margin-left: 6px; }

.password-settings-form { display: grid; gap: 14px; max-width: 440px; }
.password-settings-form label { display: grid; gap: 7px; }
.password-settings-form input {
  box-sizing: border-box;
  width: 100%;
  min-height: 42px;
  padding: 10px 12px;
  border: 1px solid #d8b9c7;
  border-radius: 10px;
  font: inherit;
}


/* Стабильная высота окна настроек */
.settings-panel {
  height: min(780px, 90dvh);
}

.settings-layout {
  flex: 1 1 auto;
  min-height: 0;
}

.settings-content {
  min-height: 0;
  overflow-y: auto;
}

@media (max-width: 620px) {
  .settings-panel {
    height: 92dvh;
  }
}


/* Каталог услуг */
.services-list{display:grid;gap:9px;margin:14px 0 20px}
.service-row{display:flex;align-items:center;justify-content:space-between;gap:12px;padding:12px;border:1px solid var(--line);border-radius:12px;background:var(--surface)}
.service-info{display:grid;gap:4px;min-width:0}
.service-info strong{overflow-wrap:anywhere}
.service-info small{color:var(--muted)}
.service-actions{display:flex;gap:6px;flex-shrink:0}
.service-inactive{opacity:.65}
.service-form{border-top:1px solid var(--line);padding-top:16px;margin-top:12px}
.service-form h4{margin:0;font-size:15px}
@media(max-width:620px){.service-row{align-items:flex-start;flex-direction:column}.service-actions{width:100%}.service-actions button{flex:1}}


/* Кнопки выбора услуги в форме записи */
.booking-service-label { display: block; }
.booking-service-buttons {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin-top: 8px;
}
.booking-service-button {
  min-width: 0;
  min-height: 66px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 5px;
  padding: 10px 6px;
  border: 1px solid var(--border, #ead8e1);
  border-radius: 14px;
  background: var(--surface, #fff);
  color: var(--text, #382b32);
  cursor: pointer;
  text-align: center;
}
.booking-service-button strong {
  font-size: 13px;
  line-height: 1.25;
  overflow-wrap: anywhere;
}
.booking-service-button small {
  font-size: 12px;
  opacity: .75;
}
.booking-service-button.selected {
  background: #f5d9e5;
  border-color: #c56891;
  color: #873b5c;
  box-shadow: inset 0 0 0 1px #c56891;
}
.booking-duration-control {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 7px;
  margin: 2px 0 14px;
}
.booking-duration-caption { font-size: 13px; opacity: .75; }
.booking-duration-stepper {
  width: 100%;
  display: grid;
  grid-template-columns: 48px minmax(0, 1fr) 48px;
  align-items: center;
  gap: 12px;
}
.booking-duration-stepper button {
  height: 44px;
  border: 1px solid var(--border, #ead8e1);
  border-radius: 13px;
  font-size: 25px;
  background: var(--surface, #fff);
  color: var(--text, #382b32);
}
.booking-duration-stepper button:disabled {
  opacity: .35;
  cursor: not-allowed;
}
.booking-duration-stepper output {
  text-align: center;
  font-size: 22px;
  font-weight: 700;
  color: #c05d8a;
}
.booking-duration-control > small { opacity: .65; font-size: 11px; }
@media (max-width: 480px) {
  .booking-service-buttons { gap: 6px; }
  .booking-service-button { padding: 9px 4px; min-height: 64px; }
  .booking-service-button strong { font-size: 12px; }
}

/* Исправление мобильного выбора услуги */
.booking-service-label {
  display: block;
  min-width: 0;
}
.booking-service-caption {
  display: block;
  margin-bottom: 6px;
  font-size: 12px;
  color: var(--muted);
}
.booking-service-button {
  -webkit-appearance: none;
  appearance: none;
  touch-action: manipulation;
  pointer-events: auto;
}
.booking-service-button strong,
.booking-service-button small {
  pointer-events: none;
}


/* DATE AVAILABILITY OVERRIDE */
.availability-modal {
  position: fixed;
  inset: 0;
  z-index: 100;
  background: rgba(25, 15, 30, .48);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}
.availability-modal.hidden { display: none !important; }
.availability-panel {
  width: min(460px, 100%);
  max-height: calc(100dvh - 32px);
  overflow-y: auto;
  background: var(--surface);
  color: var(--text);
  border: 1px solid var(--line);
  border-radius: 20px;
  padding: 20px;
  box-shadow: var(--shadow);
}
.availability-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}
.availability-header h2 { font-size: 20px; }
.availability-enabled {
  display: flex;
  align-items: center;
  gap: 10px;
}
.availability-enabled input { width: auto; }
.availability-hours {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}
.availability-modal .settings-note {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
}
@media(max-width: 520px) {
  .availability-hours { grid-template-columns: 1fr; }
  .availability-panel { padding: 16px; }
}


/* Компактные элементы постоянных перерывов */
.schedule-break-cell{display:flex;align-items:center;min-width:0}
.break-toggle{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  width:auto;
  max-width:100%;
  min-height:34px;
  padding:6px 10px;
  border:1px solid var(--border,#eadde3);
  border-radius:9px;
  background:var(--surface,#fff);
  color:var(--text,#2d2437);
  font-size:13px;
  line-height:1.25;
  white-space:normal;
  text-align:left;
}
.break-toggle:not(.break-toggle-empty){
  background:var(--background,#fff7f9);
  border-color:var(--accent,#c66b91);
}
.break-toggle-empty{
  border-style:dashed;
  color:var(--muted,#777);
}
.break-toggle:active{transform:scale(.98)}
@media(max-width:700px){
  .schedule-break-cell{justify-content:flex-start}
  .break-toggle{width:auto;max-width:100%;min-height:32px}
}


/* Заголовок дня и перерыв в одной строке */
.schedule-day-header{
  grid-column:1/-1;
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:10px;
  min-width:0;
}
.schedule-day-header .schedule-day-toggle{
  grid-column:auto;
  flex:1 1 auto;
  min-width:0;
}
.schedule-day-header .schedule-break-cell{
  flex:0 1 auto;
  width:auto;
  min-width:0;
  justify-content:flex-end;
}
.schedule-day-header .break-toggle{
  width:auto;
  max-width:100%;
  white-space:nowrap;
}
.schedule-day-header .break-editor{
  width:min(280px,75vw);
  box-sizing:border-box;
}
@media(max-width:700px){
  .schedule-day-header{grid-column:1/-1}
  .schedule-day-header .schedule-day-toggle{grid-column:auto}
  .schedule-day-header .schedule-break-cell{
    grid-column:auto;
    flex:0 1 auto;
  }
  .schedule-day-header .break-toggle{
    width:auto;
    font-size:12px;
    padding:6px 8px;
  }
  .schedule-day-header .break-editor{
    position:relative;
    width:min(280px,75vw);
  }
}

/* Настройки: единый аккуратный стиль вкладок */
.settings-nav {
  gap: 6px;
  padding: 14px 12px;
  background: var(--background, #fff7f9);
}
.settings-tab {
  display: flex;
  align-items: center;
  gap: 9px;
  min-height: 44px;
  padding: 11px 12px;
  border: 1px solid transparent;
  border-radius: 12px;
  color: var(--text);
  font: inherit;
  font-size: 14px;
  line-height: 1.35;
  transition: background .16s ease, border-color .16s ease, transform .12s ease;
}
.settings-tab.active {
  background: var(--pink2, #fce4ec);
  border-color: var(--pink, #f06292);
  color: var(--text);
  font-weight: 700;
  box-shadow: 0 2px 7px #c66b9112;
}
.settings-tab:focus-visible {
  outline: 2px solid var(--pink, #f06292);
  outline-offset: 2px;
}
@media (hover: hover) {
  .settings-tab:not(.active):hover {
    background: var(--surface, #fff);
    border-color: var(--line, #eadde3);
  }
}
.settings-tab:active {
  transform: scale(.98);
}
.settings-content {
  padding: 22px;
}
.settings-page h3 {
  margin-bottom: 8px;
  font-size: 20px;
  line-height: 1.35;
}
.settings-page > p:first-of-type {
  margin-top: 0;
  margin-bottom: 18px;
}
.settings-footer {
  min-height: 64px;
}
@media (max-width: 620px) {
  .settings-nav {
    gap: 6px;
    padding: 9px 10px;
    scrollbar-width: thin;
  }
  .settings-tab {
    min-height: 42px;
    padding: 10px 12px;
    font-size: 13px;
  }
  .settings-content {
    padding: 18px 15px;
  }
  .settings-page h3 {
    font-size: 19px;
  }
}

/* Расписание: наглядные карточки рабочих дней */
.schedule-days {
  gap: 12px;
  margin-top: 18px;
}
.schedule-day {
  position: relative;
  gap: 12px;
  padding: 14px;
  border: 1px solid var(--line, #eadde3);
  border-radius: 16px;
  background: var(--surface, #fff);
  box-shadow: 0 2px 8px #5b34400a;
  transition: border-color .18s ease, opacity .18s ease, background .18s ease;
}
.schedule-day:not(.schedule-day-off) {
  border-color: #e9bfd0;
}
.schedule-day-header {
  display: contents;
}
.schedule-day-toggle {
  min-height: 42px;
  gap: 10px;
  font-size: 15px;
}
.schedule-day-toggle input {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
  accent-color: var(--pink, #f06292);
  cursor: pointer;
}
.schedule-time-label {
  gap: 6px;
  font-size: 12px;
  font-weight: 600;
}
.schedule-time-label input {
  min-height: 42px;
  padding: 9px 10px;
  border-color: var(--line, #eadde3);
  border-radius: 10px;
  font-size: 15px;
}
.schedule-time-label input:focus {
  outline: 2px solid #f0629240;
  border-color: var(--pink, #f06292);
}
.schedule-day-off {
  background: var(--background, #fff7f9);
  border-color: var(--line, #eadde3);
  opacity: .78;
}
.schedule-day-off .schedule-day-toggle {
  color: var(--muted);
}
.schedule-break-cell {
  min-width: 0;
}
.break-toggle {
  min-height: 40px;
  padding: 9px 11px;
  border: 1px solid #e8bfd0;
  border-radius: 11px;
  background: #fff4f8;
  color: #8d4262;
  font-size: 13px;
  font-weight: 650;
  transition: background .15s ease, border-color .15s ease;
}
.break-toggle-empty {
  border-style: dashed;
  background: transparent;
  color: var(--muted);
}
.break-toggle:active,
.break-add:active,
.break-remove:active {
  transform: scale(.98);
}
.break-editor {
  padding: 14px;
  border: 1px solid var(--line, #eadde3);
  border-radius: 13px;
  background: var(--background, #fff7f9);
}
.break-list {
  gap: 10px;
}
.break-row {
  padding: 10px;
  border: 1px solid var(--line, #eadde3);
  border-radius: 11px;
  background: var(--surface, #fff);
}
.break-row .schedule-time-label {
  min-width: 0;
}
.break-row .schedule-time-label input {
  min-height: 40px;
  font-size: 14px;
}
.break-add,
.break-remove {
  min-height: 38px;
  border-radius: 10px;
  font-size: 13px;
}
.break-add {
  border-color: #e8bfd0;
  background: #fff4f8;
  color: #8d4262;
  font-weight: 650;
}
.break-remove {
  border-color: #f0c7cf;
  color: #a13f56;
}
#schedule-status {
  padding: 10px 12px;
  border-radius: 11px;
  background: var(--background, #fff7f9);
}
#save-schedule {
  min-height: 44px;
  padding: 11px 18px;
  border-radius: 12px;
  font-weight: 700;
}
@media (max-width: 700px) {
  .schedule-days {
    gap: 10px;
  }
  .schedule-day {
    gap: 9px;
    padding: 12px;
  }
  .schedule-day-toggle {
    min-height: 38px;
    font-size: 15px;
  }
  .schedule-time-label input {
    min-height: 42px;
    padding: 8px 6px;
    font-size: 16px;
  }
  .break-editor {
    padding: 10px;
  }
  .break-row {
    padding: 8px;
  }
  .break-add {
    width: 100%;
  }
}
@media (prefers-reduced-motion: reduce) {
  .schedule-day,
  .settings-tab,
  .break-toggle {
    transition: none;
  }
}

/* Исправление сетки расписания после обновления оформления */
.schedule-day {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  align-items: start;
  gap: 12px;
}
.schedule-day-header {
  display: flex;
  grid-column: 1 / -1;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  min-width: 0;
}
.schedule-day-header .schedule-day-toggle {
  display: flex;
  flex: 1 1 auto;
  min-width: 0;
}
.schedule-day-header .schedule-break-cell {
  flex: 0 0 auto;
}
.schedule-day-header .break-toggle {
  min-height: 40px;
  white-space: nowrap;
}
.schedule-day > .schedule-time-label {
  display: flex;
  flex-direction: column;
  min-width: 0;
  gap: 6px;
}
.schedule-day > .schedule-time-label input {
  width: 100%;
  min-width: 0;
  box-sizing: border-box;
}
.schedule-day > .break-editor {
  grid-column: 1 / -1;
  width: 100%;
  box-sizing: border-box;
}
.settings-actions {
  position: static;
  padding: 10px 0 0;
  margin-top: 12px;
  background: transparent;
}
@media (max-width: 700px) {
  .schedule-day {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
    padding: 12px;
  }
  .schedule-day-header {
    grid-column: 1 / -1;
  }
  .schedule-day > .schedule-time-label {
    grid-column: auto;
  }
  .schedule-day > .break-editor {
    grid-column: 1 / -1;
  }
  .schedule-day-header .break-toggle {
    min-height: 36px;
    padding: 7px 9px;
    font-size: 12px;
  }
  .settings-actions {
    position: static;
  }
}

/* Услуги: карточки каталога и форма редактирования */
.services-list {
  display: grid;
  gap: 10px;
  margin: 16px 0 24px;
}
.service-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 15px;
  border: 1px solid #efd5e0;
  border-radius: 15px;
  background: var(--surface, #fff);
  box-shadow: 0 2px 8px #5b34400a;
  transition: border-color .18s ease, background .18s ease, opacity .18s ease;
}
.service-row:hover {
  border-color: #e7a8c1;
}
.service-info {
  display: grid;
  gap: 6px;
  min-width: 0;
}
.service-info strong {
  color: var(--text, #2d2437);
  font-size: 15px;
  line-height: 1.4;
  overflow-wrap: anywhere;
}
.service-info small {
  color: var(--muted, #827582);
  font-size: 13px;
  line-height: 1.4;
}
.service-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}
.service-actions button {
  min-height: 40px;
  padding: 9px 12px;
  border: 1px solid var(--line, #eadde3);
  border-radius: 10px;
  background: var(--surface, #fff);
  color: var(--text, #2d2437);
  font: inherit;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
}
.service-actions button:hover {
  border-color: #e7a8c1;
  background: #fff4f8;
}
.service-inactive {
  opacity: .7;
  background: var(--background, #fff7f9);
  border-style: dashed;
}
.service-inactive .service-info strong {
  color: var(--muted, #827582);
}
.service-form {
  display: grid;
  gap: 16px;
  margin-top: 20px;
  padding: 20px;
  border: 1px solid #efd5e0;
  border-radius: 16px;
  background: var(--background, #fff7f9);
}
.service-form h4 {
  margin: 0;
  color: var(--text, #2d2437);
  font-size: 17px;
  line-height: 1.4;
}
.service-form label {
  display: grid;
  gap: 7px;
  color: var(--text, #2d2437);
  font-size: 13px;
  font-weight: 600;
}
.service-form input,
.service-form select {
  width: 100%;
  min-width: 0;
  min-height: 46px;
  box-sizing: border-box;
  padding: 11px 12px;
  border: 1px solid var(--line, #eadde3);
  border-radius: 11px;
  background: var(--surface, #fff);
  color: var(--text, #2d2437);
  font: inherit;
  font-size: 15px;
}
.service-form input:focus,
.service-form select:focus {
  outline: 2px solid #f0629240;
  border-color: #f06292;
}
.service-form .form-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}
.service-form .form-row button {
  min-height: 44px;
  border-radius: 11px;
}
#services-status {
  padding: 10px 12px;
  border-radius: 10px;
  background: var(--background, #fff7f9);
  line-height: 1.5;
}
@media (max-width: 620px) {
  .service-row {
    align-items: stretch;
    flex-direction: column;
    gap: 12px;
    padding: 14px;
  }
  .service-actions {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    width: 100%;
  }
  .service-actions button {
    width: 100%;
    min-width: 0;
    min-height: 44px;
    padding: 9px 6px;
  }
  .service-form {
    gap: 14px;
    padding: 15px;
  }
  .service-form .form-row {
    display: grid;
    grid-template-columns: 1fr;
  }
  .service-form .form-row button {
    width: 100%;
  }
}
@media (prefers-reduced-motion: reduce) {
  .service-row {
    transition: none;
  }
}

/* Уведомления: карточка состояния и тестирования */
.notification-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-top: 18px;
  padding: 18px;
  border: 1px solid #efd5e0;
  border-radius: 16px;
  background: var(--surface, #fff);
  box-shadow: 0 2px 8px #5b34400a;
}
.notification-card > div {
  flex: 1 1 auto;
  min-width: 0;
}
.notification-card strong {
  display: block;
  color: var(--text, #2d2437);
  font-size: 15px;
  line-height: 1.4;
}
.notification-card p {
  margin: 7px 0 0;
  font-size: 13px;
  line-height: 1.55;
  overflow-wrap: anywhere;
}
.notification-card button,
#test-notification {
  min-height: 44px;
  padding: 10px 15px;
  border: 1px solid #e8bfd0;
  border-radius: 11px;
  background: #fff4f8;
  color: #8d4262;
  font: inherit;
  font-size: 13px;
  font-weight: 650;
  cursor: pointer;
  flex-shrink: 0;
}
.notification-card button:hover,
#test-notification:hover {
  background: #fce4ec;
  border-color: #e7a8c1;
}
.settings-page[data-settings-page="notifications"] .settings-actions {
  margin-top: 16px;
}
#test-notification {
  min-height: 46px;
  padding: 11px 18px;
  background: var(--pink, #f06292);
  border-color: var(--pink, #f06292);
  color: #fff;
}
#test-notification:hover {
  filter: brightness(.97);
}
@media (max-width: 620px) {
  .notification-card {
    align-items: stretch;
    flex-direction: column;
    gap: 13px;
    padding: 15px;
  }
  .notification-card button {
    width: 100%;
    min-height: 46px;
  }
  .settings-page[data-settings-page="notifications"] .settings-actions {
    display: flex;
  }
  #test-notification {
    width: 100%;
  }
}
@media (prefers-reduced-motion: reduce) {
  .notification-card,
  .notification-card button,
  #test-notification {
    transition: none;
  }
}

/* Исправление переполнения поля даты в форме записи */
#booking-editor #booking-date {
  display: block;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  box-sizing: border-box;
  margin: 0;
}

#booking-editor label:has(#booking-date) {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  width: 100%;
  min-width: 0;
  max-width: 100%;
  box-sizing: border-box;
}


/* Финальное ограничение ширины сетки формы записи */
#calendar #booking-editor,
#calendar #booking-editor form {
  width: 100%;
  min-width: 0;
  max-width: 100%;
  box-sizing: border-box;
}

#calendar #booking-editor form {
  grid-template-columns: minmax(0, 1fr);
}

#calendar #booking-editor form > label,
#calendar #booking-editor form > .booking-service-label,
#calendar #booking-editor form > .booking-duration-control,
#calendar #booking-editor form > .form-row {
  min-width: 0;
  max-width: 100%;
  box-sizing: border-box;
}

#calendar #booking-editor #booking-date {
  display: block;
  width: 100%;
  min-width: 0;
  max-width: 100%;
  box-sizing: border-box;
  -webkit-appearance: none;
  appearance: none;
}


/* Mobile: prevent automatic browser zoom on input focus */
@media (max-width: 620px) {
  input,
  select,
  textarea {
    font-size: 16px !important;
  }
}

/* Mobile fix: keep schedule fields inside each day card */
@media (max-width: 700px) {
  .schedule-day {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 10px;
    padding: 12px;
    min-width: 0;
  }

  .schedule-day-header {
    grid-column: 1 / -1;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    min-width: 0;
  }

  .schedule-day-toggle {
    grid-column: auto;
    min-width: 0;
  }

  .schedule-break-cell {
    grid-column: auto;
    min-width: 0;
    width: auto;
  }

  .break-toggle {
    width: auto;
    max-width: 100%;
    padding: 8px;
    text-align: center;
  }

  .schedule-time-label {
    min-width: 0;
  }

  .schedule-time-label input {
    width: 100%;
    min-width: 0;
    box-sizing: border-box;
    padding: 8px 4px;
    font-size: 16px;
  }

  .break-editor {
    grid-column: 1 / -1;
    min-width: 0;
  }

  .break-row {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  }

  .break-remove {
    grid-column: 1 / -1;
  }
}

/* CRM Nogotochki: compact, consistent work schedule cards */
.schedule-days {
  gap: 10px;
}

.schedule-day {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  align-items: start;
  align-content: start;
  gap: 10px;
  min-width: 0;
  min-height: 0;
  height: auto;
  padding: 12px;
  box-sizing: border-box;
}

.schedule-day-header {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  min-width: 0;
  margin: 0;
}

.schedule-day-header .schedule-day-toggle {
  flex: 1 1 auto;
  min-width: 0;
  margin: 0;
}

.schedule-day-header .schedule-day-toggle span {
  overflow-wrap: anywhere;
}

.schedule-day-header .schedule-break-cell {
  flex: 0 0 auto;
  width: auto;
  min-width: 0;
  margin: 0;
}

.schedule-day-header .break-toggle {
  width: auto;
  max-width: 100%;
  min-height: 36px;
  padding: 7px 10px;
  white-space: nowrap;
  text-align: center;
}

.schedule-day > .schedule-time-label {
  display: flex;
  flex-direction: column;
  gap: 5px;
  width: 100%;
  min-width: 0;
  margin: 0;
  box-sizing: border-box;
}

.schedule-day > .schedule-time-label input {
  display: block;
  width: 100%;
  min-width: 0;
  max-width: 100%;
  min-height: 44px;
  padding: 8px 4px;
  box-sizing: border-box;
  font-size: 16px;
  text-align: center;
}

.schedule-day > .break-editor {
  grid-column: 1 / -1;
  width: 100%;
  min-width: 0;
  margin: 0;
  box-sizing: border-box;
}

.schedule-day-off {
  opacity: 0.72;
}

@media (max-width: 700px) {
  .schedule-days {
    gap: 10px;
  }

  .schedule-day {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 8px;
    padding: 12px;
  }

  .schedule-day-header {
    grid-column: 1 / -1;
    gap: 6px;
  }

  .schedule-day-header .break-toggle {
    min-height: 34px;
    padding: 6px 8px;
    font-size: 12px;
  }

  .schedule-day > .schedule-time-label input {
    padding: 8px 2px;
  }

  .schedule-day > .break-editor {
    grid-column: 1 / -1;
  }
}


/* Поиск свободного времени в разделе «Окошки» */
.find-time-footer{
  display:flex;
  justify-content:center;
  margin:18px 0 8px;
}
.find-time-footer button{
  width:100%;
  max-width:420px;
  min-height:46px;
  border-radius:14px;
}
#find-time-panel{
  max-width:680px;
  margin:16px auto 0;
}
#find-time-panel h3{
  margin-bottom:16px;
}
.find-time-fields{
  display:grid;
  grid-template-columns:repeat(2,minmax(0,1fr));
  gap:10px;
}
.find-time-preferences{
  border:1px solid var(--line);
  border-radius:12px;
  padding:11px;
}
.find-time-preferences summary{
  color:var(--text);
  font-size:13px;
  cursor:pointer;
}
.find-time-preferences .find-time-fields{
  margin-top:12px;
}
#find-time-status{
  margin-top:14px;
  color:var(--muted);
  font-size:13px;
}
.find-time-results{
  display:grid;
  gap:8px;
  margin-top:12px;
}
.find-time-result{
  display:flex;
  justify-content:space-between;
  align-items:center;
  gap:12px;
  width:100%;
  text-align:left;
  padding:12px;
  border-color:var(--line);
  background:var(--bg);
  border-radius:13px;
}
.find-time-result strong,
.find-time-result small{
  display:block;
}
.find-time-result small{
  margin-top:4px;
  color:var(--muted);
}
.find-time-result-time{
  white-space:nowrap;
  color:var(--text);
  font-weight:650;
}
.find-time-result-time b{
  color:var(--pink);
  margin-left:4px;
}
.find-time-result:hover{
  border-color:var(--pink);
}
@media(max-width:480px){
  #find-time-panel{padding:14px}
  .find-time-fields{grid-template-columns:1fr}
  .find-time-result{align-items:flex-start;flex-direction:column;gap:7px}
  .find-time-result-time{white-space:normal}
}


/* Заметка в карточке записи */
.booking-note {
  color: var(--muted, #8b7b83);
  overflow-wrap: anywhere;
}


/* Одинаковая высота нижних кнопок календаря на мобильных */
@media (max-width: 620px) {
  #calendar .day-actions {
    align-items: stretch;
  }

  #calendar .day-actions > button {
    display: flex;
    align-items: center;
    justify-content: center;
    box-sizing: border-box;
  }
}

/* Порядок нижних кнопок календаря */
@media (max-width: 620px) {
  #calendar .day-actions #edit-day-availability {
    order: 1;
  }

  #calendar .day-actions #show-booking-form {
    order: 2;
  }
}

/* Новая единая панель навигации календаря */
.calendar-toolbar {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 12px;
  margin-bottom: 16px;
}

.calendar-toolbar-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-width: 0;
}

.calendar-view-switch {
  display: inline-flex;
  flex-shrink: 0;
  padding: 3px;
  gap: 2px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--pink2);
}

.calendar-view-switch button {
  min-height: 36px;
  padding: 7px 13px;
  border: 0;
  border-radius: 9px;
  background: transparent;
  color: var(--muted);
  font-size: 13px;
  font-weight: 600;
}

.calendar-view-switch button.active {
  background: var(--surface);
  color: var(--text);
  box-shadow: 0 2px 6px #9c6d8318;
}

.period-title {
  min-width: 0;
  text-align: right;
  font-size: 19px;
  font-weight: 750;
  text-transform: capitalize;
  line-height: 1.25;
}

.calendar-toolbar-bottom {
  display: flex;
  justify-content: flex-end;
}

.calendar-toolbar-bottom .nav-buttons {
  display: flex;
  align-items: center;
  gap: 6px;
}

.calendar-toolbar-bottom .nav-buttons button {
  min-height: 42px;
}

.calendar-toolbar-bottom #today {
  padding-left: 16px;
  padding-right: 16px;
  font-size: 13px;
  font-weight: 650;
}

@media (max-width: 620px) {
  .calendar-toolbar {
    gap: 10px;
  }

  .calendar-toolbar-top {
    gap: 6px;
  }

  .calendar-view-switch button {
    min-height: 38px;
    padding: 7px 11px;
    font-size: 12px;
  }

  .period-title {
    font-size: 16px;
  }

  .calendar-toolbar-bottom .nav-buttons {
    width: 100%;
    display: grid;
    grid-template-columns: 1fr 1.4fr 1fr;
  }

  .calendar-toolbar-bottom .nav-buttons button {
    min-height: 44px;
  }
}

/* Элегантный заголовок периода календаря */
.period-title {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 8px 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--pink2);
  color: var(--text);
  font-size: 17px;
  font-weight: 750;
  letter-spacing: -0.3px;
  line-height: 1.3;
  text-align: center;
  text-transform: capitalize;
  white-space: nowrap;
}

@media (max-width: 620px) {
  .period-title {
    padding: 8px 10px;
    font-size: 15px;
    border-radius: 10px;
    letter-spacing: -0.4px;
  }
}

/* Исправление мобильной панели календаря */
@media (max-width: 620px) {
  .calendar-toolbar-top {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
  }

  .calendar-view-switch {
    align-self: flex-start;
    width: fit-content;
    max-width: 100%;
  }

  .period-title {
    display: flex;
    width: 100%;
    min-width: 0;
    box-sizing: border-box;
    justify-content: center;
    white-space: normal;
    overflow-wrap: break-word;
    text-align: center;
    padding: 10px 8px;
    font-size: 15px;
    line-height: 1.35;
  }
}

/* Компактная панель календаря: переключатель и период в одну строку */
@media (max-width: 620px) {
  .calendar-toolbar-top {
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    gap: 6px;
  }

  .calendar-view-switch {
    flex: 0 0 auto;
    width: auto;
    align-self: center;
    padding: 3px;
  }

  .calendar-view-switch button {
    padding: 7px 9px;
    font-size: 12px;
  }

  .period-title {
    display: flex;
    flex: 1 1 0;
    width: auto;
    min-width: 0;
    box-sizing: border-box;
    justify-content: center;
    padding: 8px 5px;
    font-size: clamp(11px, 3.5vw, 14px);
    line-height: 1.25;
    letter-spacing: -0.35px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: clip;
  }
}

/* Единая высота переключателя и заголовка периода */
@media (max-width: 620px) {
  .calendar-toolbar-top {
    align-items: center;
  }

  .calendar-view-switch {
    height: 44px;
    min-height: 44px;
    box-sizing: border-box;
    align-items: center;
  }

  .calendar-view-switch button {
    height: 36px;
    min-height: 36px;
    box-sizing: border-box;
    display: flex;
    align-items: center;
    justify-content: center;
  }

  .period-title {
    height: 44px;
    min-height: 44px;
    box-sizing: border-box;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 5px;
    line-height: 1;
  }
}

/* Единая высота кнопок навигации календаря */
@media (max-width: 620px) {
  .calendar-toolbar-bottom .nav-buttons {
    align-items: stretch;
  }

  .calendar-toolbar-bottom .nav-buttons button {
    height: 48px;
    min-height: 48px;
    box-sizing: border-box;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0;
    line-height: 1;
  }
}

/* Свайпы календаря: горизонтальные жесты обрабатывает календарь,
   вертикальная прокрутка остаётся браузеру */
#week,
#month-grid {
  touch-action: pan-y;
}

/* Анимация перемещения календаря при свайпе */
#week,
#month-grid {
  will-change: transform, opacity;
  transform-origin: center;
  backface-visibility: hidden;
}


/* Единая поверхность анимации календаря */
#calendar-motion-surface {
  position: relative;
  touch-action: pan-y;
  backface-visibility: hidden;
}


/* Стабильная раскладка раздела «Окошки» во время загрузки */
.slots-loading {
  grid-column: 1 / -1;
}
.find-time-footer.is-loading {
  visibility: hidden;
}

 
/* Плавное переключение выбранной услуги */
.booking-service-button {
  transition:
    background-color 180ms ease,
    border-color 180ms ease,
    color 180ms ease,
    box-shadow 180ms ease,
    transform 180ms ease;
}

.booking-service-button.selected {
  transform: translateY(-1px);
}

.booking-service-button:active {
  transform: scale(.97);
}

@media (prefers-reduced-motion: reduce) {
  .booking-service-button {
    transition: none;
  }
}


/* Плавная обратная связь для изменения длительности */
.booking-duration-stepper button {
  cursor: pointer;
  transition: transform 160ms ease, background-color 160ms ease, border-color 160ms ease, box-shadow 160ms ease;
  touch-action: manipulation;
}
.booking-duration-stepper button:not(:disabled):active {
  transform: scale(.94);
  background-color: #f9e8ef;
}
.booking-duration-stepper button.is-pressed {
  animation: duration-step-press 180ms ease-out;
}
.booking-duration-stepper button:focus-visible {
  outline: 2px solid #c56891;
  outline-offset: 2px;
}
.booking-duration-stepper output.is-changing {
  animation: duration-value-change 260ms ease-out;
}
@keyframes duration-step-press {
  0% { transform: scale(1); }
  45% { transform: scale(.92); }
  100% { transform: scale(1); }
}
@keyframes duration-value-change {
  0% { opacity: .55; transform: scale(.94); }
  65% { opacity: 1; transform: scale(1.08); }
  100% { opacity: 1; transform: scale(1); }
}
@media (prefers-reduced-motion: reduce) {
  .booking-duration-stepper button,
  .booking-duration-stepper button.is-pressed,
  .booking-duration-stepper output.is-changing {
    animation: none;
    transition: none;
  }
}


/* Анимация загрузки вариантов времени в форме записи */
.booking-time-label {
  min-width: 0;
}
.booking-time-status {
  display: block;
  min-height: 0;
  font-size: 11px;
  line-height: 1.4;
  color: var(--muted);
  opacity: 0;
  transform: translateY(-3px);
  transition: opacity 180ms ease, transform 180ms ease;
}
.booking-time-status:not(:empty) {
  opacity: 1;
  transform: translateY(0);
}
.booking-time-status.is-loading {
  color: var(--pink);
}
.booking-time-status.is-loading::before {
  content: '';
  display: inline-block;
  width: 7px;
  height: 7px;
  margin-right: 7px;
  border: 2px solid var(--line);
  border-top-color: var(--pink);
  border-radius: 50%;
  vertical-align: 0;
  animation: booking-time-spin 700ms linear infinite;
}
.booking-time-status.is-ready {
  color: #548b70;
}
.booking-time-status.is-empty,
.booking-time-status.is-error {
  color: #c16a6a;
}
#booking-time.is-loading {
  opacity: .6;
  background-image: linear-gradient(90deg, var(--bg), var(--pink2), var(--bg));
  background-size: 200% 100%;
  animation: booking-time-shimmer 1.2s ease-in-out infinite;
}
#booking-time.is-ready {
  animation: booking-time-appear 220ms ease-out;
}
@keyframes booking-time-spin {
  to { transform: rotate(360deg); }
}
@keyframes booking-time-shimmer {
  0% { background-position: 100% 0; }
  100% { background-position: -100% 0; }
}
@keyframes booking-time-appear {
  from { opacity: .55; }
  to { opacity: 1; }
}
@media (prefers-reduced-motion: reduce) {
  .booking-time-status,
  #booking-time.is-loading,
  #booking-time.is-ready {
    animation: none;
    transition: none;
  }
}


/* Кнопка очистки поиска клиентов */
.client-search-wrap {
  position: relative;
  margin-bottom: 10px;
}

.client-search-wrap .search {
  margin-bottom: 0;
  padding-right: 42px;
}

.search-clear {
  position: absolute;
  top: 50%;
  right: 9px;
  display: grid;
  place-items: center;
  width: 27px;
  height: 27px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: var(--pink2);
  color: var(--muted);
  font-size: 21px;
  line-height: 1;
  transform: translateY(-50%);
  transition: background-color 160ms ease, color 160ms ease, transform 160ms ease;
}

.search-clear:hover {
  background: var(--pink);
  color: white;
}

.search-clear:active {
  transform: translateY(-50%) scale(.9);
}

.search-clear:focus-visible {
  outline: 2px solid var(--pink);
  outline-offset: 2px;
}

@media (prefers-reduced-motion: reduce) {
  .search-clear {
    transition: none;
  }
}
