:root {
  --bg-body: #2e3035;
  --bg-cal: #1a1d25;
  --border: #3c4043;
  --text: #e8eaed;
  --muted: #9aa0a6;
  --blue: #8ab4f8;
  --green: #81c995;
  --hour-h: 60px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
  background: var(--bg-body);
  color: var(--text);
  font-family: 'Google Sans', Roboto, -apple-system, BlinkMacSystemFont, 'Segoe UI', Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
}

::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: #1e1f23; }
::-webkit-scrollbar-thumb { background: #3c4043; border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: #5f6368; }

/* Buttons */
.btn {
  border: 1px solid var(--border);
  border-radius: 24px;
  background: #2d2e30;
  color: var(--blue);
  padding: 8px 16px;
  font-family: inherit;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.15s ease;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.btn:hover { background: #3c4043; color: #aecbfa; }
.btn.active { background: var(--blue); border-color: var(--blue); color: #202124; }
.btn.active:hover { background: #aecbfa; }


/* Кнопка «Свободные слоты» — активное состояние в зелёном */
#toggleFree.active {
  background: rgba(61, 199, 98, 0.18);
  border-color: rgba(151, 235, 175, 0.55);
  color: #a8dab5;
}

.scroller { overflow-x: auto; -webkit-overflow-scrolling: touch; }

/* Week / Calendar grid */
.calendar {
  --time-col-w: clamp(25px, 4.5vw, 50px);   /* ← сама сжимается */

  display: grid;
  width: 100%;          /* вместо max-content */
  min-width: max-content;         /* вместо min-width: 100% */

  background: var(--bg-cal);
  border: 1px solid var(--border);
  border-radius: 12px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4);
}

.corner,
.day-head { border-bottom: 1px solid var(--border); }

.day-head {
  padding: 10px 4px 12px;
  text-align: center;
  border-left: 1px solid var(--border);
  position: relative;
}
.day-head.weekend .day-name { color: #f28b82; }
.day-head .day-name {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.8px;
  text-transform: uppercase;
  color: var(--muted);
}
.day-head.today .day-name { color: var(--blue); }
.day-head .day-hours {
  font-size: 10px;
  color: #6b7075;
  margin-top: 3px;
  font-weight: 500;
}

.time-col {
  position: relative;
  background-image: repeating-linear-gradient(to bottom, var(--border) 0 1px, transparent 1px var(--hour-h));
}
.time-label {
  position: absolute;
  right: 8px;
  font-size: 11px;
  color: var(--muted);
  transform: translateY(-50%);
  white-space: nowrap;
  font-weight: 500;
}

.day-col {
  position: relative;
  border-left: 1px solid var(--border);
  background-image: repeating-linear-gradient(to bottom, var(--border) 0 1px, transparent 1px var(--hour-h));
}
.day-col.today { background-color: rgba(138, 180, 248, 0.03); }
.day-col.weekend { background-color: rgba(0, 0, 0, 0.15); }



/* ---------- Панель управления: единая высота ---------- */
/* ---------- Панель управления: единая высота + скролл ---------- */

.controls-bar {
  overflow-x: auto;
  overflow-y: hidden;
  flex-wrap: nowrap;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
  scrollbar-color: #3c4043 transparent;
  padding-bottom: 4px;
}

.controls-bar::-webkit-scrollbar {
  height: 6px;
}
.controls-bar::-webkit-scrollbar-track {
  background: transparent;
}
.controls-bar::-webkit-scrollbar-thumb {
  background: #3c4043;
  border-radius: 4px;
}
.controls-bar::-webkit-scrollbar-thumb:hover {
  background: #5f6368;
}

.controls-bar > * {
  flex-shrink: 0;
}

.controls-bar > button,
.controls-bar > select {
  height: 38px;
  padding-top: 0;
  padding-bottom: 0;
  box-sizing: border-box;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.controls-bar .nav-capsule {
  height: 38px;
  box-sizing: border-box;
  padding: 0 4px;
}

.controls-bar .nav-capsule > button {
  padding-top: 0;
  padding-bottom: 0;
  height: 30px;
  box-sizing: border-box;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.controls-bar > .h-5 {
  height: 20px;
}
