* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  background: #0b0b0b;
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  padding: 1.5rem;
}

.hub-card {
  max-width: 920px;
  width: 100%;
  background: #ffffff;
  border-radius: 28px;
  box-shadow: 0 20px 40px -8px rgba(0, 0, 0, 0.45);
  padding: 2.5rem 2.2rem;
  border: 1px solid #1e1e1e;
}

.hub-header {
  margin-bottom: 2rem;
}

.hub-header h1 {
  font-size: 1.9rem;
  font-weight: 600;
  color: #000;
  display: flex;
  align-items: center;
  gap: 8px;
  border-bottom: 2px solid #e0e0e0;
  padding-bottom: 0.75rem;
  margin-bottom: 0.5rem;
}

.accent-dot {
  width: 12px;
  height: 12px;
  background: #e10600;
  border-radius: 20px;
  box-shadow: 0 0 0 2px rgba(225, 6, 0, 0.1);
}

.hub-sub {
  color: #2c2c2c;
  font-size: 0.9rem;
}

/* ===== Сетка плиток ===== */
.tile-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(255px, 1fr));
  gap: 1.1rem;
}

.tile {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  min-height: 180px;
  padding: 1.6rem 1.5rem;
  background: #fafafa;
  border: 1.5px solid var(--tile-border, #d8d8d8);   /* цвет задаёт админ */
  border-radius: 20px;
  text-decoration: none;
  color: inherit;
  position: relative;
  transition: transform 0.18s ease, border-color 0.18s ease,
    box-shadow 0.18s ease, background 0.18s ease;
}

.tile:hover,
.tile:focus-visible {
  transform: translateY(-4px);
  background: #fff;
  border-color: var(--tile-border, #e10600);
  box-shadow: 0 14px 26px -10px rgba(225, 6, 0, 0.35);
  outline: none;
}

.tile-icon {
  font-size: 2rem;
  line-height: 1;
}

/* Группа «Избранное»: заголовок и черта занимают всю ширину сетки */
.pinned-head {
  grid-column: 1 / -1;
  display: flex;
  align-items: baseline;
  gap: 0.6rem;
  margin-bottom: -0.3rem;
}

.pinned-title {
  font-size: 0.95rem;
  font-weight: 700;
  color: #1a1a1a;
}

/* Подсказка по наведению / нажатию (фокус срабатывает и на тапе) */
.pinned-info {
  position: relative;
  display: inline-flex;
  color: #9a9a9a;
  cursor: help;
  outline: none;
}

.pinned-info svg {
  width: 1rem;
  height: 1rem;
  fill: none;
  stroke: currentColor;
  stroke-width: 2.6;
  stroke-linecap: round;
}

.pinned-info:hover,
.pinned-info:focus { color: #1a1a1a; }

.pinned-info::after {
  content: attr(data-hint);
  position: absolute;
  left: 50%;
  top: calc(100% + 0.35rem);
  transform: translateX(-50%);
  white-space: nowrap;
  padding: 0.35rem 0.65rem;
  font-size: 0.75rem;
  color: #fff;
  background: #1a1a1a;
  border-radius: 8px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.15s ease;
  z-index: 5;
}

.pinned-info:hover::after,
.pinned-info:focus::after { opacity: 1; }

.pinned-divider {
  grid-column: 1 / -1;
  height: 1px;
  background: #e0e0e0;
  margin: 0.4rem 0;
}

/* Звёздочка закрепления: ≈1/3 размера иконки (2rem), с отступами от края */
.tile-star {
  position: absolute;
  top: 0.45rem;
  right: 0.55rem;
  padding: 0.4rem;            /* увеличивает область клика, не размер звезды */
  cursor: pointer;
  line-height: 0;
  border-radius: 8px;
}

.tile-star svg {
  width: 0.7rem;
  height: 0.7rem;
  fill: none;
  stroke: #9a9a9a;
  stroke-width: 2;
  transition: fill 0.15s ease, stroke 0.15s ease, transform 0.15s ease;
}

/* заливка и цвет проявляются плавно */
.tile-star svg { transition: fill 0.35s ease, stroke 0.35s ease, transform 0.2s ease; }

.tile-star:hover svg { stroke: #f5b301; transform: scale(1.2); }

/* закрепили: звезда «выпрыгивает» и пружинит */
.tile-star svg.pop {
  animation: star-pop 0.65s cubic-bezier(0.3, 0.7, 0.4, 1) both;
}

/* открепили: короткое сжатие */
.tile-star svg.unpop {
  animation: star-unpop 0.35s ease-out both;
}

@keyframes star-pop {
  0%   { transform: scale(0.2) rotate(-70deg); opacity: 0; }
  40%  { transform: scale(1.7) rotate(14deg);  opacity: 1; }
  60%  { transform: scale(0.82) rotate(-8deg); }
  80%  { transform: scale(1.15) rotate(3deg); }
  100% { transform: scale(1) rotate(0); }
}

@keyframes star-unpop {
  0%   { transform: scale(1.3); }
  100% { transform: scale(1); }
}

/* «Избранное» и черта плавно проявляются при первом закреплении */
.pinned-head.enter,
.pinned-divider.enter {
  animation: pinned-in 0.4s ease-out both;
}

@keyframes pinned-in {
  from { opacity: 0; transform: translateY(-6px); }
  to   { opacity: 1; transform: none; }
}
.tile-star:focus-visible { outline: 2px solid #f5b301; }

.tile-star.pinned svg {
  fill: #f5b301;
  stroke: #f5b301;
}

.tile-title {
  font-size: 1.2rem;
  font-weight: 700;
  color: #000;
  letter-spacing: -0.01em;
}

/* Description — намеренно блеклый цвет */
.tile-desc {
  font-size: 0.85rem;
  line-height: 1.45;
  color: #9a9a9a;
  flex: 1;
}

.tile-arrow {
  align-self: flex-end;
  margin-top: 0.2rem;
  font-size: 1.4rem;
  color: #c6c6c6;
  transition: color 0.18s ease, transform 0.18s ease;
}

.tile:hover .tile-arrow,
.tile:focus-visible .tile-arrow {
  color: #e10600;
  transform: translateX(4px);
}

/* ===== Скелетон загрузки ===== */
.tile-skeleton {
  min-height: 180px;
  border-radius: 20px;
  background: linear-gradient(100deg, #f0f0f0 30%, #e6e6e6 50%, #f0f0f0 70%);
  background-size: 200% 100%;
  animation: shimmer 1.3s infinite linear;
}

@keyframes shimmer {
  from { background-position: 200% 0; }
  to { background-position: -200% 0; }
}

/* ===== Пустое состояние ===== */
.empty-state {
  padding: 2.25rem;
  text-align: center;
  color: #8a8a8a;
  font-size: 0.95rem;
  border: 1.5px dashed #d8d8d8;
  border-radius: 20px;
}

.empty-state code {
  background: #f0f0f0;
  padding: 0.15rem 0.4rem;
  border-radius: 6px;
  font-size: 0.85em;
}

@media (max-width: 560px) {
  .hub-card {
    padding: 1.8rem 1.3rem;
    border-radius: 22px;
  }

  .hub-header h1 {
    font-size: 1.5rem;
  }

  .tile-grid {
    grid-template-columns: 1fr;
  }
}

/* ======================================================
   АДМИНКА: панель, замок, кнопки Сохранить / Отменить
   ====================================================== */
.admin-dock {
  position: fixed;
  right: 1.4rem;
  bottom: 1.4rem;
  display: flex;
  align-items: center;
  gap: 0.6rem;
  z-index: 40;
}

.admin-status {
  font-size: 0.8rem;
  color: #d8d8d8;
  background: rgba(0, 0, 0, 0.55);
  padding: 0.35rem 0.7rem;
  border-radius: 10px;
}

.admin-status.ok { color: #7ee29b; }
.admin-status.err { color: #ff7a75; }

.admin-btn {
  font: inherit;
  font-size: 0.9rem;
  font-weight: 600;
  padding: 0.7rem 1.1rem;
  border-radius: 40px;
  border: 1.5px solid transparent;
  cursor: pointer;
  transition: transform 0.15s ease, background 0.15s ease, border-color 0.15s ease;
}

.admin-btn:hover { transform: translateY(-2px); }

.admin-save {
  background: #000;
  color: #fff;
}
.admin-save:hover { background: #e10600; }

.admin-cancel {
  background: #fff;
  color: #1a1a1a;
  border-color: #d8d8d8;
}
.admin-cancel:hover { border-color: #e10600; color: #e10600; }

.admin-lock {
  width: 54px;
  height: 54px;
  border-radius: 50%;
  border: 1.5px solid rgba(255, 255, 255, 0.25);
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
  font-size: 1.4rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s ease, border-color 0.15s ease, transform 0.15s ease;
}

.admin-lock:hover { background: rgba(255, 255, 255, 0.2); transform: translateY(-2px); }
.admin-lock.unlocked { border-color: #e10600; background: rgba(225, 6, 0, 0.15); }

/* ======================================================
   ОВЕРЛЕЙ ВВОДА ПАРОЛЯ (из key_booking/admin)
   ====================================================== */
.pin-overlay {
  position: fixed;
  inset: 0;
  background: #0b0b0b;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
}

.pin-overlay.hidden { display: none; }

.pin-box {
  background: #fff;
  border-radius: 24px;
  padding: 2.4rem 2rem;
  width: 340px;
  max-width: calc(100vw - 3rem);
  box-shadow: 0 30px 60px rgba(0, 0, 0, 0.5);
  text-align: center;
}

.pin-eyebrow {
  font-size: 0.7rem;
  color: #e10600;
  text-transform: uppercase;
  letter-spacing: 0.22em;
  margin-bottom: 0.5rem;
}

.pin-box h2 {
  font-size: 1.35rem;
  font-weight: 700;
  color: #000;
  margin-bottom: 1.5rem;
}

.pin-input {
  width: 100%;
  padding: 0.9rem 1rem;
  font-size: 1.2rem;
  text-align: center;
  border-radius: 14px;
  border: 1.5px solid #ddd;
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.pin-input:focus {
  border-color: #e10600;
  box-shadow: 0 0 0 3px rgba(225, 6, 0, 0.15);
}

.pin-error {
  color: #e10600;
  font-size: 0.85rem;
  margin-top: 0.6rem;
  min-height: 1.2rem;
}

.pin-btn {
  width: 100%;
  padding: 0.85rem;
  border-radius: 40px;
  border: none;
  font: inherit;
  font-weight: 600;
  cursor: pointer;
  margin-top: 0.5rem;
  transition: background 0.15s ease, color 0.15s ease;
}

.pin-submit { background: #000; color: #fff; }
.pin-submit:hover { background: #e10600; }
.pin-cancel { background: transparent; color: #888; }
.pin-cancel:hover { color: #000; }

/* ======================================================
   РЕДАКТОР КАРТОЧЕК
   ====================================================== */
/* в редакторе секции (группы) идут столбцом, карточки раскладываются в .edit-body */
.tile-grid.editing {
  grid-template-columns: 1fr;
  gap: 1.1rem;
}

.tile-edit {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  min-height: 180px;
  padding: 1rem;
  background: #fff;
  border: 1.5px solid var(--tile-border, #d8d8d8);
  border-radius: 20px;
}

.tile-edit-top {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  cursor: grab;               /* ладонь: карточку можно взять */
  touch-action: none;         /* на таче перенос, а не прокрутка страницы */
  user-select: none;
}

/* «Бровь» — компактная ручка для переноса (точки); общий вид для админки и пользователей */
.tile-edit-grip {
  flex: 1;
  align-self: stretch;
  min-width: 1rem;
  display: flex;
  align-items: center;
  justify-content: center;
}

.tile-edit-grip::before,
.tile-brow::before {
  content: '';
  width: 1.5rem;
  height: 12px;
  background: radial-gradient(circle, #c4c4c4 1.1px, transparent 1.3px) center / 6px 6px;
  transition: background 0.15s ease;
}

.tile-edit-top:hover .tile-edit-grip::before,
.tile-brow:hover::before {
  background-image: radial-gradient(circle, #8a8a8a 1.1px, transparent 1.3px);
}

.tile-edit-icon {
  width: 52px;
  height: 52px;
  flex-shrink: 0;
  border-radius: 14px;
  border: 1.5px dashed #cfcfcf;
  background: #fafafa;
  font-size: 1.7rem;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: border-color 0.15s ease;
}
.tile-edit-icon:hover { border-color: #e10600; }

.tile-edit-move {
  margin-left: auto;
  display: flex;
  gap: 0.25rem;
}

.tile-edit-move button,
.tile-edit-del {
  width: 30px;
  height: 30px;
  border-radius: 9px;
  border: 1.5px solid #e0e0e0;
  background: #fff;
  cursor: pointer;
  font-size: 0.9rem;
  color: #666;
  transition: all 0.15s ease;
}
.tile-edit-move button:hover { border-color: #e10600; color: #e10600; }
.tile-edit-del:hover { border-color: #e57373; background: #ffebee; color: #c62828; }
/* ===== Перенос карточек ===== */
.tile-edit { position: relative; }

/* сжатая ладонь на всё время переноса */
html.is-dragging,
html.is-dragging * {
  cursor: grabbing !important;
  user-select: none !important;
}

/* «скелет» списка: пунктир и номера позиций у всех карточек */
.tile-grid.dragging { counter-reset: slot; }

.tile-grid.dragging .drag-item:not(.drag-lifted),
.tile-slot {
  counter-increment: slot;
}

.tile-grid.dragging .drag-item:not(.drag-lifted) {
  border-style: dashed;
  border-color: #cfcfcf;
}

.tile-grid.dragging .drag-item:not(.drag-lifted)::before,
.tile-slot::before {
  content: counter(slot);
  position: absolute;
  top: -0.6rem;
  left: 50%;
  transform: translateX(-50%);
  min-width: 1.4rem;
  padding: 0.05rem 0.4rem;
  text-align: center;
  font-size: 0.7rem;
  font-weight: 700;
  color: #8a8a8a;
  background: #fff;
  border: 1.5px solid #d8d8d8;
  border-radius: 10px;
}

/* слот-заглушка: сюда встанет карточка */
.tile-slot {
  position: relative;
  min-height: 180px;
  border: 2px dashed #e10600;
  border-radius: 20px;
  background: rgba(225, 6, 0, 0.04);
  transition: background 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease;
}
.tile-slot::before { color: #e10600; border-color: #e10600; }

/* карточка близко к слоту — позиция подсвечивается сильнее */
.tile-slot.hot {
  background: rgba(225, 6, 0, 0.1);
  box-shadow: 0 0 0 4px rgba(225, 6, 0, 0.15), 0 0 24px rgba(225, 6, 0, 0.25);
}
.tile-slot.hot::before { background: #e10600; color: #fff; }

/* поднятая карточка следует за курсором */
.tile-edit.drag-lifted,
.tile.drag-lifted {
  position: fixed;
  z-index: 200;
  margin: 0;
  pointer-events: none;
  transform: rotate(2deg) scale(1.03);
  box-shadow: 0 24px 40px -10px rgba(0, 0, 0, 0.35);
  border-color: #e10600;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

/* «магнит»: плавный залёт в слот при отпускании */
.tile-edit.drag-lifted.settling,
.tile.drag-lifted.settling {
  transform: none;
  box-shadow: 0 6px 14px -6px rgba(0, 0, 0, 0.25);
  transition: left 0.2s cubic-bezier(0.2, 0.9, 0.3, 1.1), top 0.2s cubic-bezier(0.2, 0.9, 0.3, 1.1),
    transform 0.2s ease, box-shadow 0.2s ease;
}

.tile-edit-move button:disabled { opacity: 0.35; cursor: default; }

.tile-edit input,
.tile-edit textarea {
  width: 100%;
  padding: 0.5rem 0.65rem;
  font: inherit;
  font-size: 0.85rem;
  border: 1.5px solid #e0e0e0;
  border-radius: 10px;
  outline: none;
  transition: border-color 0.15s ease;
  background: #fff;
  color: #000;
}
.tile-edit input:focus,
.tile-edit textarea:focus { border-color: #e10600; }

.tile-edit .field-title { font-weight: 700; font-size: 1rem; }
.tile-edit .field-desc { resize: vertical; min-height: 3rem; color: #6a6a6a; }
.tile-edit .field-url { color: #1565c0; font-size: 0.8rem; }

.tile-add {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 180px;
  border: 1.5px dashed #cfcfcf;
  border-radius: 20px;
  background: transparent;
  color: #9a9a9a;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
}
.tile-add:hover { border-color: #e10600; color: #e10600; }

/* ======================================================
   ПИКЕР ИКОНОК (окно размером с карточку)
   ====================================================== */
.icon-overlay {
  position: fixed;
  inset: 0;
  background: rgba(11, 11, 11, 0.72);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 120;
}
.icon-overlay.hidden { display: none; }

.icon-modal {
  width: 280px;               /* ≈ ширина карточки */
  max-width: calc(100vw - 2rem);
  background: #fff;
  border-radius: 20px;
  border: 1.5px solid #d8d8d8;
  box-shadow: 0 30px 60px rgba(0, 0, 0, 0.45);
  padding: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.icon-modal-head {
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.icon-preview {
  width: 56px;                /* ≈ 1/5 карточки */
  height: 56px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2rem;
  border-radius: 12px;
  background: #fafafa;
  border: 1.5px solid #eee;
}

.icon-modal-title {
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #1a1a1a;
}

.icon-modal-close {
  margin-left: auto;
  width: 28px;
  height: 28px;
  border-radius: 8px;
  border: 1.5px solid #e0e0e0;
  background: #fff;
  cursor: pointer;
  color: #666;
}
.icon-modal-close:hover { border-color: #e10600; color: #e10600; }

.icon-grid {
  --icon-size: 2rem;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(3rem, 1fr));
  gap: 0.3rem;
  max-height: 260px;
  overflow-y: auto;
  padding: 0.25rem;
  border: 1px solid #eee;
  border-radius: 12px;
}

.icon-grid button {
  aspect-ratio: 1;
  border: 1.5px solid transparent;
  border-radius: 10px;
  background: transparent;
  cursor: pointer;
  font-size: var(--icon-size);
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.12s ease, border-color 0.12s ease;
}
.icon-grid button:hover { background: #f3f3f3; }
.icon-grid button.selected { border-color: #e10600; background: rgba(225, 6, 0, 0.08); }

.icon-modal-foot {
  display: flex;
  gap: 0.5rem;
}
.icon-foot-btn {
  flex: 1;
  padding: 0.65rem;
  border-radius: 30px;
  font: inherit;
  font-weight: 600;
  font-size: 0.85rem;
  cursor: pointer;
  border: 1.5px solid #d8d8d8;
  background: #fff;
  color: #1a1a1a;
  transition: all 0.15s ease;
}
.icon-clear:hover { border-color: #e57373; color: #c62828; }
.icon-apply {
  background: #000;
  color: #fff;
  border-color: #000;
}
.icon-apply:hover { background: #e10600; border-color: #e10600; }

@media (max-width: 560px) {
  .admin-dock { right: 0.9rem; bottom: 0.9rem; }
  .admin-btn { padding: 0.6rem 0.85rem; font-size: 0.82rem; }
}

/* ======================================================
   «Бровь» избранного (пользовательский перенос)
   ====================================================== */
.tile-brow {
  position: absolute;
  top: 0.35rem;
  left: 50%;
  transform: translateX(-50%);
  width: 2.6rem;              /* область захвата чуть больше видимых точек */
  height: 1.1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: grab;
  touch-action: none;
  user-select: none;
}

/* ======================================================
   Отключённые сервисы (включает/выключает только администратор)
   ====================================================== */
.tile.disabled,
.tile.disabled:hover {
  transform: none;
  background: #f3f3f3;
  border-color: #e6e6e6;
  box-shadow: none;
  cursor: not-allowed;
  user-select: none;
}

.tile.disabled > * {
  opacity: 0.5;
  filter: grayscale(1);
}

.tile.disabled .tile-title { color: #8a8a8a; }

/* подсказка «Временно недоступно» над карточкой */
.tile.disabled::after {
  content: attr(data-hint);
  position: absolute;
  left: 50%;
  bottom: calc(100% + 0.3rem);
  transform: translateX(-50%);
  white-space: nowrap;
  padding: 0.35rem 0.65rem;
  font-size: 0.75rem;
  color: #fff;
  background: #1a1a1a;
  border-radius: 8px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.15s ease;
  z-index: 5;
}
.tile.disabled:hover::after { opacity: 1; }

/* переключатель «Доступен пользователям» в редакторе */
.tile-edit-active {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.8rem;
  color: #555;
  cursor: pointer;
  user-select: none;
}
.tile-edit .tile-edit-active input[type="checkbox"] {
  width: 1rem;
  height: 1rem;
  padding: 0;
  accent-color: #e10600;
  cursor: pointer;
}
.tile-edit.off { background: #f6f6f6; }
.tile-edit.off > :not(.tile-edit-active) { opacity: 0.65; }

/* ======================================================
   ГРУППЫ КАРТОЧЕК (вид для пользователя)
   ====================================================== */
.tile-group {
  grid-column: 1 / -1;               /* группа растянута на всю ширину поля */
  border: 2px solid var(--group-border, transparent);   /* по умолчанию прозрачная */
  border-radius: 24px;
  padding: 1rem;
}

.tile-group-title {
  font-size: 1.05rem;
  font-weight: 700;
  color: #000;
  margin-bottom: 0.8rem;
}

.tile-group-body {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(255px, 1fr));
  gap: 1.1rem;
}

@media (max-width: 560px) {
  .tile-group-body { grid-template-columns: 1fr; }
  .tile-group { padding: 0.8rem; }
}

/* ======================================================
   ГРУППЫ В РЕДАКТОРЕ
   ====================================================== */
.edit-loose,
.edit-group {
  display: flex;
  flex-direction: column;
  gap: 0.7rem;
}

.edit-group {
  position: relative;
  padding: 0.5rem 1rem 1rem;
  background: #fff;
  border: 2px solid var(--group-border, #e4e4e4);   /* в редакторе «прозрачную» рамку подсказываем серой */
  border-radius: 24px;
}

.edit-section-label {
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #9a9a9a;
}

.edit-body {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(255px, 1fr));
  gap: 1.1rem;
  min-height: 72px;
}

/* верхняя строка группы — «бровь» для переноса, как у карточек */
.edit-group-top {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  min-height: 1.6rem;
  cursor: grab;
  touch-action: none;
  user-select: none;
}

.edit-group-del {
  width: 26px;
  height: 26px;
  border-radius: 8px;
  border: 1.5px solid #e0e0e0;
  background: #fff;
  color: #666;
  font-size: 0.8rem;
  cursor: pointer;
  transition: all 0.15s ease;
}
.edit-group-del:hover { border-color: #e57373; background: #ffebee; color: #c62828; }

.edit-group-head {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.8rem;
}

.group-title {
  flex: 1;
  min-width: 12rem;
  padding: 0.5rem 0.75rem;
  font: inherit;
  font-size: 1.05rem;
  font-weight: 700;
  border: 1.5px solid #e0e0e0;
  border-radius: 10px;
  outline: none;
  transition: border-color 0.15s ease;
}
.group-title:focus { border-color: #e10600; }

/* «Добавить группу»: по ширине текста + отступы, а не на всю строку */
.group-add {
  justify-self: start;
  min-height: 0;
  padding: 0.75rem 1.5rem;
}

/* группа во время переноса: тянется только по вертикали */
.edit-group.drag-lifted {
  position: fixed;
  z-index: 200;
  margin: 0;
  pointer-events: none;
  transform: rotate(0.6deg) scale(1.01);
  box-shadow: 0 24px 40px -10px rgba(0, 0, 0, 0.35);
  border-color: #e10600;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.edit-group.drag-lifted.settling {
  transform: none;
  box-shadow: 0 6px 14px -6px rgba(0, 0, 0, 0.25);
  transition: left 0.2s cubic-bezier(0.2, 0.9, 0.3, 1.1), top 0.2s cubic-bezier(0.2, 0.9, 0.3, 1.1),
    transform 0.2s ease, box-shadow 0.2s ease;
}

/* ======================================================
   ПАЛИТРА ЦВЕТА ГРАНИЦЫ (10 цветов по 5 в строке + прозрачный)
   ====================================================== */
.color-pick summary {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  font-size: 0.8rem;
  color: #555;
  cursor: pointer;
  user-select: none;
  list-style: none;
}
.color-pick summary::-webkit-details-marker { display: none; }
.color-pick summary:hover { color: #000; }

.color-dot {
  width: 1rem;
  height: 1rem;
  border-radius: 50%;
  background: var(--c, #d8d8d8);
  border: 1.5px solid rgba(0, 0, 0, 0.18);
}

/* «нет цвета»: белый круг с диагональной чертой */
.color-dot.none,
.swatch-none {
  background:
    linear-gradient(135deg, transparent 44%, #e10600 44%, #e10600 56%, transparent 56%),
    #fff;
}

.palette {
  display: grid;
  grid-template-columns: repeat(5, 1.4rem);
  gap: 0.45rem;
  margin-top: 0.5rem;
}

.swatch {
  width: 1.4rem;
  height: 1.4rem;
  border-radius: 50%;
  border: 1.5px solid rgba(0, 0, 0, 0.18);
  background: var(--c, #fff);
  padding: 0;
  cursor: pointer;
  transition: transform 0.12s ease, box-shadow 0.12s ease;
}
.swatch:hover { transform: scale(1.15); }
.swatch.selected { box-shadow: 0 0 0 2px #fff, 0 0 0 4px #1a1a1a; }

/* ======================================================
   СКЕЛЕТЫ ГРУПП на время переноса группы
   ====================================================== */
.tile-grid.dragging-groups .edit-loose .edit-body,
.tile-grid.dragging-groups .group-add,
.tile-grid.dragging-groups .edit-group .edit-body,
.tile-grid.dragging-groups .edit-group .color-pick,
.tile-grid.dragging-groups .edit-group .edit-group-del {
  display: none;
}

.tile-grid.dragging-groups .edit-group { padding-bottom: 0.7rem; }
.tile-grid.dragging-groups .group-title { pointer-events: none; }

/* ======================================================
   ПРОСМОТР ДЛЯ АДМИНА (черновик глазами пользователя)
   ====================================================== */
.admin-view {
  background: #fff;
  color: #1a1a1a;
  border-color: #d8d8d8;
}
.admin-view:hover { border-color: #e10600; color: #e10600; }

/* только посмотреть: избранное и перенос закреплённых отключены, чтобы не трогать локальные настройки */
.tile-grid.preview .tile-star,
.tile-grid.preview .tile-brow { pointer-events: none; }
