/* LevelUp v27 — menu akcji, ustawienia konta, film i kompendium. */

/* Menu akcji renderowane na warstwie viewportu. */
.lu-v27-original-menu {
  visibility: hidden !important;
  pointer-events: none !important;
}

.lu-v27-menu-backdrop {
  position: fixed;
  z-index: 4190;
  inset: 0;
  background: transparent;
}

.lu-v27-menu-clone {
  position: fixed !important;
  z-index: 4200 !important;
  right: auto !important;
  bottom: auto !important;
  margin: 0 !important;
  transform: none !important;
  visibility: visible !important;
  pointer-events: auto !important;
  max-height: min(360px, calc(100dvh - 16px));
  overflow-y: auto !important;
  overscroll-behavior: contain;
  box-shadow: 0 24px 76px rgba(0, 0, 0, 0.68) !important;
}

/* Nadpisanie starego :has(...), który ustawiał overflow:visible i wyrzucał
   ostatniego klienta poza tabelę. */
html body.lu-v27-action-menu-open #root .dashboardView,
html body.lu-v27-action-menu-open #root .workspaceGrid,
html body.lu-v27-action-menu-open #root .clientPanel,
html body.lu-v27-action-menu-open #root .clientTable {
  min-height: 0 !important;
  overflow: hidden !important;
}

html body.lu-v27-action-menu-open #root .tableBody {
  min-height: 0 !important;
  flex: 1 1 auto !important;
  max-height: none !important;
  overflow-x: hidden !important;
  overflow-y: auto !important;
  overscroll-behavior: contain !important;
}

/* Kompendium — każdy folder ma własny wiersz, a cała siatka przewija się
   wewnątrz widoku zamiast nakładać karty. */
.moduleView:has(> .folderGrid) {
  min-height: 0 !important;
  overflow: hidden !important;
}

.moduleView > .folderGrid {
  min-height: 0 !important;
  flex: 1 1 auto !important;
  grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  grid-template-rows: none !important;
  grid-auto-rows: 190px !important;
  align-content: start !important;
  overflow-x: hidden !important;
  overflow-y: auto !important;
  overscroll-behavior: contain !important;
  padding: 0 7px 10px 0;
}

.moduleView > .folderGrid > .folderCard {
  min-height: 190px !important;
  height: 190px !important;
  overflow: hidden !important;
  grid-template-rows: auto minmax(0, 1fr) auto !important;
}

.moduleView > .folderGrid > .folderCard > div:nth-child(2) {
  min-height: 0;
  overflow: hidden;
}

.moduleView > .folderGrid > .folderCard p {
  overflow: hidden;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
}

/* Konto — oryginalne pola React są ukryte tylko wtedy, gdy aktywna jest
   zakładka Konto. Po wejściu w Bezpieczeństwo atrybut znika, więc karta
   prezentacji nie może tam pozostać. */
.settingsContent[data-lu-v27-account="1"] > :not(.settingsContentHead):not(.lu-v27-account-panel) {
  display: none !important;
}

.lu-v27-account-panel {
  margin-top: 14px;
  display: grid;
  gap: 12px;
}

.lu-v27-account-card,
.lu-v27-presentation-card {
  padding: 14px;
  background:
    radial-gradient(circle at 100% 0%, rgba(213, 179, 107, 0.065), transparent 36%),
    rgba(255, 255, 255, 0.016);
  border: 1px solid var(--border, rgba(255, 255, 255, 0.08));
  border-radius: 12px;
}

.lu-v27-section-head {
  padding-bottom: 12px;
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr);
  align-items: center;
  gap: 11px;
  border-bottom: 1px solid var(--border, rgba(255, 255, 255, 0.08));
}

.lu-v27-section-icon {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  color: var(--gold, #d5b36b);
  background: rgba(213, 179, 107, 0.08);
  border: 1px solid rgba(213, 179, 107, 0.13);
  border-radius: 12px;
}

.lu-v27-section-head > div {
  display: grid;
  gap: 4px;
}

.lu-v27-section-head strong {
  color: var(--text, #efeff2);
  font-size: 12px;
}

.lu-v27-section-head p {
  margin: 0;
  color: var(--muted, #9898a2);
  font-size: 9.5px;
}

.lu-v27-account-grid {
  margin-top: 13px;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 11px;
}

.lu-v27-presentation-grid {
  margin-top: 13px;
  display: grid;
  grid-template-columns: minmax(0, 1.12fr) minmax(300px, 0.88fr);
  gap: 12px;
  align-items: stretch;
}

.lu-v27-field,
.lu-v27-video-field {
  min-width: 0;
  display: grid;
  align-content: start;
  gap: 7px;
}

.lu-v27-field > span,
.lu-v27-video-label > span {
  color: var(--muted, #9898a2);
  font-size: 10px;
  font-weight: 680;
}

.lu-v27-field input,
.lu-v27-field textarea,
.lu-v27-password-2fa-field input {
  width: 100%;
  color: #e7e7ea;
  background: rgba(0, 0, 0, 0.18);
  border: 1px solid var(--border, rgba(255, 255, 255, 0.08));
  border-radius: 10px;
  outline: 0;
  font: inherit;
  font-size: 11px;
}

.lu-v27-field input,
.lu-v27-password-2fa-field input {
  min-height: 40px;
  padding: 0 11px;
}

.lu-v27-field textarea {
  min-height: 188px;
  padding: 11px 12px;
  resize: vertical;
  line-height: 1.55;
}

.lu-v27-field input:focus,
.lu-v27-field textarea:focus,
.lu-v27-password-2fa-field input:focus {
  border-color: rgba(213, 179, 107, 0.34);
  box-shadow: 0 0 0 3px rgba(213, 179, 107, 0.045);
}

.lu-v27-field small,
.lu-v27-video-label small,
.lu-v27-video-drop small,
.lu-v27-password-2fa-field small {
  color: var(--muted-2, #6f6f79);
  font-size: 8.5px;
}

.lu-v27-field small {
  justify-self: end;
}

.lu-v27-video-label {
  min-height: 25px;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 9px;
}

.lu-v27-video-drop[hidden],
.lu-v27-video-file[hidden] {
  display: none !important;
}

.lu-v27-video-drop {
  min-height: 188px;
  padding: 18px;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 8px;
  color: var(--muted, #9898a2);
  background: rgba(0, 0, 0, 0.14);
  border: 1px dashed rgba(213, 179, 107, 0.27);
  border-radius: 11px;
  cursor: pointer;
  text-align: center;
}

.lu-v27-video-drop:hover {
  color: #f1cf7d;
  background: rgba(213, 179, 107, 0.035);
  border-color: rgba(213, 179, 107, 0.44);
}

.lu-v27-video-drop.busy {
  opacity: 0.58;
  pointer-events: none;
}

.lu-v27-video-drop input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

.lu-v27-video-drop > span {
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  color: var(--gold, #d5b36b);
  background: rgba(213, 179, 107, 0.08);
  border-radius: 12px;
  font-size: 20px;
}

.lu-v27-video-drop strong {
  font-size: 10.5px;
}

.lu-v27-video-file {
  min-height: 188px;
  padding: 18px;
  display: grid;
  grid-template-columns: 46px minmax(0, 1fr) 38px auto;
  align-content: center;
  align-items: center;
  gap: 11px;
  background: rgba(0, 0, 0, 0.16);
  border: 1px solid var(--border, rgba(255, 255, 255, 0.08));
  border-radius: 11px;
}

.lu-v27-video-file__icon {
  width: 46px;
  height: 46px;
  display: grid;
  place-items: center;
  color: var(--gold, #d5b36b);
  background: rgba(213, 179, 107, 0.08);
  border-radius: 12px;
}

.lu-v27-video-file > div {
  min-width: 0;
  display: grid;
  gap: 4px;
}

.lu-v27-video-file strong {
  overflow: hidden;
  color: #e9e9eb;
  font-size: 10.5px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.lu-v27-video-file small {
  color: var(--muted-2, #6f6f79);
  font-size: 8.5px;
}

.lu-v27-video-preview-button,
.lu-v27-video-remove {
  min-height: 34px;
  border-radius: 9px;
}

.lu-v27-video-preview-button {
  width: 38px;
  color: #8bbcff;
  background: rgba(91, 161, 255, 0.08);
  border: 1px solid rgba(91, 161, 255, 0.18);
  font-size: 16px;
}

.lu-v27-video-remove {
  padding: 0 10px;
  color: #ff9298;
  background: rgba(255, 101, 112, 0.06);
  border: 1px solid rgba(255, 101, 112, 0.16);
  font-size: 8.5px;
}

.lu-v27-savebar {
  min-height: 58px;
  padding: 9px 10px 9px 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  background: rgba(255, 255, 255, 0.016);
  border: 1px solid var(--border, rgba(255, 255, 255, 0.08));
  border-radius: 11px;
}

.lu-v27-savebar p {
  margin: 0;
  color: var(--muted-2, #6f6f79);
  font-size: 9px;
}

.lu-v27-save {
  min-height: 36px;
  padding: 0 13px;
  color: #171209;
  background: linear-gradient(135deg, #f2cf79, #d5b36b);
  border: 0;
  border-radius: 9px;
  font-size: 9.5px;
  font-weight: 800;
}

.lu-v27-save:disabled,
.lu-v27-video-remove:disabled {
  opacity: 0.52;
  cursor: wait;
}

/* Dodatkowy kod wyłącznie przy aktywnym 2FA. */
.lu-v27-password-2fa-field {
  display: grid;
  gap: 7px;
}

.lu-v27-password-2fa-field > span {
  color: var(--muted, #9898a2);
  font-size: 10px;
  font-weight: 680;
}

.lu-v27-password-2fa-field input {
  max-width: 520px;
  letter-spacing: 0.16em;
}

/* Modal filmu. */
body.lu-v27-modal-open {
  overflow: hidden !important;
}

.lu-v27-video-modal[hidden] {
  display: none !important;
}

.lu-v27-video-modal {
  position: fixed;
  z-index: 6200;
  inset: 0;
  padding: 24px;
  display: grid;
  place-items: center;
}

.lu-v27-video-modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(3, 3, 5, 0.84);
  backdrop-filter: blur(8px);
}

.lu-v27-video-modal__dialog {
  position: relative;
  z-index: 1;
  width: min(960px, 100%);
  max-height: min(88dvh, 760px);
  overflow: hidden;
  background: #101014;
  border: 1px solid rgba(213, 179, 107, 0.18);
  border-radius: 16px;
  box-shadow: 0 34px 100px rgba(0, 0, 0, 0.72);
}

.lu-v27-video-modal__dialog > header {
  min-height: 64px;
  padding: 12px 14px 12px 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.lu-v27-video-modal__dialog > header > div {
  min-width: 0;
  display: grid;
  gap: 3px;
}

.lu-v27-video-modal__dialog header small {
  color: var(--gold, #d5b36b);
  font-size: 7.5px;
  font-weight: 800;
  letter-spacing: 0.12em;
}

.lu-v27-video-modal__dialog header strong {
  overflow: hidden;
  color: #f0f0f2;
  font-size: 13px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.lu-v27-video-modal__dialog header button {
  width: 36px;
  height: 36px;
  color: #aaaab2;
  background: rgba(255, 255, 255, 0.035);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 10px;
  font-size: 22px;
}

.lu-v27-video-modal__body {
  position: relative;
  min-height: 320px;
  max-height: calc(88dvh - 64px);
  display: grid;
  place-items: center;
  background: #050506;
}

.lu-v27-video-modal__body video {
  width: 100%;
  max-height: calc(88dvh - 64px);
  display: block;
  object-fit: contain;
  background: #050506;
}

.lu-v27-video-loading {
  padding: 24px;
  color: #aaaab2;
  font-size: 11px;
  text-align: center;
}

.lu-v27-toast {
  position: fixed;
  z-index: 7000;
  right: 22px;
  bottom: 22px;
  max-width: min(410px, calc(100vw - 32px));
  padding: 12px 14px;
  color: #eeeeef;
  background: rgba(18, 18, 22, 0.98);
  border: 1px solid rgba(213, 179, 107, 0.18);
  border-radius: 11px;
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.52);
  font-size: 10px;
  opacity: 0;
  transform: translateY(8px);
  pointer-events: none;
  transition: opacity 160ms ease, transform 160ms ease;
}

.lu-v27-toast[data-tone="success"] {
  border-color: rgba(80, 199, 137, 0.26);
}

.lu-v27-toast[data-tone="error"] {
  border-color: rgba(255, 101, 112, 0.28);
}

.lu-v27-toast.show {
  opacity: 1;
  transform: translateY(0);
}

@media (max-width: 1060px) {
  .lu-v27-account-grid,
  .lu-v27-presentation-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 900px) {
  .moduleView > .folderGrid {
    grid-template-columns: 1fr !important;
    grid-auto-rows: 180px !important;
  }

  .moduleView > .folderGrid > .folderCard {
    min-height: 180px !important;
    height: 180px !important;
  }
}

@media (max-width: 760px) {
  .lu-v27-savebar,
  .lu-v27-video-label {
    align-items: flex-start;
    flex-direction: column;
  }

  .lu-v27-save {
    width: 100%;
  }

  .lu-v27-video-file {
    grid-template-columns: 42px minmax(0, 1fr) 36px;
  }

  .lu-v27-video-remove {
    grid-column: 1 / -1;
  }

  .lu-v27-video-modal {
    padding: 10px;
  }
}
