/* Поповер біля #btn-user */
.cab-popover{
  position:absolute; min-width:220px; padding:8px;
  background:#fff; border:1px solid rgba(0,0,0,.1);
  border-radius:12px; box-shadow:0 8px 24px rgba(0,0,0,.12); z-index:2000;
}
.cab-popover .cab-item{
  display:block; width:100%; text-align:left;
  padding:8px 10px; background:transparent; border:0; cursor:pointer; font:inherit;
}
.cab-popover .cab-item:hover{ background:rgba(0,0,0,.05); }

/* Модалка входу */
.cab-modal-overlay{
  position:fixed; inset:0; background:rgba(0,0,0,.35); z-index:3000;
  display:flex; align-items:center; justify-content:center;
}
.cab-modal{
  width: min(460px, 92vw);
  max-height: 92vh;                 /* ✅ обмежуємо по в’юпорту */
  display: flex;                    /* ✅ дає змогу тілу рости/скролитись */
  flex-direction: column;
  background: #fff;
  border-radius: 16px;
  padding: 18px;
  box-shadow: 0 20px 60px rgba(0,0,0,.2);
}

/* Тіло модалки: скрол усередині */
.cab-modal-body{
  flex: 1;
  min-height: 0;
  overflow-y: scroll;                 /* як у #left-panel */
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;

  /* Firefox — 1:1 як у #left-panel / .info-scroll */
  scrollbar-width: thin;
  scrollbar-color: rgba(0, 0, 0, 0.35) transparent;
}
/* Cabinet scroll = left-panel */
.cab-modal-body::-webkit-scrollbar {
  width: 8px;
}
.cab-modal-body::-webkit-scrollbar-track {
  background: transparent;
}
.cab-modal-body::-webkit-scrollbar-thumb {
  background: rgba(0, 0, 0, 0.35);
  border-radius: 8px;
}
.cab-modal-body::-webkit-scrollbar-thumb:hover {
  background: rgba(0, 0, 0, 0.5);
}

/* Контейнер списку сцен у модалці */
.cab-scenes-list{
  display: block;
  padding: 4px 0;
}

.cab-modal-title{ margin:0 0 10px 0; }
/* ===== Cabinet toast (копійовано) ===== */
#cab-toast-root{
  position: fixed;
  left: 50%;
  bottom: 16px;
  transform: translateX(-50%);
  z-index: 4000;
  pointer-events: none;
}
.cab-toast{
  background: #111;
  color: #fff;
  padding: 8px 12px;
  border-radius: 10px;
  font-size: 14px;
  line-height: 1.2;
  box-shadow: 0 8px 24px rgba(0,0,0,.25);
  opacity: 0;
  transform: translateY(8px);
  transition: opacity .18s ease, transform .18s ease;
}
.cab-toast.show{
  opacity: 1;
  transform: translateY(0);
}
/* ===== Edit modal form ===== */
.cab-form{ display:block; }

.cab-form-row{ margin:0; }

/* За замовчуванням: label над полем (Title, Description) */
.cab-form-row label{
  display:block;
  font-weight:600;
  margin:8px 0 4px;
}

/* Поля на всю ширину */
.cab-form-row input[type="text"],
.cab-form-row textarea{
  width:100%;
  box-sizing:border-box;
}

/* Description — висота і ресайз */
#sc-edit-desc{
  min-height:100px;
  resize:vertical;
}

/* Рядок Public: label і чекбокс в один рядок */
.cab-form-row label[for="sc-edit-public"]{
  display:inline-flex;
  align-items:center;
  margin:8px 8px 10px 0;   /* відступ праворуч перед чекбоксом */
  font-weight:600;
}
#sc-edit-public{
  vertical-align:middle;
  width:16px; height:16px;
}

/* Кнопки праворуч з відступом згори */
.cab-form-actions{
  display:flex;
  gap:8px;
  justify-content:flex-end;
  margin-top:10px;
}

.cab-input{
  width:100%; padding:10px; border:1px solid #ddd; border-radius:10px; margin-bottom:8px;
}
.cab-hint{ font-size:12px; opacity:.7; margin-bottom:8px; }
.cab-error{ color:#b00020; font-size:13px; margin:6px 0 8px 0; }
.cab-row{ display:flex; gap:8px; justify-content:flex-end; }
.cab-btn{
  padding:8px 12px; border-radius:10px; border:1px solid rgba(0,0,0,.12);
  background:#fff; cursor:pointer;
}
.cab-primary{ background:#0d6efd; color:#fff; border-color:#0d6efd; }
.cab-btn:disabled{ opacity:.6; cursor:not-allowed; }

/* ===== Ribbon over globe (top-left) ===== */
#globe-container { position: relative; }

#cabinet-ribbon {
  position: absolute;
  top: 10px; left: 40px;
  display: flex; gap: 8px;
  z-index: 1100;
  pointer-events: auto;
}

#cabinet-ribbon .ribbon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px; height: 24px;
  padding: 0; border: 0; background: transparent; cursor: pointer;
  border-radius: 12px;              /* лише для фокуса/наведення, без фону */
}

#cabinet-ribbon .ribbon-btn:focus-visible {
  outline: 2px solid rgba(0,0,0,.25);
  outline-offset: 2px;
}

#cabinet-ribbon .ribbon-icon {
  width: 20px; height: 20px; display: block;
}
/* ================== CABINET: універсальні тултіпи (aria-label) ================== */
/* Використання:
   <button class="has-tip" aria-label="…" data-tip-side="bottom|top|left|right">…</button>
   Показ на :hover і :focus-visible. Без title.
*/

.has-tip { position: relative; }

/* Тіло підказки */
.has-tip[aria-label]:hover::after,
.has-tip[aria-label]:focus-visible::after {
  content: attr(aria-label);
  position: absolute;
  z-index: 1000;
  max-width: 280px;
  padding: 6px 10px;
  border: 1px solid rgba(108,159,234,0.45);
  border-radius: 8px;
  background: #fff;
  color: #111;
  font-size: 12px;
  line-height: 1.25;
  white-space: nowrap;               /* для bottom/top */
  box-shadow: 0 2px 8px rgba(0,0,0,0.08);
  pointer-events: none;
}

/* Стрілочка (ромб) */
.has-tip[aria-label]:hover::before,
.has-tip[aria-label]:focus-visible::before {
  content: '';
  position: absolute;
  z-index: 1001;
  width: 8px;
  height: 8px;
  background: #fff;
  border-left: 1px solid rgba(108,159,234,0.45);
  border-top: 1px solid rgba(108,159,234,0.45);
  transform: rotate(45deg);
  pointer-events: none;
}

/* ----------- РОЗТАШУВАННЯ ----------- */
/* За замовчуванням і для data-tip-side="bottom" */
.has-tip[aria-label]:hover::after,
.has-tip[aria-label]:focus-visible::after,
.has-tip[data-tip-side="bottom"][aria-label]:hover::after,
.has-tip[data-tip-side="bottom"][aria-label]:focus-visible::after {
  top: calc(100% + 8px);
  left: 50%;
  transform: translateX(-50%);
}

.has-tip[aria-label]:hover::before,
.has-tip[aria-label]:focus-visible::before,
.has-tip[data-tip-side="bottom"][aria-label]:hover::before,
.has-tip[data-tip-side="bottom"][aria-label]:focus-visible::before {
  top: calc(100% + 4px);
  left: 50%;
  transform: translateX(-50%) rotate(45deg);
}

/* top */
.has-tip[data-tip-side="top"][aria-label]:hover::after,
.has-tip[data-tip-side="top"][aria-label]:focus-visible::after {
  bottom: calc(100% + 8px);
  left: 50%;
  transform: translateX(-50%);
}

.has-tip[data-tip-side="top"][aria-label]:hover::before,
.has-tip[data-tip-side="top"][aria-label]:focus-visible::before {
  bottom: calc(100% + 4px);
  left: 50%;
  transform: translateX(-50%) rotate(45deg);
}

/* left */
.has-tip[data-tip-side="left"][aria-label]:hover::after,
.has-tip[data-tip-side="left"][aria-label]:focus-visible::after {
  right: calc(100% + 8px);
  top: 50%;
  transform: translateY(-50%);
  white-space: normal; /* дозволяємо перенос */
}

.has-tip[data-tip-side="left"][aria-label]:hover::before,
.has-tip[data-tip-side="left"][aria-label]:focus-visible::before {
  right: calc(100% + 4px);
  top: 50%;
  transform: translateY(-50%) rotate(45deg);
}

/* right */
.has-tip[data-tip-side="right"][aria-label]:hover::after,
.has-tip[data-tip-side="right"][aria-label]:focus-visible::after {
  left: calc(100% + 8px);
  top: 50%;
  transform: translateY(-50%);
  white-space: normal;
}

.has-tip[data-tip-side="right"][aria-label]:hover::before,
.has-tip[data-tip-side="right"][aria-label]:focus-visible::before {
  left: calc(100% + 4px);
  top: 50%;
  transform: translateY(-50%) rotate(45deg);
}

/* На сенсорних пристроях тултіп не показуємо */
@media (hover: none) {
  .has-tip::after,
  .has-tip::before { display: none !important; }
}
/* === My Scenes: розмір іконок та кнопок === */
.cab-scene-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.cab-icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;   /* розмір кнопки */
  height: 28px;
  padding: 0;
  border: 0;
  background: transparent;
  line-height: 0;
  cursor: pointer;
}

.cab-icon-btn .cab-icon {
  display: block;
  width: 18px;   /* реальний розмір піктограми */
  height: 18px;
  object-fit: contain;
}
/* === My Scenes — шапка модалки (заголовок зліва, × справа) === */
.cab-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px; /* замість margin у .cab-modal-title */
}

/* Акуратна кнопка «×» на білому фоні */
.cab-close-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  background: #fff;
  color: #333;
  border: 1px solid rgba(0,0,0,.12);
  border-radius: 8px;
  line-height: 1;
  cursor: pointer;
}
.cab-close-btn:hover { background: #f7f7f7; }

/* === My Scenes — картки списку === */
.cab-scene-card {
  background: #fff;
  border-radius: 10px;
  box-shadow: 0 1px 2px rgba(0,0,0,.04);
  padding: 10px 12px;
  margin: 8px 0;            /* невеликий відступ між сценами */
}

/* Маркер перед назвою */
.cab-scene-title {
  font-weight: 600;
  display: flex;
  align-items: baseline;
}
.cab-scene-title::before {
  content: "• ";
  color: #777;
  margin-right: 2px;
}

/* Опис і дата — компактно */
.cab-scene-desc { margin-top: 2px; opacity: .9; }
.cab-scene-meta { margin-top: 2px; font-size: 12px; color: #666; }

/* Дії — дрібний відступ зверху, розмір іконок лишається як налаштовано */
.cab-scene-actions { margin-top: 6px; }


