.object-fit-contain {
  object-fit: contain;
}

/* Global utility — used by auto_checkout and other pages */
.hidden { display: none !important; }

/* ── Reports toolbar — mobile layout ─────────────────────────────────────── */
.report-btn {
  flex-shrink: 0;
  padding-left: 0.75rem;
  padding-right: 0.75rem;
}
@media (max-width: 575.98px) {
  .nk-block-between.flex-wrap .nk-block-head-content.w-100 {
    margin-top: 0.5rem;
  }
  .report-btn .icon { font-size: 1.1rem; }
}

/* ── Fix DashLite .gap-N height vs Bootstrap 5 gap utility conflict ─────────
   DashLite's spacer system defines .gap-2 { height:.75rem } for use as
   <div class="gap gap-2"></div> spacer blocks. This conflicts with Bootstrap 5's
   .gap-2 { gap:.75rem !important } on flex/grid containers. Since the spacer
   rule appears later in dashlite.css it wins, forcing a fixed height onto any
   element that uses gap-2 as a spacing utility. Fix: only apply the height
   when the element also has the .gap base class (proper spacer usage).
──────────────────────────────────────────────────────────────────────────── */
.gap-0:not(.gap), .gap-1:not(.gap), .gap-2:not(.gap),
.gap-3:not(.gap), .gap-4:not(.gap), .gap-5:not(.gap),
.gap-gs:not(.gap) { height: unset !important; }

.user-avatar img, [class^=user-avatar]:not([class*=-group]) img{
  width:100%;
  height:100%;
  object-fit: cover;
}

/* ── Page-header toolbar — mobile fixes (all admin pages) ─────────────────── */
@media (max-width: 575.98px) {

  /* Let the header stack title above toolbar with a gap */
  .nk-block-head .nk-block-between {
    flex-wrap: wrap;
    gap: 10px;
  }

  /* Keep the toolbar flush to the right even when stacked */
  .nk-block-head .nk-block-between > .nk-block-head-content:last-child:not(:first-child) {
    margin-left: auto;
  }

  /* The absolute dropdown must escape any overflow clipping on the parent */
  .nk-block-head {
    overflow: visible !important;
  }

  /* Dropdown panel: full width, clear of header, good shadow */
  .nk-block-tools-toggle .toggle-expand-content {
    position: absolute;
    left: 0 !important;
    right: 0 !important;
    top: 100% !important;
    z-index: 200;
    background: #fff;
    box-shadow: 0 12px 32px rgba(0,0,0,.15);
    border-top: 1px solid #e5e7eb;
    padding: 12px 18px !important;
    margin-left: 0 !important;
    margin-right: 0 !important;
  }

  /* Stack buttons vertically inside the dropdown */
  .nk-block-tools-toggle .nk-block-tools {
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
    padding-top: 4px;
    padding-bottom: 4px;
  }

  /* Full-width buttons */
  .nk-block-tools-toggle .nk-block-tools > li {
    width: 100%;
  }

  .nk-block-tools-toggle .nk-block-tools > li > a,
  .nk-block-tools-toggle .nk-block-tools > li > button {
    width: 100%;
    justify-content: flex-start;
  }

  /* Remove auto-left-margin override for opt item — looks better stacked */
  .nk-block-tools-toggle .nk-block-tools-opt {
    margin-left: 0 !important;
  }
}

/* Dark-mode dropdown background */
@media (max-width: 575.98px) {
  .dark-mode .nk-block-tools-toggle .toggle-expand-content {
    background: #1f2937;
    border-top-color: #374151;
    box-shadow: 0 12px 32px rgba(0,0,0,.45);
  }
}
/* ── Toolbar "Add New" button — show on all screen sizes ─────────────────── */
/*
 * Several pages mark the primary CTA as d-none d-sm-block which hides it on
 * mobile.  We undo that here so the button is always visible.  It still sits
 * inside the toggle-expand dropdown on <576px thanks to the page-header fix
 * above, so it doesn't cause layout overflow.
 */
.nk-block-tools .nk-block-tools-opt.d-none {
  display: list-item !important;
}
/* ── end toolbar button visibility fix ────────────────────────────────────── */

/* ── end wallet card mobile fix ───────────────────────────────────────────── */



/* card base */
.creative-card {
  border-radius: 14px;
  overflow: hidden;
  border: 1px solid #e5e5e5;
  transition: .15s;
  content-visibility: auto;
  contain-intrinsic-size: 320px 260px;
}

.creative-card:hover {
  border-color: #3b82f6;
  box-shadow: 0 0 0 2px rgba(59,130,246,.25);
}

.slide-card-skeleton {
  pointer-events: none;
}

.slide-card-skeleton .thumb-area {
  background: linear-gradient(90deg, #eef2f7 25%, #f8fafc 37%, #eef2f7 63%);
  background-size: 400% 100%;
  animation: slideSkeletonShimmer 1.25s ease infinite;
}

.slide-card-skel-thumb {
  width: 100%;
  height: 100%;
  min-height: 0;
  background: linear-gradient(90deg, #eef2f7 25%, #f8fafc 37%, #eef2f7 63%);
  background-size: 400% 100%;
  animation: slideSkeletonShimmer 1.25s ease infinite;
}

.slide-card-skel-line {
  display: block;
  height: 12px;
  border-radius: 999px;
  background: linear-gradient(90deg, #eef2f7 25%, #f8fafc 37%, #eef2f7 63%);
  background-size: 400% 100%;
  animation: slideSkeletonShimmer 1.25s ease infinite;
}

.slide-card-skel-title {
  width: 68%;
  margin-bottom: 12px;
}

.slide-card-skel-meta-row {
  display: flex;
  align-items: center;
  gap: 16px;
}

.slide-card-skel-meta {
  width: 42%;
}

.slide-card-skel-meta.short {
  width: 26%;
}

.slides-page-loading .slide-card-skeleton {
  display: block;
}

.slide-card-skeleton-wrap {
  display: none;
}

.slides-page-loading .slide-card-skeleton-wrap {
  display: block;
}

/* thumbnail area — uniform 16:9 landscape card for all slides.
   Portrait thumbnails letterbox inside via object-fit: contain. */
.thumb-area {
  aspect-ratio: 16 / 9;
  background: #1f2937;
  position: relative;
  overflow: hidden;
}
/* Landscape thumbnails fill the card (cover). Portrait thumbnails letterbox. */
.thumb-area > img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover !important;
  background: #1f2937;
  opacity: 0;
  transition: opacity .18s ease;
}
.thumb-area > img.is-loaded {
  opacity: 1;
}
.creative-card[data-orientation="9"] .thumb-area > img,
.creative-card[data-is-portrait="1"] .thumb-area > img,
.sc-card[data-orientation="9"] .thumb-area > img,
.sc-card[data-is-portrait="1"] .thumb-area > img,
.thumb-area.is-portrait > img {
  object-fit: contain !important;
}
/* Playlist card thumbnail cells: fill the grid cell so no large letterbox.
   Portrait slides are cropped to fit (same approach as OptiSigns/dashboard). */
.playlist-card .thumb {
  width: 100%;
  height: 82px;
  object-fit: cover !important;
  background: #f3f4f6;
  border-radius: 6px;
}
.py-2 {
border-top: 1px solid #e3e3e3;
}

/* card hover controls */
.select-check {
  position: absolute;
  top: 8px;
  left: 8px;
  z-index: 3;
}

.select-check .form-check-input {
  width: 20px;
  height: 20px;
  border-radius: 50%;
}

.action-overlay {
  position: absolute;
  inset: 0;
  background: rgba(59,130,246,.45);
  opacity: 0;
  pointer-events: none;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: opacity .15s ease;
}

.thumb-area:hover .action-overlay,
.thumb-area-playlist:hover .action-overlay,
.creative-card:hover .action-overlay,
.playlist-card:hover .action-overlay,
.sc-thumb-area:hover .sc-action-overlay,
.sc-card:hover .sc-action-overlay {
  opacity: 1;
  pointer-events: auto;
}

/* checkbox */
.slide-icon-toolbar.slide-toolbar-vertical {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0;
  padding: 8px 8px 16px;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 0px;
  margin-bottom: 2px;
  width: 100%;
  box-sizing: border-box;
}
.slide-toolbar-label {
  font-size: 12px;
  font-weight: 700;
  color: #2563eb;
  text-transform: uppercase;
  letter-spacing: .5px;
  margin-bottom: 2px;
  padding-left: 2px;
}
.slide-toolbar-btnrow {
  display: flex;
  flex-direction: row;
  align-items: flex-end;
  gap: 2px;
  width: 100%;
  flex-wrap: wrap;
  justify-content: flex-start;
}
.slide-icon-btn-vertical {
  flex-direction: column !important;
  align-items: center !important;
  justify-content: flex-start !important;
  min-width: 44px;
  padding: 6px 2px 4px 2px;
  gap: 1px !important;
}
.slide-btn-icon {
  display: block;
  margin-bottom: 2px;
}
.slide-btn-label {
  display: block;
  font-size: 10px;
  font-weight: 500;
  line-height: 1.1;
  margin-top: 0;
  text-align: center;
  white-space: nowrap;
}

.thumb-area:hover .action-overlay {
  flex-direction: row;
}

/* icons group */
.overlay-inner {
  display: flex;
  align-items: center;
  gap: 14px;
}

.sc-overlay-inner {
  position: relative;
  width: 100%;
  height: 100%;
  justify-content: center;
}

.sc-select-check {
  position: absolute;
  top: 8px;
  left: 8px;
  z-index: 6;
}

.sc-select-check .form-check-input {
  margin: 0;
}

/* overlay icons look bolder */
.overlay-icon {
  color: #fff;
  font-size: 24px;
  font-weight: 900;
  cursor: pointer;
  transition: transform .12s ease, opacity .12s ease;
}

/* hover effect on icons */
.overlay-icon:hover {
  transform: scale(1.25);
  opacity: .85;
}

.sc-menu-trigger {
  border: 0;
  background: transparent;
  padding: 0;
  margin: 0;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}


.divider {
  width: 1px;
  height: 22px;
  background: rgba(255,255,255,.65);
}


.card-menu {
  position: absolute;
  min-width: 180px;
  background: #fff;
  border-radius: 8px;
  padding: 4px 0;
  border: 1px solid rgba(0,0,0,.08);
  box-shadow: 0 8px 18px rgba(0,0,0,.15);
  z-index: 9999;
  display: none;
}

.card-menu.show {
  display: block;
}

.card-menu-item {
  width: 100%;
  border: none;
  background: transparent;
  padding: 6px 10px;
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: #333;
  cursor: pointer;
}

.card-menu-item:hover {
  background: #f2f5ff;
}

.card-menu-item svg {
  flex-shrink: 0;
}

.card-menu-item span {
  flex: 1;
  text-align: left;
}



.tag-dropdown {
  position: absolute;
  background: white;
  border: 1px solid #ddd;
  margin-top: 4px;
  width: 300px;
  display: none;
  z-index: 30;
}

.tag-item {
  padding: 8px 10px;
  cursor: pointer;
}

.tag-item:hover {
  background: #f5f8ff;
}



.tag-wrapper {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  padding: 8px;
  border: 1px solid #d4deea;
  border-radius: 12px;
  background-color: #fff;
  min-height: 52px;
  cursor: text;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.tag-wrapper:focus-within {
  border-color: #3b82f6;
  box-shadow: 0 0 0 3px rgba(59,130,246,.14);
}

.tag-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}


.tag-chip i {
  color: #5b6aaa;
}

.tag-chip button {
  border: none;
  background: transparent;
  color: #333;
  padding: 0;
  cursor: pointer;
}

.tag-input {
  border: none !important;
  outline: none;
  flex: 1;
  min-width: 140px;
  min-height: 32px;
  font-size: 14px;
  color: #1f2937;
}

.tag-dropdown {
  position: absolute;
  background: white;
  border: 1px solid #ddd;
  margin-top: 4px;
  width: 300px;
  display: none;
  z-index: 50;
}

.tag-chip {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  background: linear-gradient(180deg, #f3f7ff 0%, #e9f1ff 100%);
  border: 1px solid #cdddf8;
  border-radius: 999px;
  padding: 6px 9px 6px 10px;
  font-size: 12px;
  font-weight: 600;
  line-height: 1;
  color: #24406d;
  max-width: 100%;
}

.tag-chip i {
  color: #2563eb;
  font-size: 12px;
  flex-shrink: 0;
}

.tag-chip > span {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 180px;
}

.tag-chip .remove-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  min-width: 18px;
  height: 18px;
  min-height: 18px;
  border: none;
  border-radius: 999px;
  background: rgba(37, 99, 235, 0.12);
  color: #1d4ed8;
  cursor: pointer;
  font-size: 13px;
  font-weight: 700;
  line-height: 1;
  padding: 0;
  transition: background 0.15s ease, color 0.15s ease;
}

.tag-chip .remove-btn:hover {
  background: #dbeafe;
  color: #1e40af;
}

/* Keep tag-chip close buttons compact even when panel-level button rules apply. */
#properties .tag-chip .remove-btn {
  width: 18px;
  min-width: 18px;
  height: 18px;
  min-height: 18px;
  font-size: 13px;
  padding: 0;
}

@media (max-width: 991px) {
  .tag-wrapper {
    gap: 8px;
    padding: 8px;
    border-radius: 12px;
  }

  .tag-chip {
    font-size: 12px;
    padding: 7px 10px;
  }

  .tag-chip > span {
    max-width: 150px;
  }
}

.folder-modal {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.4);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 999;
}

.folder-modal.hidden {
  display: none;
}

.folder-card {
  width: 320px;
  background: #fff;
  border-radius: 12px;
  padding: 16px;
  box-shadow: 0 10px 40px rgba(0,0,0,.15);
}

.folder-header {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 600;
  margin-bottom: 12px;
}

.folder-header .icon {
  width: 20px;
  height: 20px;
}

.icon-btn {
  margin-left: auto;
  background: none;
  border: none;
  cursor: pointer;
}

.folder-card input {
  width: 100%;
  padding: 10px 12px;
  border-radius: 8px;
  border: 1px solid #ddd;
  margin-bottom: 14px;
}

.folder-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

.btn {
  padding: 8px 14px;
  border-radius: 8px;
  cursor: pointer;
}

.btn.primary {
  background: #2563eb;
  color: #fff;
  border: none;
}

.btn.ghost {
  background: transparent;
  border: 1px solid #ddd;
}

.folder-row{
  position: relative;
}


.folder-actions{
  position:absolute;
  top:8px;
  right:8px;
  display:flex;
  gap:4px;
  opacity:0;
  transform:translateY(-4px);
  transition:.15s ease;
}

.folder-row:hover .folder-actions{
  opacity:1;
  transform:translateY(0);
}

.folder-actions button{
  width:25px;
  height:25px;
  border-radius:5px;
  border:1px solid rgba(0,0,0,.08);
  background:rgba(255,255,255,.9);
  display:flex;
  align-items:center;
  justify-content:center;
  cursor:pointer;
}

.folder-actions button:hover{
  background:#fff;
  border-color:rgba(0,0,0,.15);
}

.cal-backdrop{
  position:fixed; inset:0; background:rgba(7,12,24,.6);
  backdrop-filter: blur(4px);
  display:flex; align-items:center; justify-content:center; z-index:9999;
}
.cal-modal{
  width:540px; max-width:94vw; background:#fff; border-radius:20px;
  box-shadow:0 24px 72px rgba(5,12,30,.35); position:relative; overflow:hidden;
  font-family: system-ui, -apple-system, Segoe UI, Roboto, Arial;
}
.cal-header{ padding:24px 24px 12px 24px; border-bottom:1px solid #edf0f5; background:linear-gradient(180deg,#f7faff,#ffffff); }
.cal-kicker{ display:inline-flex; align-items:center; font-size:11px; font-weight:700; letter-spacing:.08em; text-transform:uppercase; color:#2563eb; background:#eaf1ff; border-radius:999px; padding:6px 10px; }
.cal-header h2{ margin:12px 0 0 0; font-size:28px; letter-spacing:-0.5px; color:#0f172a; }
.cal-header p{ margin:8px 0 0 0; color:#4b5563; font-size:14px; line-height:1.5; max-width:92%; }
.cal-close{
  position:absolute; right:14px; top:14px;
  border:none; background:#ffffff; font-size:14px; cursor:pointer;
  width:36px; height:36px; border-radius:10px;
  border:1px solid #e5e7eb;
}
.cal-close:hover{ background:#f8fafc; }
.cal-card{
  margin:18px 22px 16px 22px; border:1px solid #dbe7ff; border-radius:14px;
  cursor:pointer; background:linear-gradient(135deg,#f9fbff,#f1f5ff);
  transition:all .18s ease;
}
.cal-card:hover{ transform:translateY(-1px); box-shadow:0 8px 24px rgba(37,99,235,.15); }
.cal-card-inner{ display:flex; align-items:center; padding:16px; gap:14px; }
.cal-gicon-box{
  width:72px; height:72px; border-radius:16px; background:#e9f1ff;
  display:flex; align-items:center; justify-content:center; font-size:34px;
  color:#2b6cff; font-weight:700;
}
.cal-card-copy{ flex:1; min-width:0; }
.cal-glabel{
  display:inline-flex; align-items:center; background:#1e3a8a; color:#fff; padding:7px 10px; border-radius:9px;
  font-weight:600; font-size:12px; width:max-content;
}
.cal-subtext{
  padding:8px 0 0 0; color:#475569; font-size:13px; line-height:1.45;
}
.cal-card-arrow{ font-size:12px; font-weight:700; color:#1d4ed8; background:#dbeafe; border:1px solid #bfdbfe; border-radius:999px; padding:8px 12px; }
.cal-step2{ padding:0 22px 22px 22px; border-top:1px dashed #e5e7eb; }
.cal-step-head{ margin-top:16px; font-size:12px; text-transform:uppercase; letter-spacing:.08em; color:#64748b; font-weight:700; }
.cal-label{ display:block; margin:10px 0 6px; color:#444; font-weight:600; }
.cal-select{
  width:100%; padding:11px 12px; border:1px solid #d9dce1; border-radius:10px;
  font-size:14px; background:#fff; height: 42px;
}
.cal-import{
  margin-top:14px; width:100%; padding:12px 14px;
  border:none; border-radius:10px; background:linear-gradient(135deg,#1e40af,#2563eb); color:#fff;
  font-size:14px; font-weight:700; cursor:pointer;
}
.cal-import:hover{ opacity:.92; }
.cal-status{ margin-top:10px; font-size:12px; color:#334155; min-height:18px; }

.ev-wrap{
  width:100%;
  height:100%;
  display:flex;
  flex-direction:column;
  gap:10px;
  border-radius:16px;
  padding:12px;
  box-sizing:border-box;
  border:1px solid rgba(148,163,184,.22);
  background:linear-gradient(180deg,#ffffff,#f8fbff);
  overflow:hidden;
}

.ev-head{
  display:flex;
  justify-content:space-between;
  align-items:flex-start;
  gap:10px;
  padding:6px 8px;
}

.ev-kicker{
  font-size:10px;
  text-transform:uppercase;
  letter-spacing:.08em;
  font-weight:700;
  color:#2563eb;
}

.ev-heading{
  font-size:15px;
  font-weight:700;
  color:var(--ev-heading-color,#0f172a);
  margin-top:2px;
  max-width:280px;
  white-space:nowrap;
  text-overflow:ellipsis;
  overflow:hidden;
}

.ev-month{
  font-size:12px;
  color:var(--ev-heading-color,#334155);
  font-weight:600;
  text-align:right;
}

.ev-count{
  margin-top:2px;
  font-size:11px;
  color:var(--ev-muted-color,#64748b);
  text-align:right;
}

.ev-list{
  margin:0;
  padding:0 2px 2px;
  list-style:none;
  display:flex;
  flex-direction:column;
  gap:8px;
  overflow:auto;
}

.ev-item{
  display:grid;
  grid-template-columns:64px 1fr;
  gap:10px;
  align-items:center;
  border:1px solid #e2e8f0;
  border-radius:12px;
  padding:9px;
  background:#ffffff;
}

.ev-item-holiday{
  border-color:#fed7aa;
  background:linear-gradient(135deg,#fff9f2,#ffffff);
}

.ev-item-exam{
  border-color:#fecaca;
  background:linear-gradient(135deg,#fff5f5,#ffffff);
}

.ev-item-class{
  border-color:#bfdbfe;
  background:linear-gradient(135deg,#f4f8ff,#ffffff);
}

.ev-item-deadline{
  border-color:#fde68a;
  background:linear-gradient(135deg,#fffbeb,#ffffff);
}

.ev-item-meeting{
  border-color:#c4b5fd;
  background:linear-gradient(135deg,#f7f4ff,#ffffff);
}

.ev-item-activity{
  border-color:#bbf7d0;
  background:linear-gradient(135deg,#f0fdf4,#ffffff);
}

.ev-date-col{
  border-radius:10px;
  background:#f1f5f9;
  text-align:center;
  padding:8px 6px;
}

.ev-day-num{
  font-size:20px;
  line-height:1;
  font-weight:800;
  color:var(--ev-heading-color,#0f172a);
}

.ev-date{
  margin-top:5px;
  font-size:11px;
  color:var(--ev-muted-color,#475569);
  text-transform:uppercase;
  letter-spacing:.04em;
}

.ev-main-col{ min-width:0; }

.ev-top-row{
  display:flex;
  align-items:flex-start;
  justify-content:space-between;
  gap:8px;
}

.ev-title{
  color:var(--ev-color,#0f172a);
  font-size:var(--ev-font,14px);
  font-weight:700;
  line-height:1.25;
  overflow:hidden;
  text-overflow:ellipsis;
  white-space:nowrap;
}

.ev-chip{
  font-size:10px;
  font-weight:700;
  color:#92400e;
  background:#ffedd5;
  border:1px solid #fdba74;
  border-radius:999px;
  padding:3px 7px;
  flex-shrink:0;
}

.ev-chip-holiday{
  color:#92400e;
  background:#ffedd5;
  border-color:#fdba74;
}

.ev-chip-exam{
  color:#991b1b;
  background:#fee2e2;
  border-color:#fca5a5;
}

.ev-chip-class{
  color:#1e3a8a;
  background:#dbeafe;
  border-color:#93c5fd;
}

.ev-chip-deadline{
  color:#92400e;
  background:#fef3c7;
  border-color:#fcd34d;
}

.ev-chip-meeting{
  color:#5b21b6;
  background:#ede9fe;
  border-color:#c4b5fd;
}

.ev-chip-activity{
  color:#166534;
  background:#dcfce7;
  border-color:#86efac;
}

.ev-time{
  margin-top:4px;
  color:var(--ev-color,#334155);
  font-weight:600;
}

.ev-loc{
  margin-top:4px;
  color:var(--ev-muted-color,#64748b);
  font-size:11px;
  overflow:hidden;
  text-overflow:ellipsis;
  white-space:nowrap;
}

.ev-empty{
  flex:1;
  display:flex;
  align-items:center;
  justify-content:center;
  border:1px dashed #cbd5e1;
  border-radius:12px;
  color:#64748b;
  font-size:13px;
  background:#f8fafc;
}

.ev-wrap.ev-theme-light{
  border:1px solid rgba(148,163,184,.22);
  background:linear-gradient(180deg,#ffffff,var(--ev-surface-bg,#f8fbff));
}

.ev-wrap.ev-theme-dark{
  border:1px solid rgba(71,85,105,.6);
  background:linear-gradient(180deg,var(--ev-surface-bg,#0f172a),#0b1220);
}

.ev-wrap.ev-theme-dark .ev-kicker{
  color:var(--ev-accent,#93c5fd);
}

.ev-wrap.ev-theme-light .ev-kicker{
  color:var(--ev-accent,#2563eb);
}

.ev-wrap.ev-theme-dark .ev-heading,
.ev-wrap.ev-theme-dark .ev-day-num,
.ev-wrap.ev-theme-dark .ev-title,
.ev-wrap.ev-theme-dark .ev-time,
.ev-wrap.ev-theme-dark .ev-month{
  color:var(--ev-heading-color,#e2e8f0);
}

.ev-wrap.ev-theme-dark .ev-count,
.ev-wrap.ev-theme-dark .ev-date,
.ev-wrap.ev-theme-dark .ev-loc{
  color:var(--ev-muted-color,#94a3b8);
}

.ev-wrap.ev-theme-dark .ev-item{
  border-color:#334155;
  background:#111827;
}

.ev-wrap.ev-theme-dark .ev-date-col{
  background:#1e293b;
}

.ev-wrap.ev-theme-dark .ev-empty{
  border-color:#334155;
  color:#94a3b8;
  background:#0f172a;
}

.ev-wrap.ev-theme-dark .ev-item-holiday{
  border-color:#92400e;
  background:linear-gradient(135deg,#2a1a0b,#111827);
}

.ev-wrap.ev-theme-dark .ev-item-exam{
  border-color:#7f1d1d;
  background:linear-gradient(135deg,#2a1111,#111827);
}

.ev-wrap.ev-theme-dark .ev-item-class{
  border-color:#1e3a8a;
  background:linear-gradient(135deg,#0d1b3a,#111827);
}

.ev-wrap.ev-theme-dark .ev-item-deadline{
  border-color:#854d0e;
  background:linear-gradient(135deg,#2a210c,#111827);
}

.ev-wrap.ev-theme-dark .ev-item-meeting{
  border-color:#5b21b6;
  background:linear-gradient(135deg,#22123a,#111827);
}

.ev-wrap.ev-theme-dark .ev-item-activity{
  border-color:#166534;
  background:linear-gradient(135deg,#122b1b,#111827);
}



.cal-source-box{
  border:1px solid #e5e7eb;
  border-radius:12px;
  padding:12px;
  margin-bottom:14px;
  background:#fff;
}
.cal-source-row{
  display:flex;
  align-items:center;
  justify-content:space-between;
}
.cal-source-left{
  display:flex;
  gap:12px;
  align-items:center;
}
.cal-source-icon{
  width:36px;
  height:36px;
  border-radius:10px;
  background:#e9f1ff;
  color:#2563eb;
  display:flex;
  align-items:center;
  justify-content:center;
  font-weight:700;
}
.cal-source-title{
  font-weight:600;
  font-size:15px;
}
.cal-source-sub{
  font-size:13px;
  color:#6b7280;
}
.cal-source-edit{
  color:#2563eb;
  font-weight:600;
  cursor:pointer;
  font-size:14px;
}
.cal-source-icon svg{
  width: 100%;
  height: 100%;
  display: block;
}

.cal-override-list{
  display:flex;
  flex-direction:column;
  gap:8px;
  margin-top:8px;
  max-height:220px;
  overflow:auto;
  padding-right:4px;
}

.cal-override-row{
  display:grid;
  grid-template-columns:1fr 110px;
  gap:8px;
  align-items:center;
}

.cal-override-name{
  font-size:12px;
  color:#334155;
  white-space:nowrap;
  text-overflow:ellipsis;
  overflow:hidden;
}

.cal-override-empty{
  margin-top:8px;
  font-size:12px;
  color:#64748b;
}

.cal-override-toggle-row{
  margin-top:6px;
}

.cal-override-toggle{
  width:100%;
  border:1px solid #cbd5e1;
  background:#f8fafc;
  color:#334155;
  border-radius:8px;
  font-size:12px;
  font-weight:600;
  padding:8px 10px;
  cursor:pointer;
}

.cal-override-toggle:hover{
  background:#f1f5f9;
}

.mc-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  grid-auto-rows: 8px;
  align-items: start;
}

@media (max-width: 980px) {
  .mc-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 680px) {
  .mc-grid {
    grid-template-columns: 1fr;
  }
}

.mc-card {
  position: relative;
  border-radius: 5px;
  overflow: hidden;
  background:#f8f8f8;
  cursor: pointer;
  transition:.15s;
  grid-row-end: span 26;
}

.mc-card:hover {
  box-shadow:0 10px 25px rgba(0,0,0,.1);
  transform:translateY(-2px);
}

.mc-thumb {
  position: relative;
  width: 100%;
  padding-top: 100%;
  background:#eee;
}

.mc-thumb img,
.mc-thumb video {
  position: absolute;
  inset: 0;
  width:100%;
  height:100%;
  object-fit:cover;
  display:block;
  opacity: 0;
  transition: opacity .15s ease;
}
.mc-thumb img.loaded,
.mc-thumb video.loaded {
  opacity: 1;
}

.mc-audio {
  width:100%;
  height:100%;
  display:flex;
  align-items:center;
  justify-content:center;
  color:#555;
  font-size:13px;
}

.mc-hover {
  position:absolute;
  inset:0;
  display:flex;
  align-items:center;            /* center vertically */
  justify-content:center;        /* center horizontally */
  padding:10px;
  opacity:0;
  pointer-events:none;
  background:linear-gradient(to top, rgba(0,0,0,.45), transparent);
  transition:.15s;
}

.mc-card:hover .mc-hover {
  opacity:1;
  pointer-events:auto;
}

/* button style */
.mc-insert {
  background: none;
  color: #dededeff;
  border:0;
  border-radius:999px;
  padding:6px 12px;
  display:inline-flex;
  align-items:center;
  gap:6px;
  font-size:18px;
  cursor:pointer;
}

.mc-insert svg {
  flex-shrink:0;
}
 .creative-eye {
  color: #9aa0a6; /* grey */
  display: inline-flex;
  align-items: center;
}


/* GRID — 4-column dense grid matching screenshot layout */
.tpl-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  grid-auto-flow: dense;
  gap: 6px;
  align-items: start;
}

/* Template card */
.tpl-card {
  display: block;
  width: 100%;
  cursor: pointer;
  border-radius: 6px;
  overflow: hidden;
  background: #1a1a1a;
  box-shadow: 0 2px 8px rgba(0,0,0,.3);
  transition: box-shadow .15s, transform .15s;
  grid-row-end: auto !important;
}

/* Landscape (16:9, 4:3) — 2 of 4 cols (half width) */
.tpl-card.tpl-landscape {
  grid-column: span 2;
}

/* Landscape full-width — all 4 cols */
.tpl-card.tpl-landscape-full {
  grid-column: span 4;
}

/* Portrait (9:16) — 1 of 4 cols (narrow tall) */
.tpl-card.tpl-portrait {
  grid-column: span 1;
}

/* Square (1:1) — 2 of 4 cols */
.tpl-card.tpl-square {
  grid-column: span 2;
}

.tpl-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 18px rgba(0,0,0,.14);
}

.tpl-card .thumb-wrap {
  position: relative;
  width: 100%;
  display: block;
  overflow: hidden;
}

.tpl-card .thumb {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.tpl-card-label {
  display: none;
  font-weight: 500;
  color: #2b2b2b;
  padding: 4px 5px 5px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* hide old template card classes */
.creative-badge, .creative-corner, .creative-eye { display: none !important; }


  .mc-back-btn {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  padding: 6px 10px;
  border-radius: 5px;
  background: #f4f5f7;
  border: 1px solid #e0e0e0;
  color: #333;
  font-size: 12px;
  font-weight: 400;
  cursor: pointer;
  transition: background .15s ease, box-shadow .15s ease;
}

.mc-back-btn:hover {
  background: #ececff;
  box-shadow: 0 2px 6px rgba(0,0,0,.08);
}

.mc-back-btn svg {
  flex-shrink: 0;
}

/* CATEGORY GRID */
.mc-category-grid {
  margin-top: 10px;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 18px;
  margin-bottom: 10px;
}

.mc-category-card {
  cursor: pointer;
  text-align: center;
}

.mc-category-thumb {
  height: 50px;
  border-radius: 5px;
  background: linear-gradient(135deg, #e3f2fd, #ede7f6);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: bold;
  color: #555;
}

.mc-category-name {
  margin-top: 8px;
  font-size: 12px;
}

.mc-category-card:hover .mc-category-thumb {
  background: linear-gradient(135deg, #e6ddff, #ddd2ff);
}

    .hidden-input{
    display:none !important;
    opacity:0;
    pointer-events:none;
    position:absolute;
    left:-9999px;
}

    .upload-box{
    display:flex;
    align-items:center;
    gap:10px;
}

.upload-btn{
    background:#105496;
    color:white;
    border:none;
    padding:14px 30px;
    font-size:16px;
    border-radius:14px;
    cursor:pointer;
    font-weight:600;
}

.dots-btn{
    width:42px;
    height:38px;
    border-radius:5px;
    border:none;
    background:#105496;
    color:white;
    font-size:26px;
    cursor:pointer;
}

.menu-wrapper{
    position:relative;
}

.upload-menu{
    position:absolute;
    top:60px;
    right:0;
    background:white;
    width:220px;
    border-radius:14px;
    box-shadow:0 10px 30px rgba(0,0,0,.15);
    display:none;
    overflow:hidden;
    z-index:9999;
}

.menu-item{
    padding:16px;
    display:flex;
    align-items:center;
    gap:12px;
    cursor:pointer;
    font-weight:600;
}

.menu-item-icon{
  width:24px;
  height:24px;
  flex:0 0 24px;
  display:block;
}

.menu-item:hover{
    background:#f2f2f2;
}

.gdrive-icon{
  object-fit:contain;
}

.folder-icon{
  color:#6b7280;
}

    .media-search {
  margin-bottom: 10px;
}

#mediaSearch {
  width: 100%;
  padding: 8px 10px;
  border-radius: 5px;
  border: 1px solid #ddd;
}

#mediaSearch:focus {
  outline: none;
  border-color: #d41c58;
}


  #mediaGridWrap {
  position: relative;
}

#mediaDropOverlay {
  position: absolute;
  inset: 0;                 /* fills only the wrapper */
  background: rgba(0,0,0,.45);
  color: #fff;
  font-size: 16px;
  display: none;
  align-items: center;
  justify-content: center;
  border-radius: 6px;
  z-index: 20;
}

#mediaDropOverlay.active {
  display: flex;
}

/* FOLDER ROW LIST STYLE */
/* FOLDER LIST VIEW */

#mediaGrid.folders-view {
  display: block !important;
  column-count: initial !important;
}

.folder-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border-radius: 10px;
  background: #fff;
  box-shadow: 0 1px 3px rgba(0,0,0,.06);
  margin-bottom: 10px;
  cursor: pointer;
}

.folder-row:hover {
  background: #fafafa;
}

.folder-row.create {
  border: 2px dashed #ddd;
  background: transparent;
  box-shadow: none;
}

.folder-row .thumb {
  width: 52px;
  height: 52px;
  border-radius: 8px;
  background: #f1f1f1;
  background-size: cover;
  background-position: center;
}

.folder-row .create-thumb {
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 26px;
  color: #777;
}

.folder-row .info .name {
  font-weight: 600;
  margin-bottom: 4px;
}

.folder-row .meta {
  display: flex;
  gap: 10px;
  align-items: center;
  font-size: 10px;
  color: #666;
}

.folder-row .badge.lock {
  padding: 2px 8px;
  border-radius: 2px;
  background: #eee;
  color: #707070;
font-size: 10px;
font-weight: 500;
}

.badge.lock {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.badge.lock svg {
  flex-shrink: 0;
}

/* Media center — back-to-folders button */
#mediaFolderBack {
  padding: 6px 2px 8px;
  width: 100%;
}

.media-folder-back-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: none;
  border: none;
  cursor: pointer;
  font-size: 13px;
  font-weight: 600;
  color: #444;
  padding: 4px 6px;
  border-radius: 6px;
  transition: background .15s, color .15s;
}

.media-folder-back-btn:hover {
  background: #f1f1f1;
  color: #d41c58;
}

.media-folder-back-btn svg {
  flex-shrink: 0;
}

.search-input {
  width: 100%;
  padding: 8px 12px;
  border-radius: 5px;
  border: 1px solid #ddd;
  font-size: 12px;
}

.search-input:focus {
  outline: none;
  border-color: #d41c58;
}
    
    .url-box {
  margin-bottom: 5px;
}

.url-label {
  font-size: 12px;
  margin-bottom: 4px;
  display:block;
}

.url-row {
  display: flex;
  gap: 6px;
}

.url-input {
  flex: 1;
  padding: 8px 12px;
  border-radius: 5px;
  border: 1px solid #ddd;
  font-size: 12px;
}

.url-input:focus {
  outline: none;
  border-color: #d41c58;
}

.url-btn {
  background:#d41c58;
  border:0;
  border-radius:5px;
  width:42px;
  display:flex;
  align-items:center;
  justify-content:center;
  cursor:pointer;

  transition:.15s;
}

.url-btn:hover {
  background:#9e1542;
}

.url-btn:active {
  transform:scale(.96);
}

    .upload-btn {
  width: 100%;
  background: #d41c58;          /* purple */
  color: #fff;
  border: 0;
  border-radius: 5px;
  padding: 10px 16px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  text-align: center;
  transition: background .15s, transform .1s;
}

.upload-btn:hover {
  background: #9e1542;
}

.upload-btn:active {
  transform: scale(.98);
}

.upload-box {
  margin-bottom: 10px;
}

    .media-tabs {
  display:flex;
  gap:3px;
  margin-bottom:10px;
  font-size:12px;
}

.media-tabs button {
  background:transparent;
  border:0;
  cursor:pointer;
  padding-bottom:6px;
}

.media-tabs button.active {
  font-weight:600;
  color:#105496;
  border-bottom:3px solid #105496;
}

[data-tab-panel="media"] {
  display: flex;
  flex-direction: column;
  min-height: 0;
  height: 100%;
}

#mediaGridWrap {
  width: 100%;
  max-width: 100%;
  position: relative;
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  padding-bottom: 12px;
}

/* Masonry media grid */
#mediaGrid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  grid-auto-rows: 8px;
  align-items: start;
}

@media (max-width: 980px) {
  #mediaGrid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 680px) {
  #mediaGrid {
    grid-template-columns: 1fr;
  }
}

/* base card style */
.media-card {
  background:#fff;
  border-radius:5px;
  overflow:hidden;
  cursor:pointer;
  box-shadow:0 4px 12px rgba(0,0,0,.08);
  transition:transform .15s, box-shadow .15s;
  margin: 0;
}

.media-card:hover {
  transform:translateY(-2px);
  box-shadow:0 10px 25px rgba(0,0,0,.12);
}

/* mini thumbnail cards in the grid */
.media-card.mini {
  position: relative;
  width: 100%;
  display: block;
  grid-row-end: span 25;
}

.media-card.mini .thumb-wrap {
  position: relative;
  width: 100%;
  padding-top: 100%;
}

.media-card.mini .thumb {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}



/* 3 dots button */
.media-menu-btn {
  position: absolute;
  top: 6px;
  right: 6px;
  border: none;
  background: rgba(0,0,0,.55);
  color: white;
  border-radius: 50%;
  width: 24px;
  height: 24px;
  display: none;
  cursor: pointer;
}

.media-card.mini:hover .media-menu-btn {
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Context menu */
.media-context {
  position: absolute;
  background: #fff;
  border-radius: 14px;
  box-shadow: 0 25px 50px rgba(0,0,0,.12);
  width: 260px;
  padding: 10px 0;
  z-index: 5000;
}

.media-context .mc-head {
  padding: 10px 14px;
  border-bottom: 1px solid #eee;
}

.media-context .mc-head strong {
  font-size: 14px;
}

.media-context .mc-head small {
  display: block;
  color: #7a7a7a;
  font-size: 11px;
}

.media-context .mc-item {
  padding: 10px 14px;
  font-size: 13px;
  cursor: pointer;
}

.media-context .mc-item:hover {
  background: #f5f5f5;
}

.media-context .mc-item.danger {
  color: #c81e1e;
}
.media-context {
 
  position: fixed !important;
  margin: 0 !important;
}


@keyframes menuPop {
  from {
    transform: scale(.9) translateX(10px);
    opacity: 0;
  }
  to {
    transform: scale(1) translateX(0);
    opacity: 1;
  }
}
.move-popup {
  position:fixed;
  inset:0;
  background:rgba(0,0,0,.45);
  display:flex;
  align-items:center;
  justify-content:center;
  z-index:7000;
}

.mp-panel {
  background:#fff;
  width:520px;
  border-radius:16px;
  padding:14px 18px;
  box-shadow:0 25px 60px rgba(0,0,0,.25);
}

.mp-header {
  font-size:16px;
  font-weight:600;
  display:flex;
  justify-content:space-between;
  align-items:center;
  margin-bottom:10px;
}

.mp-header span {
  font-weight:400;
}

.mp-close {
  background:transparent;
  border:0;
  font-size:20px;
  cursor:pointer;
}

.mp-current {
  font-size:12px;
  margin-bottom:8px;
}

.mp-current .badge {
  padding:4px 8px;
  background:#f5f5f5;
  border-radius:8px;
  color: #585858ff;
}

.mp-search input {
  width:100%;
  padding:8px 10px;
  border-radius:10px;
  border:1px solid #ddd;
  margin-bottom:10px;
}

.mp-list {
  max-height:260px;
  overflow:auto;
  margin-bottom:8px;
}

.mp-row {
  display:flex;
  align-items:center;
  padding:8px;
  border-radius:10px;
  cursor:pointer;
}

.mp-row:hover {
  background:#f6f6f6;
}

.mp-row.active {
  background:#eef3ff;
}

.mp-row .thumb {
  width:40px;
  height:40px;
  border-radius:6px;
  background:#eaeaea;
  background-size:cover;
  background-position:center;
  margin-right:10px;
}

.mp-row .thumb.root {
  background:#f3f3f3;
}

.mp-row .info .name {
  font-size:13px;
}

.mp-row .info .count {
  font-size:11px;
  color:#777;
}

.mp-warning {
  background:#fff3cd;
  color:#6c5717;
  padding:6px 10px;
  border-radius:8px;
  margin-bottom:8px;
}

.mp-create {
  font-size:13px;
  color:#0d6efd;
  cursor:pointer;
  margin:6px 0;
}

.mp-footer {
  display:flex;
  justify-content:flex-end;
  gap:8px;
}

.btn {
  border:1px solid #ddd;
  border-radius:8px;
  padding:6px 10px;
}

.btn.primary {
  background:#0d6efd;
  color:#fff;
}

.btn.primary:disabled {
  opacity:.4;
}

.mc-head-row {
  padding: 10px 14px;
  border-bottom: 1px solid #eee;
}

.mc-head-row .title {
  display:flex;
  align-items:center;
  gap:6px;
  font-weight:600;
}

.file-name {
  font-size:14px;
}

.rename-btn {
  background:transparent;
  border:0;
  cursor:pointer;
}

.meta {
  font-size:11px;
  color:#777;
  margin-top:2px;
}

.mc-menu .mc-item {
  display:flex;
  align-items:center;
  gap:10px;
  padding:10px 14px;
  cursor:pointer;
}

.mc-menu .mc-item:hover {
  background:#f6f6f6;
}

.mc-menu .icon {
  width:20px;
  height:20px;
  display:inline-flex;
  align-items:center;
  justify-content:center;
}

.mc-item.danger {
  color:#c81e1e;
}
.details-panel-wrap {
  position:fixed;
  inset:0;
  background:rgba(0,0,0,.25);
  display:flex;
  justify-content:flex-end;
  z-index:7000;
}

.details-panel {
  width:340px;
  background:#fff;
  height:100%;
  padding:14px;
  box-shadow:-10px 0 25px rgba(0,0,0,.15);
  display:flex;
  flex-direction:column;
  animation:slideIn .25s ease;
}
.details-panel {
  display: flex;
  flex-direction: column;
  height: 100%;
  overflow: hidden;      /* prevents content from spilling out */
}

.dp-preview {
  width: 100%;
  max-height: 260px;     /* you can tune this */
  border-radius: 10px;
  overflow: hidden;
  margin-bottom: 12px;
  flex-shrink: 0;
}

.dp-preview img,
.dp-preview video {
  width: 100%;
  height: 100%;
  object-fit: contain;   /* keeps aspect ratio correctly */
  display: block;
  background: #fafafa;
}

/* content below preview becomes scrollable */
.details-panel {
  overflow-y: auto;
}


@keyframes slideIn {
  from { transform:translateX(40px); opacity:0; }
  to { transform:translateX(0); opacity:1; }
}

.dp-header {
  display:flex;
  align-items:center;
  justify-content:space-between;
  font-size:16px;
  margin-bottom:10px;
}

.dp-close {
  background:transparent;
  border:0;
  font-size:20px;
  cursor:pointer;
}


.dp-section {
  margin: 12px 0;
  padding: 12px;
  border: 1px solid #e6ebf2;
  border-radius: 12px;
  background: #f8fafc;
}

.dp-section label {
  display: block;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .04em;
  text-transform: uppercase;
  color: #64748b;
  margin-bottom: 8px;
}

.dp-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
}

.dp-name {
  font-size: 14px;
  font-weight: 600;
  color: #0f172a;
  word-break: break-word;
}

.dp-meta {
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px;
}

.dp-meta > div {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 9px 10px;
  border-radius: 10px;
  background: #ffffff;
  border: 1px solid #e9eef5;
  font-size: 12px;
  color: #1e293b;
  line-height: 1.35;
}

.dp-meta > div b {
  color: #475569;
  font-weight: 700;
  min-width: 90px;
}

.dp-meta span {
  text-align: right;
  word-break: break-word;
}

.dp-path {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
  font-size: 11px;
  color: #334155;
}

.dp-size-raw {
  color: #64748b;
  margin-left: 6px;
  font-size: 11px;
}

.dp-type,
.dp-mime,
.dp-ext,
.dp-source {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border-radius: 999px;
  background: #eff6ff;
  color: #1d4ed8;
  border: 1px solid #dbeafe;
  font-weight: 600;
}

.dp-actions {
  margin-top:auto;
  display:flex;
  gap:8px;
}

.dp-actions .btn {
  flex:1;
}

.btn {
  border:1px solid #ddd;
  padding:8px 10px;
  border-radius:8px;
}

.btn.danger {
  background:#ffe5e5;
  color:#c00;
}
.dp-icon-btn {
  background:transparent;
  border:0;
  cursor:pointer;
  padding:4px;
  border-radius:6px;
}

.dp-icon-btn:hover {
  background:#f3f3f3;
}

.dp-actions button svg {
  margin-right:6px;
}
button.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.mp-badge-folder {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.mp-badge-folder svg {
  flex-shrink: 0;
}

.save-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  background: #2563eb;
  color: white;
  font-weight: 600;
  font-size: 14px;
  border: none;
  border-radius: 5px;
  padding: 10px 18px;
  cursor: pointer;
  transition: all 0.25s ease;
  min-width: 120px;
  margin-bottom: 5px;
  margin-top: 5px;
  
}

.save-btn:hover:not(:disabled) {
  background: #0a53ad;
}

.save-btn:disabled {
  opacity: .75;
  cursor: not-allowed;
}

/* Testimonials inspector */
.testimonials-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0 8px;
  margin: 6px 0 10px;
}

.testimonials-table .testimonial-slide-row {
  background: #ffffff;
  border: 1px solid #e8edf5;
  border-radius: 10px;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
}

.testimonials-table .testimonial-slide-row td {
  vertical-align: middle;
  padding: 10px 8px;
}

.testimonials-table .col-no {
  width: 28px;
  text-align: center;
  color: #64748b;
  font-size: 12px;
  font-weight: 700;
}

.testimonials-table .col-name {
  min-width: 0;
}

.testimonials-table .name-main {
  font-size: 13px;
  font-weight: 700;
  color: #0f172a;
  margin-bottom: 2px;
}

.testimonials-table .name-sub {
  font-size: 11px;
  color: #64748b;
  line-height: 1.35;
}

.testimonials-table .col-actions {
  width: 82px;
  text-align: right;
  white-space: nowrap;
  padding-right: 8px;
}

.slide-edit-btn,
.slide-delete-btn {
  width: 30px;
  height: 30px;
  border-radius: 8px;
  border: 1px solid #dbe3ee;
  background: #fff;
  color: #334155;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all .18s ease;
  margin-left: 6px;
}

.slide-edit-btn:hover {
  background: #eff6ff;
  border-color: #bfdbfe;
  color: #1d4ed8;
}

.slide-delete-btn:hover {
  background: #fef2f2;
  border-color: #fecaca;
  color: #dc2626;
}

.tm-add-btn {
  width: 100%;
  margin: 6px 0 10px;
  padding: 9px 12px;
  border-radius: 10px;
  border: 1px solid #c7d2fe;
  background: linear-gradient(180deg, #eef2ff 0%, #e0e7ff 100%);
  color: #1e3a8a;
  font-size: 13px;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  cursor: pointer;
  transition: all .18s ease;
}

.tm-add-btn:hover {
  border-color: #a5b4fc;
  transform: translateY(-1px);
  box-shadow: 0 6px 14px rgba(99, 102, 241, 0.2);
}

/* Spinner */
.save-spinner {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  border: 3px solid rgba(255,255,255,.3);
  border-top-color: white;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

#jsonInput {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
  font-size: 13px;
  line-height: 1.4;
}



#app-loader {
  position: fixed;
  inset: 0;
  background: #f3f4f600; /* light neutral like Adobe */
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 999999;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto;
}
.loader-window {
  width: 800px;
  height: 450px;
  background: #ffffff;
  display: flex;
  box-shadow: 0 25px 80px rgba(0,0,0,0.25);
  border-radius: 6px;
  overflow: hidden;
}


/* LEFT PANEL */
/* LEFT PANEL */
.loader-left {
  width: 42%;
  padding: 48px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

/* RIGHT PANEL */
.loader-right {
  width: 58%;
  overflow: hidden;
}

.loader-right img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}


/* LOGO */
.brand img {
  height: 42px;
  margin-bottom: 12px;
}

#app-loader .brand h1,
.loader-left .brand h1,
.brand h1 {
  font-size: 32px;
  font-weight: 700;
  margin: 0;
  color: #000 !important;
  letter-spacing: normal;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

.subtitle {
  margin-top: 16px;
  color: #555;
}

/* PROGRESS BAR */
.progress {
  width: 100%;
  height: 6px;
  background: #e5e5e5;
  border-radius: 6px;
  overflow: hidden;
  margin-top: 24px;
}

.progress .bar {
  width: 0%;
  height: 100%;
  background: linear-gradient(90deg, #2563eb, #1d4ed8);
  animation: loading 2.5s ease-in-out infinite;
}

@keyframes loading {
  0% { width: 0%; }
  50% { width: 70%; }
  100% { width: 100%; }
}

.footer {
  font-size: 12px;
  color: #888;
}

/* ARTWORK */
.loader-right img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
/* ==============================
   Folder Picker Modal
============================== */

.folder-picker-modal {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: inherit;
}

/* Backdrop */
.fp-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.45);
  backdrop-filter: blur(2px);
}

/* Panel */
.fp-panel {
  position: relative;
  width: 420px;
  max-width: 92vw;
  max-height: 70vh;
  background: #ffffff;
  border-radius: 12px;
  box-shadow: 0 30px 60px rgba(0, 0, 0, 0.18);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  animation: fp-scale-in 0.18s ease-out;
}

/* Header */
.fp-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px;
  border-bottom: 1px solid #e5e7eb;
  font-size: 15px;
  font-weight: 600;
}

.fp-header strong {
  font-weight: 600;
}

/* Close */
.fp-close {
  border: none;
  background: transparent;
  font-size: 18px;
  cursor: pointer;
  line-height: 1;
  padding: 4px;
  opacity: 0.6;
}

.fp-close:hover {
  opacity: 1;
}

/* Folder List */
.fp-list {
  padding: 8px;
  overflow-y: auto;
  flex: 1;
}

/* Folder Row */
.fp-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px;
  border-radius: 8px;
  cursor: pointer;
  transition: background 0.15s ease, transform 0.05s ease;
}

.fp-row:hover {
  background: #f3f4f6;
}

.fp-row:active {
  transform: scale(0.98);
}

/* Thumbnail */
.fp-row .thumb {
  width: 44px;
  height: 44px;
  border-radius: 6px;
  background-color: #e5e7eb;
  background-size: cover;
  background-position: center;
  flex-shrink: 0;
}

/* Folder Info */
.fp-row .info {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.fp-row .name {
  font-size: 14px;
  font-weight: 500;
  color: #111827;
}

.fp-row .count {
  font-size: 12px;
  color: #6b7280;
}

/* Animation */
@keyframes fp-scale-in {
  from {
    opacity: 0;
    transform: scale(0.96);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}
.folder-preview {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
}

/* ── NAS File Browser Modal ─────────────────────────────────── */
.nas-browser-modal {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10000;
}

.nb-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.45);
  backdrop-filter: blur(2px);
}

.nb-panel {
  position: relative;
  width: 560px;
  max-width: 95vw;
  height: 620px;
  max-height: 90vh;
  background: #ffffff;
  border-radius: 12px;
  box-shadow: 0 30px 60px rgba(0, 0, 0, 0.18);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  animation: fp-scale-in 0.18s ease-out;
}

.nb-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px;
  border-bottom: 1px solid #e5e7eb;
  font-size: 15px;
  font-weight: 600;
}

.nb-close {
  border: none;
  background: transparent;
  font-size: 18px;
  cursor: pointer;
  line-height: 1;
  padding: 4px;
  opacity: 0.6;
}

.nb-close:hover { opacity: 1; }

.nb-address-bar {
  display: flex;
  gap: 6px;
  padding: 10px 16px;
  border-bottom: 1px solid #e5e7eb;
  align-items: center;
}

.nb-address-bar input {
  flex: 1;
  border: 1px solid #d1d5db;
  border-radius: 6px;
  padding: 5px 10px;
  font-size: 13px;
  min-width: 0;
}

.nb-address-bar input:focus {
  outline: none;
  border-color: #3b82f6;
  box-shadow: 0 0 0 2px rgba(59,130,246,.15);
}

.nb-login-row {
  display: flex;
  gap: 8px;
  padding: 8px 16px;
  border-bottom: 1px solid #e5e7eb;
  align-items: flex-end;
  background: #f9fafb;
}

.nb-login-field {
  display: flex;
  flex-direction: column;
  gap: 3px;
  flex: 1;
  min-width: 0;
}

.nb-login-field label {
  font-size: 11px;
  font-weight: 600;
  color: #6b7280;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.nb-login-field input {
  border: 1px solid #d1d5db;
  border-radius: 6px;
  padding: 5px 9px;
  font-size: 12px;
  width: 100%;
  box-sizing: border-box;
  background: #fff;
}

.nb-login-field input:focus {
  outline: none;
  border-color: #3b82f6;
  box-shadow: 0 0 0 2px rgba(59,130,246,.15);
}

.nb-connect-btn {
  background: #3b82f6;
  color: #fff;
  border: none;
  border-radius: 6px;
  padding: 6px 14px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  flex-shrink: 0;
  align-self: flex-end;
  white-space: nowrap;
}

.nb-connect-btn:hover { background: #2563eb; }

.nb-go-btn {
  background: #e5e7eb;
  color: #374151;
  border: 1px solid #d1d5db;
  border-radius: 6px;
  padding: 5px 12px;
  font-size: 13px;
  cursor: pointer;
  flex-shrink: 0;
}

.nb-go-btn:hover { background: #d1d5db; }



.nb-breadcrumbs {
  padding: 6px 16px;
  font-size: 12px;
  color: #6b7280;
  border-bottom: 1px solid #f3f4f6;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  min-height: 28px;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 2px;
}

.nb-breadcrumb-item {
  cursor: pointer;
  color: #3b82f6;
}

.nb-breadcrumb-item:hover { text-decoration: underline; }

.nb-list {
  flex: 1;
  overflow-y: auto;
  padding: 8px;
}

.nb-loading,
.nb-error,
.nb-empty {
  padding: 32px 24px;
  text-align: center;
  color: #6b7280;
  font-size: 13px;
  line-height: 1.6;
}

.nb-error { color: #dc2626; }

.nb-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border-radius: 8px;
  font-size: 13px;
  transition: background 0.12s;
}

.nb-item-folder {
  cursor: pointer;
}

.nb-item-folder:hover { background: #eff6ff; }
.nb-item-folder:active { transform: scale(0.98); }

.nb-item-file {
  cursor: default;
  opacity: 0.75;
}

.nb-item-icon {
  font-size: 18px;
  width: 24px;
  text-align: center;
  flex-shrink: 0;
}

.nb-item-name {
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: #111827;
  font-weight: 500;
}

.nb-item-folder .nb-item-name { color: #1d4ed8; }

.nb-footer {
  display: flex;
  align-items: center;
  padding: 12px 16px;
  border-top: 1px solid #e5e7eb;
  gap: 10px;
  background: #f9fafb;
}

.nb-current-label {
  font-size: 12px;
  color: #6b7280;
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.nb-use-btn {
  background: #16a34a;
  color: #fff;
  border: none;
  border-radius: 8px;
  padding: 7px 16px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  flex-shrink: 0;
}

.nb-use-btn:hover { background: #15803d; }

/* NAS URL input with Browse button */
.nas-url-row {
  display: flex;
  gap: 6px;
  align-items: center;
}

.nas-url-row input {
  flex: 1;
  min-width: 0;
}

.nas-browse-btn {
  background: #f3f4f6;
  border: 1px solid #d1d5db;
  border-radius: 6px;
  padding: 5px 10px;
  font-size: 12px;
  cursor: pointer;
  white-space: nowrap;
  flex-shrink: 0;
  color: #374151;
  font-weight: 500;
}

.nas-browse-btn:hover {
  background: #e5e7eb;
  border-color: #9ca3af;
}
/* ── end NAS File Browser ───────────────────────────────────── */

.folder-count {
  
  top: -6px;
  right: -6px;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 9px;
  background: #111827;
  color: #fff;
  font-size: 11px;
  line-height: 18px;
  text-align: center;
  font-weight: 600;
}
.slide-duration-badge {
  position: absolute;
  bottom: 10px;
  right: 12px;
  padding: 4px 8px;
  background: rgba(0,0,0,0.65);
  color: #fff;
  font-size: 12px;
  border-radius: 6px;
  font-weight: 500;
  pointer-events: none;
  z-index: 5;
}
.media-storage-bar {
  margin-top: 12px;
  padding: 12px 14px;
  border-radius: 5px;
  background: #105496;
  border: 1px solid #105496;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  position: sticky;
  bottom: 0;
  z-index: 6;
  flex-shrink: 0;
  box-shadow: 0 -6px 18px rgba(16, 84, 150, 0.18);
}

.storage-left {
  display: flex;
  align-items: center;
  gap: 10px;
}

.storage-icon {
  width: 26px;
  height: 26px;
  color: #38bdf8;
}

.storage-title {
  font-size: 13px;
  font-weight: 600;
  color: #e5e7eb;
}

.storage-meta {
  font-size: 12px;
  color: #94a3b8;
}

.storage-right {
  flex: 1;
}

.storage-bar {
  height: 8px;
  background: #105496;
  border-radius: 999px;
  overflow: hidden;
  border: 1px solid #818185b5;
}

.storage-bar-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, #38bdf8, #22c55e);
  transition: width 0.3s ease;
  border: 1px solid #818185b5;
}



.sm-talking-avatar-wrap {
  position: relative;
  width: 100%;
  height: 100%;
  overflow: hidden;
  display: flex;
  align-items: flex-end;
  justify-content: center;
}

.sm-anchor-ai {
  position: relative;
  width: min(42vw, 520px);
  max-width: 92%;
  transform-origin: center bottom;
  animation: smAvatarIdleMove 6s ease-in-out infinite;
  will-change: transform;
}

.sm-anchor-body {
  display: block;
  width: 100%;
  height: auto;
  user-select: none;
  -webkit-user-drag: none;
  pointer-events: none;
}

.sm-anchor-eyes,
.sm-anchor-mouth {
  position: absolute;
  transform-origin: center center;
  will-change: transform;
  user-select: none;
  -webkit-user-drag: none;
  pointer-events: none;
}

.sm-anchor-eyes {
  z-index: 3;
}

.sm-anchor-mouth {
  z-index: 4;
}

.sm-talking-avatar-placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 5px;
  width: 100%;
  height: 100%;
  font-size: 18px;
  padding: 20px;
  text-align: center;
}

@keyframes smAvatarIdleMove {
  0% {
    transform: translateY(0px) rotate(0deg);
  }
  25% {
    transform: translateY(-2px) rotate(0.35deg);
  }
  50% {
    transform: translateY(-4px) rotate(0deg);
  }
  75% {
    transform: translateY(-2px) rotate(-0.35deg);
  }
  100% {
    transform: translateY(0px) rotate(0deg);
  }
}

.sm-anchor-ai{

animation:anchorIdle 7s ease-in-out infinite;

transform-origin:center bottom;

}

@keyframes anchorIdle{

0%{
transform:translateY(0) rotate(0deg);
}

25%{
transform:translateY(-3px) rotate(0.5deg);
}

50%{
transform:translateY(-5px) rotate(0deg);
}

75%{
transform:translateY(-3px) rotate(-0.5deg);
}

100%{
transform:translateY(0) rotate(0deg);
}

}

.sm-anchor-body{

animation:breath 5s ease-in-out infinite;

}

@keyframes breath{

0%{transform:scale(1)}
50%{transform:scale(1.01)}
100%{transform:scale(1)}

}

.sm-talking-avatar-wrap{
  position: relative;
  display: inline-block;
}

.sm-anchor-ai{
  position: relative;
  display: inline-block;
}

.sm-anchor-body{
  width: 100%;
  height: auto;
  display: block;
}

.sm-anchor-eyes,
.sm-anchor-mouth{
  position: absolute;
  transform-origin: center;
  pointer-events: none;
}

/* ============================================================
   SLIDESHOW WIDGET  —  Properties Panel + Slide Modal
============================================================ */

/* ---- Stats bar at top of slideshow props ---- */
.ss-stats-bar {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0;
  padding: 10px 0 8px;
  margin-bottom: 2px;
}
.ss-stat {
  display: flex;
  flex-direction: column;
  align-items: center;
  flex: 1;
}
.ss-stat-val {
  font-size: 18px;
  font-weight: 700;
  color: #0ea5e9;
  line-height: 1.1;
}
.ss-stat-lbl {
  font-size: 10px;
  color: #94a3b8;
  text-transform: uppercase;
  letter-spacing: .5px;
  margin-top: 2px;
}
.ss-stat-sep {
  width: 1px;
  height: 32px;
  background: #e2e8f0;
  margin: 0 8px;
}
.ss-empty-hint {
  text-align: center;
  color: #94a3b8;
  font-size: 12px;
  padding: 12px 8px;
  font-style: italic;
}

/* ---- Slide icon toolbar (add slide buttons) ---- */
.slide-icon-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 8px 8px 6px;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  margin-bottom: 2px;
  flex-wrap: nowrap;
  overflow-x: auto;
  overflow-y: hidden;
}
.slide-toolbar-group {
  display: flex;
  align-items: center;
  gap: 4px;
  flex-wrap: nowrap;
  min-width: max-content;
}
.slide-toolbar-group-right {
  margin-left: auto;
}
.slide-toolbar-label {
  font-size: 10px;
  font-weight: 600;
  color: #64748b;
  text-transform: uppercase;
  letter-spacing: .5px;
  flex-shrink: 0;
  margin-right: 2px;
}
.slide-icon-btn {
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: center;
  gap: 5px;
  padding: 6px 9px;
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 0px;
  cursor: pointer;
  color: #374151;
  font-size: 10px;
  font-weight: 500;
  transition: background .15s, border-color .15s, color .15s, transform .1s;
  min-width: 0;
  white-space: nowrap;
}
.slide-icon-btn:hover {
  background: #eff6ff;
  border-color: #93c5fd;
  color: #1d4ed8;
  transform: translateY(-1px);
}
.slide-icon-btn:active {
  transform: translateY(0);
}
.slide-icon-btn.playing {
  background: #fef3c7;
  border-color: #fbbf24;
  color: #b45309;
}
.slide-play-btn {
  min-width: 44px;
  flex-shrink: 0;
}
.slide-btn-label {
  font-size: 10px;
  font-weight: 500;
  line-height: 1;
}

/* ---- Slide list table ---- */
.slide-list-host {
  margin: 0;
  max-height: 340px;
  overflow-y: auto;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  background: #fff;
}
.slide-table-wrap { width: 100%; }
.slide-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12.5px;
}
.slide-table thead tr {
  background: #f1f5f9;
  border-bottom: 1px solid #e2e8f0;
}
.slide-table thead th {
  padding: 7px 10px;
  text-align: left;
  font-size: 10.5px;
  font-weight: 600;
  color: #64748b;
  text-transform: uppercase;
  letter-spacing: .4px;
}
.th-no  { width: 28px; }
.th-name { }
.th-actions { width: 66px; text-align: center !important; }
.slide-table tbody tr.slide-row {
  border-bottom: 1px solid #f1f5f9;
  cursor: pointer;
  transition: background .1s;
}
.slide-table tbody tr.slide-row:last-child { border-bottom: none; }
.slide-table tbody tr.slide-row:hover { background: #f8fafc; }
.slide-table tbody tr.slide-row.active { background: #eff6ff; border-left: 3px solid #3b82f6; }
.slide-table tbody tr.slide-row.dragging { opacity: .45; background: #f0f4ff; }
.slide-table .col-no {
  width: 28px;
  padding: 8px 8px 8px 10px;
  color: #94a3b8;
  font-size: 11px;
  font-weight: 700;
  vertical-align: middle;
}
.slide-table .col-name {
  padding: 7px 8px;
  vertical-align: middle;
}
.slide-table .col-actions {
  width: 66px;
  padding: 6px 8px;
  text-align: center;
  vertical-align: middle;
  white-space: nowrap;
}
.slide-name-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
}
.slide-name-text { line-height: 1.3; }
.slide-name-text .name-main {
  font-size: 12.5px;
  font-weight: 500;
  color: #1e293b;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 150px;
}
.slide-name-text .name-sub {
  font-size: 11px;
  color: #94a3b8;
  margin-top: 1px;
  display: flex;
  align-items: center;
  gap: 4px;
}
/* type badge */
.slide-type-badge {
  display: inline-block;
  padding: 1px 5px;
  border-radius: 3px;
  font-size: 9px;
  font-weight: 700;
  letter-spacing: .3px;
  text-transform: uppercase;
}
.type-img  { background: #dcfce7; color: #15803d; }
.type-vid  { background: #fee2e2; color: #b91c1c; }
.type-txt  { background: #ede9fe; color: #6d28d9; }
.type-dir  { background: #fef9c3; color: #854d0e; }

/* slide preview thumbnail */
.slide-preview {
  width: 40px;
  height: 28px;
  border-radius: 4px;
  overflow: hidden;
  flex-shrink: 0;
  background: #e2e8f0;
  display: flex;
  align-items: center;
  justify-content: center;
}
.slide-preview img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.video-fallback {
  font-size: 14px;
  line-height: 1;
}
.text-preview {
  font-size: 13px;
  font-weight: 800;
  color: #64748b;
  background: #e2e8f0;
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
}
.folder-preview {
  background: #fef9c3;
  font-size: 16px;
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
}
.folder-count {
  position: absolute;
  top: -4px;
  right: -4px;
  min-width: 16px;
  height: 16px;
  padding: 0 4px;
  border-radius: 8px;
  background: #0f172a;
  color: #fff;
  font-size: 9px;
  line-height: 16px;
  text-align: center;
  font-weight: 700;
}

/* Edit / Delete buttons in slide row */
.slide-edit-btn,
.slide-delete-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  border-radius: 5px;
  border: 1px solid #e2e8f0;
  background: #f8fafc;
  cursor: pointer;
  color: #64748b;
  transition: background .12s, border-color .12s, color .12s;
  padding: 0;
  margin: 0 1px;
}
.slide-edit-btn:hover   { background: #eff6ff; border-color: #93c5fd; color: #2563eb; }
.slide-delete-btn:hover { background: #fef2f2; border-color: #fca5a5; color: #dc2626; }

/* ============================================================
   SLIDE MODAL
============================================================ */
.slide-modal {
  position: fixed;
  inset: 0;
  z-index: 10001;
  display: none;
  align-items: center;
  justify-content: center;
  font-family: inherit;
}
.slide-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15,23,42,.55);
  backdrop-filter: blur(3px);
}
.slide-modal-content {
  position: relative;
  width: 520px;
  max-width: 96vw;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  background: #fff;
  border-radius: 14px;
  box-shadow: 0 32px 80px rgba(15,23,42,.28), 0 0 0 1px rgba(0,0,0,.06);
  overflow: hidden;
  animation: smScaleIn .18s ease-out;
}
@keyframes smScaleIn {
  from { opacity: 0; transform: scale(.96) translateY(6px); }
  to   { opacity: 1; transform: scale(1)  translateY(0);    }
}
.slide-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px 14px;
  border-bottom: 1px solid #f1f5f9;
  background: #f8fafc;
}
#slideModalTitle {
  font-size: 14px;
  font-weight: 700;
  color: #0f172a;
  letter-spacing: .1px;
}
#slideModalClose {
  width: 28px;
  height: 28px;
  border: none;
  background: #e2e8f0;
  border-radius: 6px;
  cursor: pointer;
  font-size: 15px;
  line-height: 1;
  color: #475569;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background .12s, color .12s;
}
#slideModalClose:hover { background: #fecaca; color: #dc2626; }
.slide-modal-body {
  flex: 1;
  overflow-y: auto;
  padding: 0;
}

/* ---- Content inside the modal ---- */
.sm-fields-wrap {
  padding: 16px 20px 8px;
  display: flex;
  flex-direction: column;
  gap: 0;
}
/* type pill at top */
.sm-type-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 99px;
  font-size: 11.5px;
  font-weight: 600;
  margin-bottom: 14px;
  align-self: flex-start;
}
.sm-type-image  { background: #dcfce7; color: #15803d; }
.sm-type-video  { background: #fee2e2; color: #b91c1c; }
.sm-type-text   { background: #ede9fe; color: #6d28d9; }
.sm-type-folder { background: #fef9c3; color: #854d0e; }

/* sections */
.sm-section {
  margin-bottom: 16px;
  border: 1px solid #f1f5f9;
  border-radius: 10px;
  overflow: hidden;
}
.sm-section-title {
  padding: 7px 12px 6px;
  font-size: 10.5px;
  font-weight: 700;
  color: #64748b;
  text-transform: uppercase;
  letter-spacing: .5px;
  background: #f8fafc;
  border-bottom: 1px solid #f1f5f9;
}
/* rows */
.sm-field-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 9px 12px;
  border-bottom: 1px solid #f8fafc;
}
.sm-field-row:last-child { border-bottom: none; }
.sm-field-col {
  flex-direction: column;
  align-items: stretch;
}
.sm-label {
  font-size: 12px;
  font-weight: 500;
  color: #374151;
  flex-shrink: 0;
  white-space: nowrap;
}
.sm-input {
  flex: 1;
  min-width: 0;
  padding: 5px 8px;
  border: 1px solid #d1d5db;
  border-radius: 6px;
  font-size: 12.5px;
  color: #0f172a;
  background: #fff;
  transition: border-color .15s;
  outline: none;
}
.sm-input:focus { border-color: #3b82f6; box-shadow: 0 0 0 2px rgba(59,130,246,.12); }
.sm-select {
  flex: 1;
  min-width: 0;
  padding: 5px 8px;
  border: 1px solid #d1d5db;
  border-radius: 6px;
  font-size: 12.5px;
  color: #0f172a;
  background: #fff;
  cursor: pointer;
  outline: none;
  transition: border-color .15s;
}
.sm-select:focus { border-color: #3b82f6; }
.sm-textarea {
  width: 100%;
  resize: vertical;
  padding: 8px 10px;
  border: 1px solid #d1d5db;
  border-radius: 6px;
  font-size: 12.5px;
  font-family: inherit;
  color: #0f172a;
  line-height: 1.5;
  margin-top: 6px;
  outline: none;
  transition: border-color .15s;
}
.sm-textarea:focus { border-color: #3b82f6; box-shadow: 0 0 0 2px rgba(59,130,246,.12); }
.sm-color {
  width: 36px;
  height: 28px;
  padding: 2px;
  border: 1px solid #d1d5db;
  border-radius: 6px;
  cursor: pointer;
  background: #fff;
}
.sm-input-unit-wrap {
  display: flex;
  align-items: center;
  gap: 4px;
  flex: 1;
}
.sm-unit {
  font-size: 11px;
  color: #94a3b8;
  font-weight: 500;
  flex-shrink: 0;
}
/* toggle */
.sm-toggle {
  position: relative;
  display: inline-flex;
  align-items: center;
  cursor: pointer;
  width: 36px;
  height: 20px;
  flex-shrink: 0;
}
.sm-toggle input { opacity: 0; width: 0; height: 0; position: absolute; }
.sm-toggle-knob {
  position: absolute;
  inset: 0;
  background: #d1d5db;
  border-radius: 99px;
  transition: background .2s;
}
.sm-toggle-knob::after {
  content: "";
  position: absolute;
  width: 14px;
  height: 14px;
  left: 3px;
  top: 3px;
  background: #fff;
  border-radius: 50%;
  transition: transform .2s;
}
.sm-toggle input:checked + .sm-toggle-knob { background: #3b82f6; }
.sm-toggle input:checked + .sm-toggle-knob::after { transform: translateX(16px); }
/* picker in modal */
.sm-picker-wrap { padding: 10px; }
/* folder count note */
.sm-folder-count {
  display: block;
  font-size: 11px;
  color: #64748b;
  padding: 4px 12px 8px;
}
/* footer actions */
.sm-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 20px 16px;
  border-top: 1px solid #f1f5f9;
  background: #f8fafc;
  gap: 8px;
  margin-top: 4px;
}
.sm-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  border-radius: 8px;
  font-size: 12.5px;
  font-weight: 600;
  cursor: pointer;
  border: none;
  transition: background .15s, transform .1s;
}
.sm-btn:active { transform: scale(.97); }
.sm-btn-primary {
  background: linear-gradient(135deg, #3b82f6, #1d4ed8);
  color: #fff;
  box-shadow: 0 2px 8px rgba(59,130,246,.35);
}
.sm-btn-primary:hover { background: linear-gradient(135deg, #2563eb, #1e40af); }
.sm-btn-secondary {
  background: #f1f5f9;
  color: #374151;
  border: 1px solid #e2e8f0;
}
.sm-btn-secondary:hover { background: #e2e8f0; }
.sm-btn-danger {
  background: #fef2f2;
  color: #dc2626;
  border: 1px solid #fecaca;
}
.sm-btn-danger:hover { background: #fee2e2; }

/* ============================================================
   AI Creator Panel  — aicreator styles
   ============================================================ */

[data-tab-panel="aicreator"] {
  display: flex; flex-direction: column; gap: 0;
  padding: 0 0 24px; overflow-y: auto;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

/* ── Header ── */
.ai-header {
  display: flex; align-items: center; gap: 11px;
  padding: 14px 14px 12px;
  background: linear-gradient(135deg, #f5f3ff 0%, #ede9fe 100%);
  border-bottom: 1px solid #ddd6fe;
}
.ai-header-icon {
  width: 36px; height: 36px; flex-shrink: 0;
  background: linear-gradient(135deg, #6366f1, #8b5cf6);
  border-radius: 10px; display: flex; align-items: center; justify-content: center;
  box-shadow: 0 2px 8px rgba(99,102,241,.3);
}
.ai-header-icon svg { width: 18px; height: 18px; fill: none; stroke: #fff; stroke-width: 2; }
.ai-header-text { flex: 1; min-width: 0; }
.ai-header-title { font-size: 13px; font-weight: 700; color: #1e293b; line-height: 1.2; }

#aiStatusBadge {
  display: inline-flex; align-items: center; gap: 5px; margin-top: 3px;
  font-size: 10px; font-weight: 600; padding: 2px 8px; border-radius: 20px;
  background: rgba(34,197,94,.12); color: #16a34a; border: 1px solid rgba(34,197,94,.3);
}
#aiStatusBadge.ai-badge--off { background: rgba(239,68,68,.08); color: #dc2626; border-color: rgba(239,68,68,.25); }
.ai-dot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; flex-shrink: 0; }

/* ── Steps ── */
.ai-step {
  padding: 12px 14px 0;
}
.ai-step-head {
  display: flex; align-items: center; gap: 7px; margin-bottom: 8px;
}
.ai-step-num {
  width: 20px; height: 20px; border-radius: 50%; flex-shrink: 0;
  background: #6366f1; color: #fff;
  font-size: 10px; font-weight: 700;
  display: flex; align-items: center; justify-content: center;
}
.ai-step-label {
  font-size: 11px; font-weight: 700; color: #374151; letter-spacing: .02em;
}
.ai-step-hint {
  font-size: 10px; color: #9ca3af; font-style: italic; margin-left: auto;
}

/* ── Chips ── */
.ai-chips { display: flex; flex-wrap: wrap; gap: 5px; }
.ai-chip {
  display: inline-flex; align-items: center; gap: 4px; font-size: 11px; font-weight: 500;
  padding: 4px 9px; border-radius: 20px; cursor: pointer; user-select: none;
  background: #f9fafb; border: 1px solid #e5e7eb;
  color: #374151; white-space: nowrap;
  transition: background .15s, border-color .15s, color .15s, transform .1s;
}
.ai-chip:hover { background: #ede9fe; border-color: #a5b4fc; color: #4338ca; transform: translateY(-1px); }
.ai-chip.active { background: #6366f1; border-color: #6366f1; color: #fff; box-shadow: 0 2px 6px rgba(99,102,241,.3); }

/* ── Textarea ── */
.ai-textarea {
  width: 100%; box-sizing: border-box; resize: vertical; min-height: 80px;
  background: #fff; border: 1.5px solid #e5e7eb;
  border-radius: 8px; color: #1e293b; font-size: 12px; padding: 9px 11px;
  line-height: 1.6; outline: none; font-family: inherit;
  transition: border-color .15s, box-shadow .15s;
}
.ai-textarea:focus { border-color: #6366f1; box-shadow: 0 0 0 3px rgba(99,102,241,.12); }
.ai-textarea::placeholder { color: #b0b7c3; }

.ai-template-hint {
  margin-top: 6px; padding: 6px 10px; border-radius: 6px;
  font-size: 11px; color: #4338ca;
  background: #eef2ff; border: 1px solid #c7d2fe;
}

/* ── Controls ── */
.ai-controls-grid { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 8px; }
.ai-ctrl { display: flex; flex-direction: column; gap: 4px; }
.ai-ctrl-label { font-size: 9.5px; font-weight: 700; color: #9ca3af; letter-spacing: .07em; text-transform: uppercase; }

.ai-select-wrap { position: relative; }
.ai-ctrl-input {
  width: 100%; box-sizing: border-box;
  background: #fff
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 10 6'%3E%3Cpath d='M1 1l4 4 4-4' stroke='%239ca3af' stroke-width='1.5' fill='none' stroke-linecap='round'/%3E%3C/svg%3E")
    no-repeat right 8px center / 10px 6px;
  border: 1.5px solid #e5e7eb;
  border-radius: 7px; color: #1e293b; font-size: 11px;
  padding: 6px 26px 6px 9px;
  outline: none; font-family: inherit;
  -webkit-appearance: none; appearance: none;
  transition: border-color .15s, box-shadow .15s; cursor: pointer;
}
.ai-ctrl-input:focus { border-color: #6366f1; box-shadow: 0 0 0 3px rgba(99,102,241,.12); }

/* ── Generate button ── */
.ai-generate-btn {
  display: flex; align-items: center; justify-content: center; gap: 8px;
  margin: 14px 14px 0;
  padding: 11px 16px; border-radius: 10px; border: none;
  background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
  color: #fff; font-size: 13px; font-weight: 700; cursor: pointer; letter-spacing: .02em;
  box-shadow: 0 4px 14px rgba(99,102,241,.4);
  transition: opacity .2s, transform .12s, box-shadow .2s;
}
.ai-generate-btn:hover:not(:disabled) { opacity: .92; box-shadow: 0 6px 18px rgba(99,102,241,.45); transform: translateY(-1px); }
.ai-generate-btn:active:not(:disabled) { transform: scale(.98) translateY(0); }
.ai-generate-btn:disabled,
.ai-generate-btn.ai-generating { opacity: .6; cursor: not-allowed; transform: none; box-shadow: none; }
.ai-btn-arrow svg { width: 16px; height: 16px; fill: #fff; }
.ai-spinner {
  width: 14px; height: 14px; border-radius: 50%; display: none;
  border: 2px solid rgba(255,255,255,.3); border-top-color: #fff;
  animation: ai-spin .7s linear infinite;
}
.ai-generating .ai-spinner { display: inline-block; }
.ai-generating .ai-btn-arrow { display: none; }
@keyframes ai-spin { to { transform: rotate(360deg); } }

/* ── Progress & messages ── */
#aiProgressWrap { display: none; flex-direction: column; gap: 6px; padding: 10px 14px 0; }
#aiProgressWrap.visible { display: flex; }
.ai-progress-bar { width: 100%; height: 5px; background: #e5e7eb; border-radius: 99px; overflow: hidden; }
#aiProgressFill {
  height: 100%; width: 0;
  background: linear-gradient(90deg, #6366f1, #8b5cf6);
  border-radius: 99px; transition: width .45s ease;
}
#aiProgressLabel { font-size: 10px; color: #6b7280; text-align: center; }

#aiMessage { display: none; margin: 8px 14px 0; padding: 9px 12px; border-radius: 8px; font-size: 11px; line-height: 1.5; }
#aiMessage.visible { display: block; }
#aiMessage.ai-message--error { background: #fef2f2; color: #dc2626; border: 1px solid #fecaca; }
#aiMessage.ai-message--warn  { background: #fffbeb; color: #d97706; border: 1px solid #fde68a; }
#aiMessage.ai-message--info  { background: #eef2ff; color: #4338ca; border: 1px solid #c7d2fe; }

#aiResultSummary {
  display: none; margin: 8px 14px 0; padding: 9px 12px; border-radius: 8px;
  font-size: 11px; color: #16a34a; background: #f0fdf4; border: 1px solid #bbf7d0;
}
#aiResultSummary.visible { display: block; }

/* ── Divider ── */
.ai-divider { border: none; border-top: 1px solid #f1f5f9; margin: 14px 0 0; }

/* ── Template grid ── */
#aiTemplateGrid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; padding: 0 14px; }

.ai-tpl-card {
  display: flex; flex-direction: column; border-radius: 10px; overflow: hidden;
  cursor: pointer; background: #fff; border: 1.5px solid #e5e7eb;
  transition: border-color .15s, box-shadow .15s, transform .12s; user-select: none;
}
.ai-tpl-card:hover { border-color: #a5b4fc; box-shadow: 0 3px 10px rgba(99,102,241,.12); transform: translateY(-2px); }
.ai-tpl-card.active { border-color: #6366f1; box-shadow: 0 0 0 2px rgba(99,102,241,.2); }

/* Coloured accent strip per industry */
.ai-tpl-preview {
  height: 6px; width: 100%; flex-shrink: 0;
}
.ai-tpl-preview--school      { background: linear-gradient(90deg, #3b82f6, #06b6d4); }
.ai-tpl-preview--jewellery   { background: linear-gradient(90deg, #d4a017, #f59e0b); }
.ai-tpl-preview--bakery      { background: linear-gradient(90deg, #f97316, #fb923c); }
.ai-tpl-preview--restaurant  { background: linear-gradient(90deg, #ef4444, #f97316); }
.ai-tpl-preview--retail      { background: linear-gradient(90deg, #ec4899, #f43f5e); }
.ai-tpl-preview--realestate  { background: linear-gradient(90deg, #10b981, #059669); }
.ai-tpl-preview--fitness     { background: linear-gradient(90deg, #8b5cf6, #6366f1); }
.ai-tpl-preview--hospital    { background: linear-gradient(90deg, #06b6d4, #0ea5e9); }
.ai-tpl-preview--hotel       { background: linear-gradient(90deg, #64748b, #475569); }
.ai-tpl-preview--technology  { background: linear-gradient(90deg, #6366f1, #8b5cf6); }

/* chip SVG icon */
.ai-chip-icon {
  width: 13px; height: 13px; flex-shrink: 0;
  stroke: currentColor; fill: none;
  stroke-width: 2; stroke-linecap: round; stroke-linejoin: round;
}

/* template card icon badge */
.ai-tpl-icon-wrap {
  width: 30px; height: 30px; border-radius: 7px; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  margin: 8px 10px 2px;
}
.ai-tpl-icon-wrap svg {
  width: 15px; height: 15px;
  stroke: #fff; fill: none;
  stroke-width: 2; stroke-linecap: round; stroke-linejoin: round;
}
.ai-tpl-icon--school     { background: linear-gradient(135deg, #3b82f6, #06b6d4); }
.ai-tpl-icon--jewellery  { background: linear-gradient(135deg, #b8860b, #f59e0b); }
.ai-tpl-icon--bakery     { background: linear-gradient(135deg, #f97316, #fb923c); }
.ai-tpl-icon--restaurant { background: linear-gradient(135deg, #ef4444, #f97316); }
.ai-tpl-icon--retail     { background: linear-gradient(135deg, #ec4899, #f43f5e); }
.ai-tpl-icon--realestate { background: linear-gradient(135deg, #10b981, #059669); }
.ai-tpl-icon--fitness    { background: linear-gradient(135deg, #8b5cf6, #6366f1); }
.ai-tpl-icon--hospital   { background: linear-gradient(135deg, #06b6d4, #0ea5e9); }
.ai-tpl-icon--hotel      { background: linear-gradient(135deg, #64748b, #475569); }
.ai-tpl-icon--technology { background: linear-gradient(135deg, #6366f1, #8b5cf6); }
.ai-tpl-card > .ai-tpl-name { font-size: 11px; font-weight: 700; color: #1e293b; padding: 0 10px 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ai-tpl-card > .ai-tpl-desc { font-size: 10px; color: #6b7280; line-height: 1.4; padding: 0 10px 9px; }

/* ── AI Studio React upgrade extras ── */
.ai-panel-react { padding-bottom: 16px; }

.ai-tools-row {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 8px;
}

.ai-mini-btn {
  border: 1px solid #d1d5db;
  background: #f9fafb;
  color: #374151;
  border-radius: 7px;
  padding: 5px 9px;
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
}

.ai-mini-btn:hover:not(:disabled) {
  background: #eef2ff;
  border-color: #a5b4fc;
  color: #4338ca;
}

.ai-key-hint {
  margin-left: auto;
  font-size: 10px;
  color: #9ca3af;
}

.ai-recent-wrap {
  margin-top: 8px;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  background: #f8fafc;
  padding: 7px;
}

.ai-recent-title {
  font-size: 10px;
  color: #6b7280;
  font-weight: 700;
  margin-bottom: 6px;
  text-transform: uppercase;
  letter-spacing: .06em;
}

.ai-recent-list {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.ai-recent-chip {
  border: 1px solid #e5e7eb;
  background: #fff;
  color: #374151;
  border-radius: 6px;
  padding: 5px 8px;
  font-size: 10px;
  text-align: left;
  cursor: pointer;
}

.ai-recent-chip:hover:not(:disabled) {
  border-color: #c7d2fe;
  background: #eef2ff;
}

/* Reference image upload */
.ai-ref-upload-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  width: 100%;
  padding: 9px 14px;
  border: 1.5px dashed #c7d2fe;
  border-radius: 8px;
  background: #f5f7ff;
  color: #6366f1;
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  transition: background .15s, border-color .15s;
  box-sizing: border-box;
}
.ai-ref-upload-btn:hover:not(:disabled) {
  background: #eef2ff;
  border-color: #818cf8;
}
.ai-ref-image-preview {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border: 1px solid #c7d2fe;
  border-radius: 8px;
  background: #f5f7ff;
}
.ai-ref-thumb {
  width: 64px !important;
  height: 40px !important;
  max-width: 64px !important;
  max-height: 40px !important;
  object-fit: cover;
  border-radius: 4px;
  flex-shrink: 0;
  border: 1px solid #e0e7ff;
  display: block;
}
.ai-ref-info {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.ai-ref-name {
  font-size: 11px;
  font-weight: 600;
  color: #374151;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.ai-ref-hint {
  font-size: 10px;
  color: #6366f1;
}
.ai-ref-clear {
  flex-shrink: 0;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: none;
  background: #e0e7ff;
  color: #6366f1;
  font-size: 11px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
  padding: 0;
}
.ai-ref-clear:hover {
  background: #c7d2fe;
}

.ai-preset-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 8px;
}

.ai-preset-chip {
  border: 1px solid #d1d5db;
  border-radius: 999px;
  padding: 5px 9px;
  font-size: 10px;
  font-weight: 700;
  background: #fff;
  color: #374151;
  cursor: pointer;
  letter-spacing: .02em;
}

.ai-preset-chip:hover:not(:disabled) {
  border-color: #6366f1;
  color: #4338ca;
  background: #eef2ff;
}

.ai-controls-grid--next {
  grid-template-columns: 1fr 1fr;
}

.ai-slide-count-row {
  display: flex;
  gap: 5px;
}

.ai-slide-count-btn {
  flex: 1;
  border: 1px solid #d1d5db;
  border-radius: 7px;
  background: #fff;
  color: #374151;
  padding: 6px 0;
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
}

.ai-slide-count-btn.active {
  border-color: #6366f1;
  background: #eef2ff;
  color: #4338ca;
}

.ai-progress-wrap {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 10px 14px 0;
}

.ai-progress-fill {
  height: 100%;
  width: 0;
  background: linear-gradient(90deg, #6366f1, #8b5cf6);
  border-radius: 99px;
  transition: width .45s ease;
}

.ai-progress-label {
  font-size: 10px;
  color: #6b7280;
  text-align: center;
}

.ai-message {
  margin: 8px 14px 0;
  padding: 9px 12px;
  border-radius: 8px;
  font-size: 11px;
  line-height: 1.5;
}

.ai-message--error { background: #fef2f2; color: #dc2626; border: 1px solid #fecaca; }
.ai-message--warn  { background: #fffbeb; color: #d97706; border: 1px solid #fde68a; }
.ai-message--info  { background: #eef2ff; color: #4338ca; border: 1px solid #c7d2fe; }
.ai-message--success { background: #f0fdf4; color: #166534; border: 1px solid #bbf7d0; }

/* ═══════════════════════════════════════════════════════════════════════════
   DASHLITE COMPREHENSIVE MOBILE FIX
   Addresses horizontal overflow, header nav crowding, table scroll,
   modal sizing, form element overflow, and sidebar toggle on small screens.
   ═══════════════════════════════════════════════════════════════════════════ */

/* ── 1. Prevent horizontal overflow on the whole page ─────────────────────── */
.card-inner {
            padding: 1.25rem !important;
            align-items: unset !important;
            overflow: visible !important;
        }
        @media (min-width: 576px) {
            .card-inner {
                padding: 1.5rem !important;
            }
        }
        .card-inner-sm {
            padding: 0.75rem 1.25rem !important;
            align-items: unset !important;
        }
        /* list-group inside card: allow flush list to render correctly */
        .card > .list-group {
            overflow: hidden;
        }
        .card > .list-group:last-child {
            border-bottom-left-radius: inherit;
            border-bottom-right-radius: inherit;
        }
        .card > .list-group:first-child {
            border-top-left-radius: inherit;
            border-top-right-radius: inherit;
        }
        .list-group-item {
            padding: 0.75rem 1.25rem;
        }
        .list-group-item-action {
            display: block;
            width: 100%;
        }
        /* nosidebar layout: restore content padding stripped by dashlite */
        .nk-wrap-nosidebar .nk-content-body {
            padding: 1.5rem 0 2rem;
        }
        @media (min-width: 576px) {
            .nk-wrap-nosidebar .nk-content-body {
                padding: 2rem 0 3rem;
            }
        }
/* ── 3. nk-quick-nav: tighten spacing on very small screens ──────────────── */
@media (max-width: 479.98px) {
  .nk-header-tools .nk-quick-nav {
    margin: 0 -4px;
  }
  .nk-header-tools .nk-quick-nav > li {
    padding: 0 3px;
  }
  /* Hide decorative language-flag dropdown on xs to save space */
  .nk-header-tools .language-dropdown:not(.user-dropdown) {
    display: none !important;
  }
}

/* ── 4. Dropdowns: never clip inside the header or block-head ─────────────── */
.nk-header,
.nk-header-wrap,
.nk-header-tools {
  overflow: visible !important;
}
.nk-header .dropdown-menu {
  max-width: calc(100vw - 16px);
}

/* ── 5. Tables: DataTable dropdown fix ─────────────────────────────────────── */
/* Dropdown overflow is handled via JS: shown.bs.dropdown temporarily sets
   overflow:visible on the clipping parent, hidden.bs.dropdown restores it.
   We just need z-index so the menu floats above adjacent rows. */
.nk-tb-list .dropdown-menu,
.dataTables_wrapper .dropdown-menu {
  z-index: 1050;
}

/* ── 6. Cards ─────────────────────────────────────────────────────────────── */
@media (max-width: 575.98px) {
  .nk-content .nk-block-head {
    padding-left: 0;
    padding-right: 0;
  }
}

/* ── 8. Form elements: prevent inputs/selects from exceeding viewport ─────── */
@media (max-width: 575.98px) {
  .form-control,
  .form-select,
  .input-group {
    max-width: 100%;
  }
  /* Select2: keep the rendered select within page bounds */
  .select2-container {
    max-width: 100%;
    min-width: 0 !important;
  }
  .select2-container--default .select2-selection--single {
    width: 100%;
  }
  /* Summernote toolbar: allow wrapping on mobile */
  .note-editor .note-toolbar {
    flex-wrap: wrap;
  }
}

/* ── 9. Modals: proper full-width treatment on mobile ────────────────────── */
@media (max-width: 575.98px) {
  .modal-dialog:not(.modal-dialog-centered.modal-sm) {
    margin: 0.5rem;
    max-width: calc(100vw - 1rem);
  }
  .modal-dialog-scrollable .modal-body {
    overflow-y: auto;
  }
  .modal-footer {
    flex-wrap: wrap;
    gap: 0.5rem;
  }
  .modal-footer .btn {
    flex: 1 1 auto;
  }
}

/* ── 10. nk-block row / g-gs: prevent column bleed on mobile ─────────────── */
@media (max-width: 575.98px) {
  .nk-block > .row,
  .nk-block > .g-gs {
    margin-left: 0;
    margin-right: 0;
  }
}
.dataTables_wrapper {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

/* ── 11. Sidebar overlay: correct z-index and tap-to-close region ─────────── */
.nk-sidebar-overlay {
  z-index: 1020;
  cursor: pointer;
}
/* Sidebar itself sits above the overlay */
.nk-sidebar {
  z-index: 1021;
}

/* ── 12. AdminLTE leftover neutralisation ────────────────────────────────── */
/* adminlte.min.js sets inline height on .content-wrapper which doesn't
   exist in DashLite, but the control-sidebar-bg div that's still in the
   footer can cause a horizontal bump. Hide it. */
.control-sidebar-bg {
  display: none !important;
}

/* ── 13. nk-content: ensure enough top clearance below sticky header ─────── */
@media (max-width: 1199.98px) {
  .nk-wrap {
    /* header is ~65px; the nk-wrap top-padding of 15px is already set by
       DashLite, but sometimes the sticky header overlaps content on mobile.
       Adding a safe margin for < xl breakpoint. */
    padding-top: 5px;
  }
}

/* ── 14. Bottom navigation / footer links: wrap on xs ────────────────────── */
@media (max-width: 575.98px) {
  .nk-footer-wrap {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
  }
  .nk-footer-copyright,
  .nk-footer-links {
    width: 100%;
  }
}

/* ── 15. Stat / KPI cards: ensure value numbers don't overflow ───────────── */
@media (max-width: 575.98px) {
  .nk-cmwg .card-inner {
    overflow: visible;
  }
  .nk-cmwg1-ck canvas {
    display: block;
    width: 100% !important;
  }
}

/* ── 16. DataTable dropdown menus: handled by Section 5 position:fixed ── */

/* ── 17. Analytics KPI Widget Cards (nk-wgacc) ── */
.nk-wgacc .nk-wgacc-group{display:flex;align-items:center;justify-content:space-between}
.nk-wgacc .nk-wgacc-amount .number{font-size:1.75rem;font-weight:700;color:#364a63;line-height:1.2}
.nk-wgacc .nk-wgacc-title{font-size:13px;color:#8094ae;margin-top:4px}
.nk-wgacc .nk-wgacc-icon{font-size:2.25rem;opacity:.7}

/* ══════════════════════════════════════════════════════════════════════════ */

/* ══════ GIPHY Sidebar Panel ═════════════════════════════════════════════ */
.giphy-panel-header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 4px 0 8px;
}
.giphy-panel-sub {
  font-size: 10px;
  color: #888;
  letter-spacing: .03em;
}
.giphy-sub-tabs {
  display: flex;
  gap: 4px;
  padding: 0 0 8px;
  overflow-x: auto;
  scrollbar-width: none;
}
.giphy-sub-tabs::-webkit-scrollbar { display: none; }
.giphy-sub-tab {
  flex: 1;
  min-width: 0;
  padding: 5px 6px;
  font-size: 11px;
  font-weight: 600;
  border: 1px solid #ddd;
  border-radius: 14px;
  background: #fff;
  color: #555;
  cursor: pointer;
  white-space: nowrap;
  transition: background .15s, color .15s, border-color .15s;
  line-height: 1.3;
}
.giphy-sub-tab.active {
  background: #00cdac;
  color: #fff;
  border-color: #00cdac;
}
.giphy-panel-search-row {
  display: flex;
  gap: 6px;
  padding: 0 0 8px;
  align-items: center;
}
.giphy-panel-search {
  flex: 1;
  min-width: 0;
  height: 32px;
  padding: 0 10px;
  font-size: 12px;
  border: 1px solid #ddd;
  border-radius: 6px;
  outline: none;
  box-sizing: border-box;
}
.giphy-panel-search:focus { border-color: #00cdac; }
.giphy-panel-search-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border: none;
  border-radius: 6px;
  background: linear-gradient(135deg, #00cdac, #8a00d4);
  color: #fff;
  cursor: pointer;
  flex-shrink: 0;
  padding: 0;
}
.giphy-panel-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 6px;
  padding: 0 0 6px;
}
.giphy-panel-item {
  position: relative;
  aspect-ratio: 1;
  border-radius: 6px;
  overflow: hidden;
  cursor: pointer;
  background: #f0f0f0;
}
.giphy-panel-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform .2s;
}
.giphy-panel-item:hover img { transform: scale(1.06); }
.giphy-panel-item .giphy-panel-insert-btn {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0,0,0,.45);
  color: #fff;
  font-size: 22px;
  font-weight: 700;
  opacity: 0;
  transition: opacity .15s;
}
.giphy-panel-item:hover .giphy-panel-insert-btn { opacity: 1; }
.giphy-panel-loading {
  grid-column: 1 / -1;
  display: flex;
  justify-content: center;
  padding: 30px 0;
}
.giphy-spinner {
  width: 28px;
  height: 28px;
  border: 3px solid #ddd;
  border-top-color: #00cdac;
  border-radius: 50%;
  animation: giphySpin .6s linear infinite;
}
@keyframes giphySpin { to { transform: rotate(360deg); } }
.giphy-panel-empty {
  grid-column: 1 / -1;
  text-align: center;
  color: #aaa;
  font-size: 12px;
  padding: 24px 0;
}
.giphy-loadmore-btn {
  font-size: 11px;
  padding: 5px 16px;
  border: 1px solid #ddd;
  border-radius: 14px;
  background: #fff;
  color: #555;
  cursor: pointer;
}
.giphy-attribution {
  text-align: center;
  font-size: 10px;
  color: #aaa;
  padding: 4px 0 10px;
}
/* ══════════════════════════════════════════════════════════════════════════ */

/* ══════════════════════════ PROPERTIES PANEL — TOP TABS ══════════════════════════ */

/* Make #properties a flex column so top tabs + content stack properly */
#properties {
  display: flex !important;
  flex-direction: column;
}

/* Top-level tab bar: Canvas | Position | Widget */
.props-top-tabs {
  display: flex;
  border-bottom: 2px solid #e5e7eb;
  background: #fff;
  flex-shrink: 0;
}
.props-top-btn {
  flex: 1;
  padding: 9px 4px;
  font-size: 11px;
  font-weight: 600;
  color: #6b7280;
  background: none;
  border: none;
  border-bottom: 3px solid transparent;
  margin-bottom: -2px;
  cursor: pointer;
  transition: color .15s, border-color .15s;
  white-space: nowrap;
}
.props-top-btn:hover { color: #111; }
.props-top-btn.active { color: #2563eb; border-bottom-color: #2563eb; }

/* Top-level content panes */
.props-top-content {
  display: none;
  flex: 1;
  flex-direction: column;
  min-height: 0;
  overflow: hidden;
}
.props-top-content.active {
  display: flex;
}

/* Canvas & Widget panes just scroll */
#proptab-canvas,
#proptab-widget {
  overflow-y: auto;
  overflow-x: hidden;
  padding: 12px;
  box-sizing: border-box;
}

/* Position pane holds sub-tabs — no scroll here, sub-tab-content scrolls */
#proptab-position {
  overflow: hidden;
}

/* Sub-tab headers inside Position */
#proptab-position .tab-headers {
  flex-shrink: 0;
  position: sticky;
  top: 0;
  z-index: 2;
  background: #fff;
  border-bottom: 1px solid #e5e7eb;
}

/* Override global .tab-btn colors for #properties — light theme */
#properties .tab-headers .tab-btn {
  color: #6b7280;
  background: #fff;
  font-size: 11px;
  font-weight: 600;
  padding: 8px 4px;
  border: none;
  border-bottom: 2px solid transparent;
  flex: 1;
  cursor: pointer;
  transition: color .15s, border-color .15s;
}
#properties .tab-headers .tab-btn:hover { color: #111; background: #f9fafb; }
#properties .tab-headers .tab-btn.active {
  color: #2563eb;
  background: #fff;
  border-bottom: 2px solid #2563eb;
  font-weight: 700;
}

/* Apply same light theme to Position pane tabs */
#proptab-position .tab-headers .tab-btn {
  color: #6b7280;
  background: #fff;
  font-size: 11px;
  font-weight: 600;
  padding: 8px 4px;
  border: none;
  border-bottom: 2px solid transparent;
  flex: 1;
  cursor: pointer;
  transition: color .15s, border-color .15s;
}
#proptab-position .tab-headers .tab-btn:hover { color: #111; background: #f9fafb; }
#proptab-position .tab-headers .tab-btn.active {
  color: #2563eb;
  background: #fff;
  border-bottom: 2px solid #2563eb;
  font-weight: 700;
}

/* Sub-tab content areas — flex:1 + scroll */
#proptab-position .tab-content {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 0;
  display: none;
}
#proptab-position .tab-content.active {
  display: block;
}

/* ══════════════════════════ ARRANGE PANEL ══════════════════════════ */
.arrange-section { padding: 8px 12px 4px; border-bottom: 1px solid #f0f0f0; }
.arrange-section:last-child { border-bottom: none; padding-bottom: 12px; }
.arrange-section-label { font-size: 11px; font-weight: 700; color: #374151; text-transform: uppercase; letter-spacing: .06em; margin-bottom: 7px; }
.arrange-row { display: flex; gap: 6px; margin-bottom: 5px; }
.arrange-btn {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 5px 8px; font-size: 11px; font-weight: 500;
  border: 1px solid #ddd !important; border-radius: 6px;
  background: #f9fafb !important; color: #1f2937 !important; cursor: pointer;
  white-space: nowrap; transition: background .12s;
}
.arrange-btn:hover { background: #e5e7eb !important; }
.arrange-btn:disabled { opacity: .4; cursor: not-allowed; }
.arrange-btn-half { flex: 1; justify-content: center; }
.arrange-align-grid { display: grid; grid-template-columns: repeat(6, 1fr); gap: 5px; margin-bottom: 4px; }
.arrange-icon-btn {
  display: flex; align-items: center; justify-content: center;
  width: 100%; aspect-ratio: 1;
  border: 1px solid #ddd; border-radius: 6px;
  background: #f9fafb !important; color: #1f2937 !important; cursor: pointer;
  font-size: 16px;
  transition: background .12s;
}
.arrange-icon-btn svg { width: 18px; height: 18px; }
.arrange-icon-btn:hover { background: #dbeafe !important; border-color: #2563eb; color: #2563eb !important; }
.arrange-align-btn {
  flex: 1; display: inline-flex; align-items: center; justify-content: center; gap: 5px;
  padding: 7px 4px; font-size: 12px; font-weight: 500;
  border: 1px solid #ddd !important; border-radius: 6px;
  background: #f9fafb !important; color: #1f2937 !important; cursor: pointer;
  transition: background .12s;
}
.arrange-align-btn svg { width: 16px; height: 16px; }
.arrange-align-btn:hover { background: #dbeafe !important; border-color: #2563eb; color: #2563eb !important; }
.arrange-input-group { flex: 1; display: flex; flex-direction: column; gap: 3px; }
.arrange-input-label { font-size: 11px; color: #374151; font-weight: 600; }
.arrange-input {
  width: 100%; height: 32px; padding: 0 8px;
  border: 1px solid #ddd; border-radius: 6px;
  font-size: 13px; color: #1f2937; box-sizing: border-box;
}
.arrange-input:focus { outline: none; border-color: #2563eb; }
.arrange-checkbox-row {
  display: flex; align-items: center; gap: 7px;
  font-size: 13px; color: #1f2937; cursor: pointer; padding: 4px 0;
}
.arrange-checkbox-row input[type=checkbox] { width: 15px; height: 15px; }

/* ══════════════════════════ ANIMATION PANEL ══════════════════════════ */
.anim-outer { display: flex; flex-direction: column; gap: 8px; margin: 6px 0; }

.anim-section {
  border: 1px solid #e5e7eb;
  border-radius: 10px;
  overflow: hidden;
  background: #fff;
}

.anim-sec-hdr {
  display: flex; align-items: center; justify-content: space-between;
  padding: 9px 12px; background: #f8fafc;
  border-bottom: 1px solid #e5e7eb;
}

.anim-sec-title {
  font-size: 11px; font-weight: 700; color: #475569;
  text-transform: uppercase; letter-spacing: .5px;
}

.anim-sec-body { padding: 4px 0; }

.anim-item-label {
  font-size: 10px; font-weight: 600; color: #94a3b8;
  text-transform: uppercase; letter-spacing: .5px;
  padding: 6px 12px 2px;
}

.anim-item {
  border-bottom: 1px solid #f1f5f9;
}
.anim-item:last-child { border-bottom: none; }

.anim-item-hdr {
  display: flex; align-items: center; gap: 8px;
  padding: 8px 12px;
  user-select: none;
}
.anim-item-hdr:hover { background: #f8fafc; }

.anim-item-icon { flex-shrink: 0; color: #6366f1; line-height: 0; }

.anim-item-name { flex: 1; font-size: 13px; color: #1e293b; }

.anim-item-actions { display: flex; align-items: center; gap: 4px; }

.anim-play-btn, .anim-expand-btn {
  background: none; border: none; cursor: pointer; padding: 3px;
  line-height: 0; border-radius: 4px; color: #6b7280;
  transition: background .12s;
}
.anim-play-btn:hover, .anim-expand-btn:hover { background: #f3f4f6; }

.anim-expand-btn svg { transition: transform .18s; }
.anim-expand-btn.open svg { transform: rotate(180deg); }

.anim-item-body {
  display: none;
  padding: 8px 12px 12px;
  background: #fafafa;
  border-top: 1px solid #f1f5f9;
}

.anim-select {
  width: 100%; padding: 7px 10px; font-size: 13px;
  border: 1px solid #d1d5db; border-radius: 8px;
  background: #fff; color: #1e293b; margin-bottom: 8px;
  outline: none; cursor: pointer;
}
.anim-select:focus { border-color: #6366f1; box-shadow: 0 0 0 2px rgba(99,102,241,.15); }

.anim-del-row {
  display: flex; gap: 8px; margin-bottom: 8px;
}

.anim-spinner { flex: 1; }

.anim-spinner-lab {
  display: block; font-size: 11px; font-weight: 600; color: #64748b; margin-bottom: 3px;
}

.anim-spinner-inp {
  width: 100%; padding: 5px 8px; font-size: 13px;
  border: 1px solid #d1d5db; border-radius: 7px;
  outline: none; background: #fff;
  box-sizing: border-box;
}
.anim-spinner-inp:focus { border-color: #6366f1; }

.anim-speed-wrap { margin-bottom: 8px; }

.anim-speed-title {
  font-size: 11px; font-weight: 600; color: #64748b; margin-bottom: 4px;
}

.anim-speed-row {
  display: flex; align-items: center; gap: 6px;
}

.anim-speed-edge {
  font-size: 10px; color: #94a3b8; white-space: nowrap; flex-shrink: 0;
}

.anim-speed-slider {
  flex: 1; height: 4px; accent-color: #6366f1; cursor: pointer;
}

.anim-speed-val {
  font-size: 11px; color: #6366f1; font-weight: 600; min-width: 22px; text-align: center;
}



/* ══════════════════════════ HISTORY PANEL ══════════════════════════ */
.history-panel { padding: 4px 0; }
.history-empty { text-align: center; color: #aaa; font-size: 12px; padding: 24px 0; }
.history-item {
  display: flex; align-items: center; gap: 8px;
  padding: 6px 12px; font-size: 12px; color: #1f2937 !important;
  cursor: pointer;
  transition: background .12s;
}
.history-item:hover { background: #f3f4f6; }
.history-item-current { background: #eff6ff; color: #2563eb; font-weight: 600; }
.history-icon {
  width: 26px; height: 26px; border-radius: 6px;
  background: #1f2937; display: flex; align-items: center; justify-content: center;
  flex-shrink: 0; color: #fff;
}
.history-label { flex: 1; }

/* ══════════════════════════ ELEMENTS PANEL ══════════════════════════ */
.elements-search-wrap { padding: 8px 10px 4px; }
.elements-section-label {
  font-size: 11px; color: #6b7280; text-transform: uppercase;
  letter-spacing: .06em; padding: 4px 12px 8px; font-weight: 600;
}
.elements-grid {
  display: grid !important;
  grid-template-columns: repeat(5, 1fr) !important;
  gap: 6px !important;
  padding: 0 8px 16px !important;
  max-height: calc(100vh - 200px);
  overflow-y: auto;
  align-content: start;
}
.elements-icon-btn {
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  background: rgba(0,0,0,0.04) !important;
  border: 1px solid rgba(0,0,0,0.1) !important;
  border-radius: 6px !important;
  color: #1f2937 !important;
  cursor: pointer !important;
  padding: 0 !important;
  width: 100% !important;
  height: 44px !important;
  min-height: unset !important;
  aspect-ratio: unset !important;
  overflow: hidden !important;
  position: static !important;
  transition: background .12s ease, color .12s ease !important;
}
.elements-icon-btn:hover {
  background: rgba(0,0,0,0.09) !important;
  color: #111827 !important;
  border-color: rgba(0,0,0,0.2) !important;
  transform: none !important;
  box-shadow: none !important;
}
.elements-icon-btn i {
  font-size: 20px !important;
  line-height: 1 !important;
  pointer-events: none !important;
  color: inherit !important;
}
.elements-icon-label {
  display: none;
}

/* ============================================================
   AI Studio React panel — additional classes used by AIStudioPanel.tsx
   ============================================================ */

/* Advanced row: Slides + Tone pill groups */
.ai-advanced-row {
  display: flex;
  gap: 14px;
  padding: 10px 14px 0;
  flex-wrap: wrap;
}
.ai-adv-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
  flex: 1 1 auto;
}
.ai-adv-label {
  font-size: 9.5px;
  font-weight: 700;
  color: #9ca3af;
  letter-spacing: .07em;
  text-transform: uppercase;
}
.ai-adv-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}
.ai-adv-pill {
  border: 1px solid #e5e7eb;
  background: #fff;
  color: #374151;
  border-radius: 999px;
  padding: 4px 10px;
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  line-height: 1.3;
  transition: background .15s, border-color .15s, color .15s, transform .1s;
}
.ai-adv-pill:hover:not(:disabled) {
  background: #eef2ff;
  border-color: #a5b4fc;
  color: #4338ca;
  transform: translateY(-1px);
}
.ai-adv-pill.active {
  background: #6366f1;
  border-color: #6366f1;
  color: #fff;
  box-shadow: 0 2px 6px rgba(99,102,241,.3);
}
.ai-adv-pill:disabled {
  opacity: .55;
  cursor: not-allowed;
}

/* Quick Start Templates grid */
.ai-tpl-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}
.ai-tpl-card {
  padding: 0;
  text-align: left;
  font-family: inherit;
}
.ai-tpl-card:disabled {
  opacity: .6;
  cursor: not-allowed;
}
.ai-tpl-body {
  order: 2;
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 7px 9px 9px;
}
.ai-tpl-badge {
  display: inline-flex;
  align-self: flex-start;
  align-items: center;
  font-size: 9px;
  font-weight: 700;
  letter-spacing: .04em;
  text-transform: uppercase;
  padding: 2px 6px;
  border-radius: 999px;
  line-height: 1.3;
}
.ai-tpl-desc {
  font-size: 10px;
  color: #6b7280;
  line-height: 1.35;
  margin: 0;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  text-overflow: ellipsis;
}
.ai-tpl-img-wrap {
  order: 1;
  width: 100%;
  height: 64px;
  overflow: hidden;
  background: #f8fafc;
  border-bottom: 1px solid #f1f5f9;
}
.ai-tpl-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* Allow browsers to synthesise bold / italic when the loaded font face
   doesn't provide those variants. The editor-react bundle sets
   `font-synthesis: none` on :root which inherits everywhere — and that
   makes the toolbar's Bold / Italic buttons appear to have no effect for
   fonts like Abel that only ship a weight-400 file. The player CSS does
   not set this restriction, which is why bold/italic render correctly
   there. Force `auto` on the canvas content so editor and player match. */
#stage, .slide-canvas, .widget-text, .widget-text * {
  font-synthesis: auto !important;
  -webkit-font-synthesis: auto !important;
}

/* ─── Crop Image Modal ─────────────────────────────────────────────────── */
.cropper-overlay{position:fixed;inset:0;background:rgba(15,23,42,.55);z-index:100000;display:flex;align-items:center;justify-content:center}
.cropper-modal{background:#fff;border-radius:14px;width:min(1140px,96vw);max-height:92vh;display:flex;flex-direction:column;overflow:hidden;box-shadow:0 20px 60px rgba(0,0,0,.3)}
.cropper-header{padding:14px 22px;border-bottom:1px solid #f1f5f9;font-weight:600;color:#0f172a;font-size:15px}
.cropper-body{display:flex;flex:1;min-height:0;gap:18px;padding:18px}
.cropper-stage{flex:1;position:relative;background:
  conic-gradient(#e5e7eb 25%, #fff 0 50%, #e5e7eb 0 75%, #fff 0) 0 0/24px 24px;
  border-radius:10px;overflow:hidden;min-height:380px;display:flex;align-items:center;justify-content:center;user-select:none}
.cropper-stage img{position:absolute;top:50%;left:50%;transform-origin:center center;pointer-events:none;max-width:none;max-height:none;-webkit-user-drag:none;user-select:none}
.cropper-box{position:absolute;border:2px solid #60a5fa;box-shadow:0 0 0 9999px rgba(0,0,0,.45);box-sizing:border-box;cursor:move}
.cropper-box.is-circle{border-radius:50%}
.cropper-grid{position:absolute;inset:0;pointer-events:none;background:
  linear-gradient(to right, transparent calc(33.333% - 0.5px), rgba(255,255,255,.55) calc(33.333% - 0.5px) calc(33.333% + 0.5px), transparent calc(33.333% + 0.5px), transparent calc(66.666% - 0.5px), rgba(255,255,255,.55) calc(66.666% - 0.5px) calc(66.666% + 0.5px), transparent calc(66.666% + 0.5px)),
  linear-gradient(to bottom, transparent calc(33.333% - 0.5px), rgba(255,255,255,.55) calc(33.333% - 0.5px) calc(33.333% + 0.5px), transparent calc(33.333% + 0.5px), transparent calc(66.666% - 0.5px), rgba(255,255,255,.55) calc(66.666% - 0.5px) calc(66.666% + 0.5px), transparent calc(66.666% + 0.5px))}
.cropper-handle{position:absolute;width:12px;height:12px;background:#fff;border:1.5px solid #60a5fa;border-radius:2px;box-sizing:border-box}
.cropper-handle.h-tl{top:-7px;left:-7px;cursor:nwse-resize}
.cropper-handle.h-tr{top:-7px;right:-7px;cursor:nesw-resize}
.cropper-handle.h-bl{bottom:-7px;left:-7px;cursor:nesw-resize}
.cropper-handle.h-br{bottom:-7px;right:-7px;cursor:nwse-resize}
.cropper-handle.h-t{top:-7px;left:50%;transform:translateX(-50%);cursor:ns-resize}
.cropper-handle.h-b{bottom:-7px;left:50%;transform:translateX(-50%);cursor:ns-resize}
.cropper-handle.h-l{left:-7px;top:50%;transform:translateY(-50%);cursor:ew-resize}
.cropper-handle.h-r{right:-7px;top:50%;transform:translateY(-50%);cursor:ew-resize}
.cropper-side{width:260px;display:flex;flex-direction:column;gap:14px}
.cropper-preview-wrap{width:100%;height:200px;display:flex;align-items:center;justify-content:center;overflow:hidden;background:#fff;border-radius:8px}
#cropPreview{display:block;max-width:100%;max-height:100%}
.cropper-size-box{display:flex;justify-content:space-between;padding:10px 12px;border:1px solid #e5e7eb;border-radius:8px;font-size:13px;color:#334155}
.cropper-shape-row{display:flex;gap:18px;align-items:center;font-size:13px;color:#334155}
.cropper-shape-row label{display:flex;gap:6px;align-items:center;cursor:pointer}
.cropper-shape-row input[type=radio]{accent-color:#10b981}
.cropper-ratio-row{display:flex;flex-direction:column;gap:6px;border:1px solid #e5e7eb;border-radius:8px;padding:8px 10px}
.cropper-ratio-label{font-size:11px;color:#64748b;text-transform:none}
.cropper-ratio-row select{border:none;outline:none;background:transparent;font-size:14px;color:#0f172a;padding:2px 0;width:100%;cursor:pointer}
.cropper-tools{display:grid;grid-template-columns:repeat(4,1fr);gap:8px}
.cropper-tool-btn{display:flex;align-items:center;justify-content:center;width:100%;height:40px;border:1px solid #e5e7eb;background:#fff;border-radius:8px;cursor:pointer;color:#334155;transition:background .15s}
.cropper-tool-btn:hover{background:#f8fafc}
.cropper-footer{display:flex;justify-content:flex-end;gap:10px;padding:14px 22px;border-top:1px solid #f1f5f9;background:#fafafa}
.cropper-btn{padding:9px 22px;border-radius:8px;font-size:14px;font-weight:500;cursor:pointer;border:1px solid transparent;transition:background .15s,opacity .15s}
.cropper-btn-secondary{background:#fff;border-color:#e5e7eb;color:#334155}
.cropper-btn-secondary:hover{background:#f8fafc}
.cropper-btn-primary{background:#10b981;color:#fff}
.cropper-btn-primary:hover{background:#059669}
.cropper-btn:disabled{opacity:.6;cursor:not-allowed}
@media (max-width: 760px){
  .cropper-body{flex-direction:column}
  .cropper-side{width:100%}
}

/* ─── Image Effects Drawer ─────────────────────────────────────────────── */
.image-effects-overlay {
  position: fixed;
  inset: 0;
  z-index: 100020;
  display: none;
  align-items: stretch;
  justify-content: flex-end;
  background: rgba(2, 6, 23, 0.45);
}
.image-effects-panel {
  width: min(460px, 92vw);
  height: 100dvh;
  max-height: 100dvh;
  overflow-y: auto;
  overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
  display: flex;
  flex-direction: column;
  background: linear-gradient(180deg, #171a2b 0%, #1a1e31 100%);
  border-left: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: -14px 0 30px rgba(0, 0, 0, 0.35);
  padding: 14px 14px 16px;
}
.image-effects-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
  flex: 0 0 auto;
  position: sticky;
  top: 0;
  z-index: 2;
  background: linear-gradient(180deg, #171a2b 0%, #1a1e31 100%);
  padding: 2px 0 10px;
}
.image-effects-head h3 {
  margin: 0;
  color: #f8fafc;
  font-size: 18px;
  line-height: 1;
  font-weight: 700;
}
.image-effects-close {
  width: 42px;
  height: 42px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.06);
  color: #cbd5e1;
  font-size: 28px;
  line-height: 1;
  cursor: pointer;
}
.image-effects-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  flex: 0 0 auto;
  min-height: auto;
  overflow: visible;
  padding-right: 2px;
}
.image-effect-card {
  border: none;
  background: transparent;
  padding: 0;
  cursor: pointer;
  text-align: left;
}
.image-effect-thumb {
  width: 100%;
  aspect-ratio: 16 / 10;
  border-radius: 12px;
  overflow: hidden;
  background: #0b1020;
  border: 2px solid transparent;
  transition: border-color 0.18s ease, transform 0.18s ease;
}
.image-effect-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.image-effect-label {
  margin-top: 8px;
  display: block;
  color: #a8afc1;
  font-size: 15px;
  line-height: 1.2;
  font-weight: 500;
}
.image-effect-card:hover .image-effect-thumb {
  border-color: rgba(94, 234, 212, 0.5);
  transform: translateY(-1px);
}
.image-effect-card.active .image-effect-thumb {
  border-color: #22c55e;
  box-shadow: 0 0 0 2px rgba(34, 197, 94, 0.22);
}
.image-effect-card.active .image-effect-label {
  color: #f8fafc;
}
@media (max-width: 900px) {
  .image-effects-panel { width: min(400px, 92vw); }
  .image-effects-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .image-effect-label { font-size: 14px; }
  .image-effects-head h3 { font-size: 17px; }
}

/* ─── Frame Drawer ─────────────────────────────────────────────────────── */
.elements-frames-launcher {
  margin-top: 14px;
  padding: 0 2px 2px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.elements-frames-btn {
  width: 100%;
  border: 1px solid #2f80ed;
  background: linear-gradient(180deg, #2f80ed 0%, #2563eb 100%);
  color: #fff;
  border-radius: 12px;
  min-height: 46px;
  font-size: 14px;
  font-weight: 700;
  letter-spacing: .01em;
  cursor: pointer;
  box-shadow: 0 8px 16px rgba(37, 99, 235, .18);
}
.elements-frames-btn:hover { filter: brightness(1.03); }
.elements-frames-note {
  font-size: 12px;
  line-height: 1.35;
  color: #64748b;
}
.frame-panel {
  padding: 4px 2px 10px;
}
#framesPanel {
  background: transparent;
  border-left: none;
}
.frame-panel-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 12px;
}
.frame-panel-head h3 {
  margin: 0;
}
.frame-panel-note {
  margin-top: 4px;
  font-size: 12px;
  line-height: 1.35;
  color: #64748b;
}
.frame-color-box {
  margin: 12px 0 8px;
  padding: 12px;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  background: #ffffff;
  display: none;
}
.frame-color-box.is-open {
  display: block;
}
.frame-color-row {
  display: flex;
  align-items: center;
  gap: 10px;
}
#frameColorPicker {
  width: 38px;
  height: 32px;
  border: none;
  background: transparent;
  padding: 0;
  cursor: pointer;
}
#frameColorHex {
  flex: 1;
  min-height: 34px;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  background: #ffffff;
  color: #0f172a;
  padding: 7px 9px;
  text-transform: uppercase;
}
.frame-drawer-overlay {
  position: fixed;
  inset: 0;
  z-index: 100030;
  display: none;
  align-items: stretch;
  justify-content: flex-end;
  background: rgba(15, 23, 42, 0.45);
}
.frame-drawer-panel {
  width: min(560px, 92vw);
  height: 100dvh;
  max-height: 100dvh;
  overflow-y: auto;
  overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
  display: flex;
  flex-direction: column;
  padding: 18px 16px 20px;
  background: linear-gradient(180deg, #191c2b 0%, #1c2032 100%);
  border-left: 1px solid rgba(255,255,255,.08);
  box-shadow: -16px 0 32px rgba(0,0,0,.35);
}
.frame-drawer-head {
  position: sticky;
  top: 0;
  z-index: 3;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-bottom: 12px;
  margin-bottom: 12px;
  background: linear-gradient(180deg, #191c2b 0%, #1c2032 100%);
}
.frame-drawer-head h3 {
  margin: 0;
  color: #f8fafc;
  font-size: 24px;
  line-height: 1;
  font-weight: 700;
}
.frame-drawer-close {
  width: 46px;
  height: 46px;
  border: 1px solid rgba(255,255,255,.08);
  border-radius: 12px;
  background: rgba(255,255,255,.06);
  color: #cbd5e1;
  font-size: 30px;
  line-height: 1;
  cursor: pointer;
}
.frame-drawer-top-grid,
.frame-drawer-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}
.frame-drawer-grid {
  margin-top: 10px;
}
.frame-size-box {
  margin: 10px 0 8px;
  padding: 12px;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  background: #ffffff;
  color: #0f172a;
}
.frame-size-box.is-open {
  display: block;
}
.frame-size-box:not(.is-open) {
  display: none;
}
.frame-size-label {
  font-size: 13px;
  margin-bottom: 10px;
}
.frame-size-box input[type="range"] {
  width: 100%;
  accent-color: #2563eb;
}
.frame-card {
  border: 1px solid #dbe2ea;
  background: #ffffff;
  border-radius: 12px;
  padding: 6px;
  cursor: pointer;
  text-align: left;
  overflow: hidden;
  transition: border-color .15s ease, box-shadow .15s ease, transform .15s ease;
}
.frame-card-preview {
  position: relative;
  width: 100%;
  aspect-ratio: 1 / 1;
  border-radius: 10px;
  overflow: hidden;
  background: #f8fafc;
}
.frame-card-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.frame-preview-layer,
.widget-image-frame {
  border-radius: inherit;
}
.frame-card-label {
  margin: 8px 2px 2px;
  color: #475569;
  font-size: 12px;
  font-weight: 500;
  line-height: 1.2;
}
.frame-card:hover .frame-card-preview {
  outline: 2px solid rgba(37, 99, 235, 0.24);
  outline-offset: 0;
}
.frame-card:hover {
  border-color: #93c5fd;
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.10);
  transform: translateY(-1px);
}
.frame-card.active .frame-card-preview {
  outline: 2px solid #2563eb;
  outline-offset: 0;
}
.frame-card.active {
  border-color: #2563eb;
  box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.18);
}
.frame-card.active .frame-card-label {
  color: #1e3a8a;
}
.widget-frame-remove-btn {
  position: absolute;
  top: 10px;
  right: 10px;
  width: 34px;
  height: 34px;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.25);
  background: rgba(15, 23, 42, 0.82);
  color: #fff;
  font-size: 24px;
  line-height: 1;
  padding: 0;
  cursor: pointer;
  z-index: 6;
}
.widget-frame-remove-btn:hover {
  background: rgba(220, 38, 38, 0.9);
  border-color: rgba(254, 202, 202, 0.55);
}

/* ─── Editor 3 professional Frames panel ─────────────────────────────── */
body.editor3-shell #framesPanel {
  --frame-brand-blue: #064178;
  --frame-brand-purple: #a91e5e;
  --frame-ink: #172033;
  --frame-muted: #68748a;
  --frame-line: #e3e8f1;
}
body.editor3-shell #framesPanel .frame-panel {
  padding: 2px 12px 24px;
}
body.editor3-shell #framesPanel .frame-panel-head {
  margin: 0 0 14px;
}
body.editor3-shell #framesPanel .frame-panel-head h3 {
  color: var(--frame-ink);
  font-size: 18px;
  line-height: 1.2;
  font-weight: 750;
  letter-spacing: -.02em;
}
body.editor3-shell #framesPanel .frame-panel-note {
  max-width: 280px;
  color: var(--frame-muted);
  font-size: 12px;
  line-height: 1.45;
}
.frame-target-switch {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 4px;
  padding: 4px;
  margin-bottom: 12px;
  border: 1px solid var(--frame-line, #e3e8f1);
  border-radius: 12px;
  background: #f4f6fa;
}
.frame-target-btn {
  min-width: 0;
  min-height: 38px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  border: 0;
  border-radius: 9px;
  background: transparent;
  color: #647087;
  font: 650 12px/1 system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  cursor: pointer;
  transition: color .16s ease, background .16s ease, box-shadow .16s ease;
}
.frame-target-btn svg {
  width: 16px;
  height: 16px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.frame-target-btn:hover {
  color: var(--frame-brand-blue, #064178);
}
.frame-target-btn.active {
  color: var(--frame-brand-blue, #064178);
  background: #fff;
  box-shadow: 0 2px 8px rgba(24, 39, 75, .1);
}
.frame-panel-search {
  position: relative;
  margin-bottom: 10px;
}
.frame-panel-search svg {
  position: absolute;
  z-index: 1;
  left: 12px;
  top: 50%;
  width: 16px;
  height: 16px;
  transform: translateY(-50%);
  fill: none;
  stroke: #7b879b;
  stroke-width: 1.8;
  stroke-linecap: round;
  pointer-events: none;
}
.frame-panel-search input {
  width: 100%;
  height: 40px;
  border: 1px solid var(--frame-line, #e3e8f1);
  border-radius: 11px;
  outline: none;
  background: #fff;
  color: var(--frame-ink, #172033);
  padding: 0 12px 0 37px;
  font-size: 12px;
  transition: border-color .16s ease, box-shadow .16s ease;
}
.frame-panel-search input:focus {
  border-color: rgba(6, 65, 120, .52);
  box-shadow: 0 0 0 3px rgba(6, 65, 120, .09);
}
.frame-category-chips {
  display: flex;
  gap: 6px;
  margin: 0 -2px 12px;
  padding: 2px 2px 5px;
  overflow-x: auto;
  scrollbar-width: none;
}
.frame-category-chips::-webkit-scrollbar {
  display: none;
}
.frame-category-chip {
  flex: 0 0 auto;
  min-height: 28px;
  border: 1px solid var(--frame-line, #e3e8f1);
  border-radius: 999px;
  background: #fff;
  color: #647087;
  padding: 5px 10px;
  font-size: 11px;
  font-weight: 650;
  cursor: pointer;
}
.frame-category-chip:hover {
  color: var(--frame-brand-blue, #064178);
  border-color: rgba(6, 65, 120, .3);
}
.frame-category-chip.active {
  border-color: transparent;
  background: linear-gradient(135deg, var(--frame-brand-blue, #064178), #315f9d);
  color: #fff;
  box-shadow: 0 4px 10px rgba(6, 65, 120, .18);
}
.frame-selection-hint {
  margin: 4px 0 12px;
  border: 1px solid #f3d4e2;
  border-radius: 10px;
  background: #fff7fb;
  color: #7f234d;
  padding: 9px 10px;
  font-size: 11px;
  line-height: 1.4;
}
.frame-section-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin: 2px 1px 8px;
  color: #29354a;
  font-size: 11px;
  font-weight: 750;
  letter-spacing: .045em;
  text-transform: uppercase;
}
.frame-section-heading small {
  color: #8a95a8;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0;
  text-transform: none;
}
.frame-all-heading {
  margin-top: 16px;
}
.frame-customizer-shell {
  margin: 12px 0 2px;
  border: 1px solid var(--frame-line, #e3e8f1);
  border-radius: 12px;
  background: #fff;
  overflow: hidden;
}
.frame-customizer-shell > summary {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 2px;
  list-style: none;
  cursor: pointer;
  padding: 11px 38px 11px 12px;
  color: #29354a;
}
.frame-customizer-shell > summary::-webkit-details-marker {
  display: none;
}
.frame-customizer-shell > summary::after {
  content: "";
  position: absolute;
  top: 50%;
  right: 15px;
  width: 8px;
  height: 8px;
  border-right: 1.5px solid #7a8598;
  border-bottom: 1.5px solid #7a8598;
  transform: translateY(-70%) rotate(45deg);
  transition: transform .16s ease;
}
.frame-customizer-shell[open] > summary::after {
  transform: translateY(-20%) rotate(225deg);
}
.frame-customizer-shell > summary span {
  font-size: 12px;
  font-weight: 750;
}
.frame-customizer-shell > summary small {
  color: #8390a4;
  font-size: 10px;
  font-weight: 550;
}
.frame-customizer-shell[open] > summary {
  border-bottom: 1px solid #edf0f5;
  background: #f9fafc;
}
.frame-customizer-shell .frame-properties-panel {
  margin: 0;
  padding: 10px;
}
body.editor3-shell #framesPanel .frame-drawer-top-grid,
body.editor3-shell #framesPanel .frame-drawer-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}
body.editor3-shell #framesPanel .frame-drawer-grid {
  margin-top: 0;
}
body.editor3-shell #framesPanel .frame-card {
  position: relative;
  min-width: 0;
  border: 1px solid var(--frame-line, #e3e8f1);
  border-radius: 13px;
  background: #fff;
  padding: 5px;
  box-shadow: 0 1px 2px rgba(22, 31, 50, .04);
  transform: translateZ(0);
}
body.editor3-shell #framesPanel .frame-card:hover {
  border-color: rgba(6, 65, 120, .34);
  box-shadow: 0 8px 18px rgba(35, 48, 74, .11);
  transform: translateY(-2px);
}
body.editor3-shell #framesPanel .frame-card:focus-visible {
  outline: 3px solid rgba(6, 65, 120, .18);
  outline-offset: 2px;
}
body.editor3-shell #framesPanel .frame-card:disabled {
  opacity: .48;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}
body.editor3-shell #framesPanel .frame-card-preview {
  aspect-ratio: 16 / 10;
  border-radius: 9px;
  background: linear-gradient(145deg, #18243a, #090e19);
}
body.editor3-shell #framesPanel .frame-card-img {
  object-fit: cover;
  transform: scale(1.01);
}
.frame-preview-scrim {
  position: absolute;
  inset: 0;
  z-index: 1;
  background: linear-gradient(180deg, rgba(4, 10, 22, .02), rgba(4, 10, 22, .14));
  pointer-events: none;
}
body.editor3-shell #framesPanel .frame-preview-layer {
  z-index: 2 !important;
  box-sizing: border-box;
}
.frame-card-check {
  position: absolute;
  z-index: 8;
  top: 7px;
  right: 7px;
  width: 20px;
  height: 20px;
  display: grid;
  place-items: center;
  border: 2px solid #fff;
  border-radius: 999px;
  background: linear-gradient(135deg, var(--frame-brand-blue, #064178), var(--frame-brand-purple, #a91e5e));
  color: #fff;
  box-shadow: 0 3px 8px rgba(12, 25, 49, .25);
  font-size: 11px;
  font-weight: 800;
  opacity: 0;
  transform: scale(.78);
  transition: opacity .16s ease, transform .16s ease;
}
.frame-card.active .frame-card-check {
  opacity: 1;
  transform: scale(1);
}
.frame-card-meta {
  min-width: 0;
  padding: 7px 3px 4px;
}
body.editor3-shell #framesPanel .frame-card-label {
  margin: 0;
  overflow: hidden;
  color: #273249;
  font-size: 11px;
  font-weight: 700;
  line-height: 1.25;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.frame-card-category {
  margin-top: 3px;
  color: #8a94a6;
  font-size: 9px;
  font-weight: 600;
  letter-spacing: .04em;
  text-transform: uppercase;
}
body.editor3-shell #framesPanel .frame-card.active {
  border-color: var(--frame-brand-blue, #064178);
  box-shadow: 0 0 0 2px rgba(6, 65, 120, .12), 0 7px 16px rgba(26, 41, 67, .1);
}
body.editor3-shell #framesPanel .frame-card.active .frame-card-preview {
  outline: none;
}
body.editor3-shell #framesPanel .frame-card.active .frame-card-label {
  color: var(--frame-brand-blue, #064178);
}
.frame-empty-state {
  margin-top: 10px;
  border: 1px dashed #d9dfeb;
  border-radius: 12px;
  color: #758197;
  padding: 22px 14px;
  text-align: center;
  font-size: 12px;
}
.frame-properties-empty {
  margin: 14px 0;
  border: 1px dashed #d8dfeb;
  border-radius: 12px;
  background: #fafbfe;
  padding: 18px 14px;
  text-align: center;
}
.frame-properties-empty span {
  color: #273249;
  font-size: 13px;
  font-weight: 750;
}
.frame-properties-empty p {
  margin: 5px 0 0;
  color: #778297;
  font-size: 11px;
  line-height: 1.45;
}
body.editor3-shell .frame-prop-actions {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 6px;
  margin-bottom: 2px;
}
body.editor3-shell .frame-prop-btn {
  min-height: 34px;
  border-color: #dde3ed;
  border-radius: 9px;
  color: #435068;
  padding: 6px 7px;
  font-size: 10px;
}
body.editor3-shell .frame-prop-btn:hover {
  border-color: rgba(6, 65, 120, .28);
  background: #f4f8fc;
  color: #064178;
}
body.editor3-shell .frame-prop-group {
  border-color: #e2e7f0;
  border-radius: 12px;
  box-shadow: 0 1px 2px rgba(25, 37, 60, .025);
}
body.editor3-shell .frame-prop-group > summary {
  position: relative;
  padding: 11px 34px 11px 12px;
  color: #263249;
  font-size: 12px;
}
body.editor3-shell .frame-prop-group > summary::after {
  content: "";
  position: absolute;
  top: 50%;
  right: 13px;
  width: 7px;
  height: 7px;
  border-right: 1.5px solid #7a8598;
  border-bottom: 1.5px solid #7a8598;
  transform: translateY(-65%) rotate(45deg);
  transition: transform .16s ease;
}
body.editor3-shell .frame-prop-group[open] > summary::after {
  transform: translateY(-20%) rotate(225deg);
}
body.editor3-shell .frame-prop-range {
  accent-color: #064178;
}

@media (max-width: 899px) {
  body.editor3-shell #framesPanel .frame-panel {
    padding: 4px 14px calc(28px + env(safe-area-inset-bottom));
  }
  body.editor3-shell #framesPanel .frame-drawer-top-grid,
  body.editor3-shell #framesPanel .frame-drawer-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
@media (max-width: 900px) {
  .frame-drawer-top-grid,
  .frame-drawer-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
