:root {
  --sg-bg: #f6f7fb;
  --sg-surface: #ffffff;
  --sg-text: #0f172a;
  --sg-muted: #64748b;
  --sg-border: rgba(15, 23, 42, 0.10);
  --sg-shadow: 0 10px 30px rgba(15, 23, 42, 0.08);
  --sg-shadow-sm: 0 6px 18px rgba(15, 23, 42, 0.08);
  --sg-brand: #6d28d9;
  --sg-brand-2: #0ea5e9;
  --sg-brand-3: #22c55e;
  --sg-radius: 18px;
  --sg-radius-sm: 14px;
  --sg-font: Inter, ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, Arial, "Apple Color Emoji", "Segoe UI Emoji";
}

html, body {
  height: 100%;
}

body.app-body {
  font-family: var(--sg-font);
  color: var(--sg-text);
  background:
    radial-gradient(1100px circle at 10% -10%, rgba(109, 40, 217, .16), transparent 48%),
    radial-gradient(900px circle at 95% 10%, rgba(14, 165, 233, .12), transparent 42%),
    radial-gradient(900px circle at 40% 110%, rgba(34, 197, 94, .10), transparent 45%),
    var(--sg-bg);
}

.sg-navbar {
  background: linear-gradient(135deg, rgba(109, 40, 217, .98), rgba(14, 165, 233, .92));
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.12);
}

.sg-navbar .navbar-brand {
  font-weight: 700;
  letter-spacing: .2px;
}

.sg-brand-mark {
  width: 24px;
  height: 24px;
  display: inline-block;
}

.sg-shell {
  min-height: 100vh;
  display: flex;
}

.sg-sidebar {
  width: 280px;
  padding: 18px 16px;
  position: sticky;
  top: 0;
  height: 100vh;
  background:
    radial-gradient(900px circle at 10% -10%, rgba(109, 40, 217, .30), transparent 55%),
    radial-gradient(900px circle at 95% 10%, rgba(14, 165, 233, .22), transparent 52%),
    rgba(11, 18, 32, .92);
  color: rgba(255,255,255,.9);
  border-right: 1px solid rgba(255,255,255,.10);
  backdrop-filter: blur(10px) saturate(140%);
}

.sg-offcanvas {
  background:
    radial-gradient(900px circle at 10% -10%, rgba(109, 40, 217, .30), transparent 55%),
    radial-gradient(900px circle at 95% 10%, rgba(14, 165, 233, .22), transparent 52%),
    rgba(11, 18, 32, .96);
  color: rgba(255,255,255,.9);
  border-right: 1px solid rgba(255,255,255,.10);
}

.sg-offcanvas .offcanvas-header {
  border-bottom: 1px solid rgba(255,255,255,.10);
}

.sg-sidebar-brand {
  display: inline-flex;
  align-items: center;
  gap: .6rem;
  color: rgba(255,255,255,.95);
  text-decoration: none;
  font-weight: 800;
  letter-spacing: .2px;
}

.sg-sidebar-brand:hover {
  color: #fff;
}

.sg-sidebar-label {
  margin-top: 18px;
  margin-bottom: 10px;
  font-size: .75rem;
  text-transform: uppercase;
  letter-spacing: .12em;
  color: rgba(255,255,255,.62);
}

.sg-sidenav {
  display: grid;
  gap: 8px;
}

.sg-sidenav a {
  display: flex;
  align-items: center;
  gap: .75rem;
  padding: .6rem .7rem;
  border-radius: 14px;
  text-decoration: none;
  color: rgba(255,255,255,.82);
  transition: transform .12s ease, background .12s ease, box-shadow .12s ease;
}

.sg-sidenav a .bi {
  opacity: .9;
}

.sg-sidenav a:hover {
  background: rgba(255,255,255,.10);
  transform: translateX(1px);
}

.sg-sidenav a.active {
  background: rgba(255,255,255,.14);
  color: #fff;
  box-shadow: 0 10px 24px rgba(0,0,0,.22);
}

.sg-sidebar-card {
  margin-top: auto;
  padding: 12px;
  border-radius: 16px;
  border: 1px solid rgba(255,255,255,.12);
  background: rgba(255,255,255,.06);
}

.sg-main {
  flex: 1;
  min-width: 0;
}

.sg-topbar {
  position: sticky;
  top: 0;
  z-index: 1020;
  padding: 10px 12px;
  background: rgba(11, 18, 32, .78);
  border-bottom: 1px solid rgba(255,255,255,.10);
  backdrop-filter: blur(10px) saturate(140%);
  box-shadow: 0 10px 26px rgba(15, 23, 42, 0.14);
}

.sg-topbar-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.sg-topbar-title {
  font-weight: 700;
  color: rgba(255,255,255,.92);
  letter-spacing: .2px;
}

.sg-icon-btn {
  border-radius: 12px;
  border: 1px solid rgba(255,255,255,.18);
  background: rgba(255,255,255,.10);
  color: rgba(255,255,255,.92);
}

.sg-icon-btn:hover {
  background: rgba(255,255,255,.14);
  color: #fff;
}

.sg-content {
  padding: 18px 0 28px;
}

.sg-stage {
  width: 100%;
  aspect-ratio: 16 / 9;
  background: #fff;
  border: 1px solid rgba(15, 23, 42, 0.10);
  border-radius: var(--sg-radius);
  overflow: hidden;
}

.sg-stage #stage-wrap,
.sg-stage #stage-container {
  width: 100%;
  height: 100%;
}

.sg-asset-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  max-height: 320px;
  overflow: auto;
  padding-right: 4px;
}

@media (min-width: 992px) {
  .sg-asset-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

.sg-asset-tile {
  appearance: none;
  border: 1px solid rgba(15, 23, 42, 0.12);
  border-radius: 14px;
  overflow: hidden;
  background: #fff;
  padding: 0;
  position: relative;
  box-shadow: 0 10px 22px rgba(15, 23, 42, 0.08);
  transition: transform .12s ease, box-shadow .12s ease;
}

.sg-asset-tile:hover {
  transform: translateY(-1px);
  box-shadow: 0 16px 34px rgba(15, 23, 42, 0.12);
}

.sg-asset-tile img {
  width: 100%;
  height: 86px;
  object-fit: cover;
  display: block;
}

.sg-asset-meta {
  position: absolute;
  bottom: 8px;
  right: 8px;
  font-size: 12px;
  font-weight: 700;
  padding: 4px 8px;
  border-radius: 999px;
  background: rgba(11, 18, 32, .76);
  color: rgba(255,255,255,.92);
  border: 1px solid rgba(255,255,255,.14);
  backdrop-filter: blur(6px);
}

.sg-media-sidebar-card {
  position: sticky;
  top: 84px;
}

.sg-media-folder-list {
  display: grid;
  gap: 8px;
  max-height: 360px;
  overflow: auto;
  padding-right: 4px;
}

.sg-media-folder-item {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 11px 12px;
  border-radius: 16px;
  border: 1px solid rgba(15, 23, 42, 0.10);
  background: rgba(248,250,252,.95);
  color: #0f172a;
  text-align: left;
  transition: transform .12s ease, box-shadow .12s ease, border-color .12s ease;
}

.sg-media-folder-item:hover {
  transform: translateY(-1px);
  box-shadow: 0 14px 28px rgba(15, 23, 42, 0.08);
}

.sg-media-folder-item.active {
  border-color: rgba(109, 40, 217, .35);
  background: linear-gradient(135deg, rgba(109, 40, 217, .10), rgba(14, 165, 233, .10));
  box-shadow: 0 14px 28px rgba(15, 23, 42, 0.10);
}

.sg-media-folder-item.is-drop-target {
  border-color: rgba(14, 165, 233, .52);
  background: linear-gradient(135deg, rgba(14, 165, 233, .14), rgba(34, 197, 94, .10));
  box-shadow: 0 18px 36px rgba(14, 165, 233, 0.16);
}

.sg-media-folder-name {
  display: inline-flex;
  align-items: center;
  gap: .65rem;
  min-width: 0;
  font-weight: 600;
}

.sg-media-folder-name span:last-child {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.sg-media-folder-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 32px;
  height: 32px;
  padding: 0 10px;
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.08);
  color: #334155;
  font-size: .78rem;
  font-weight: 700;
}

.sg-media-upload-zone {
  border: 1.5px dashed rgba(109, 40, 217, .28);
  border-radius: 22px;
  padding: 28px 20px;
  text-align: center;
  background:
    radial-gradient(900px circle at 10% -20%, rgba(109, 40, 217, .08), transparent 52%),
    radial-gradient(700px circle at 95% 10%, rgba(14, 165, 233, .06), transparent 45%),
    rgba(248,250,252,.92);
  transition: border-color .12s ease, transform .12s ease, box-shadow .12s ease, background .12s ease;
}

.sg-media-upload-zone.is-dragover,
.sg-media-upload-zone.is-uploading {
  border-color: rgba(109, 40, 217, .56);
  transform: translateY(-1px);
  box-shadow: 0 18px 38px rgba(109, 40, 217, .10);
  background:
    radial-gradient(900px circle at 10% -20%, rgba(109, 40, 217, .14), transparent 52%),
    radial-gradient(700px circle at 95% 10%, rgba(14, 165, 233, .10), transparent 45%),
    rgba(255,255,255,.96);
}

.sg-media-upload-icon {
  width: 68px;
  height: 68px;
  margin: 0 auto 14px;
  border-radius: 22px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 1.6rem;
  color: #6d28d9;
  background: linear-gradient(135deg, rgba(109, 40, 217, .14), rgba(14, 165, 233, .10));
  border: 1px solid rgba(109, 40, 217, .18);
}

.sg-media-card {
  overflow: hidden;
  transition: transform .14s ease, box-shadow .14s ease, opacity .14s ease;
}

[data-asset-card][draggable="true"] {
  cursor: grab;
}

[data-asset-card].is-dragging .sg-media-card {
  opacity: .55;
  transform: scale(.985);
}

.sg-media-thumb {
  display: block;
  width: 100%;
  height: 220px;
  border: 0;
  background: rgba(15, 23, 42, .03);
  padding: 0;
}

.sg-media-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.sg-media-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.sg-media-meta span {
  display: inline-flex;
  align-items: center;
  padding: 4px 9px;
  border-radius: 999px;
  background: rgba(15, 23, 42, .05);
  color: #475569;
  font-size: .74rem;
  font-weight: 600;
}

.sg-playlist-list {
  display: grid;
  gap: 14px;
}

.sg-playlist-item {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 16px;
  padding: 16px;
  border-radius: 24px;
  border: 1px solid rgba(15, 23, 42, 0.10);
  background:
    radial-gradient(900px circle at 0% 0%, rgba(109, 40, 217, .06), transparent 32%),
    rgba(255,255,255,.96);
  box-shadow: 0 16px 36px rgba(15, 23, 42, 0.07);
  transition: transform .14s ease, box-shadow .14s ease, border-color .14s ease;
}

.sg-playlist-item:hover {
  transform: translateY(-1px);
  box-shadow: 0 20px 42px rgba(15, 23, 42, 0.09);
}

.sg-playlist-item.is-sort-ghost {
  opacity: .45;
}

.sg-playlist-item.is-sort-chosen {
  border-color: rgba(109, 40, 217, .34);
  box-shadow: 0 24px 46px rgba(109, 40, 217, .12);
}

.sg-playlist-handle-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
}

.sg-playlist-handle {
  width: 42px;
  height: 42px;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 14px;
  cursor: grab;
}

.sg-playlist-handle:active {
  cursor: grabbing;
}

.sg-playlist-order-badge {
  min-width: 34px;
  height: 34px;
  padding: 0 10px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  background: rgba(15, 23, 42, .06);
  color: #334155;
  font-size: .8rem;
  font-weight: 800;
}

.sg-playlist-main {
  min-width: 0;
}

.sg-playlist-order-input {
  width: 86px;
}

.sg-playlist-form[data-dirty="1"] .btn-primary.sg-btn {
  box-shadow: 0 14px 28px rgba(37, 99, 235, .18);
}

@media (max-width: 767.98px) {
  .sg-playlist-item {
    grid-template-columns: 1fr;
  }

  .sg-playlist-handle-wrap {
    flex-direction: row;
    justify-content: space-between;
  }
}

.sg-tool-tabs {
  display: inline-flex;
  gap: 8px;
  padding: 8px;
  border-radius: 16px;
  border: 1px solid rgba(15, 23, 42, 0.10);
  background: rgba(255,255,255,.72);
  box-shadow: var(--sg-shadow-sm);
}

.sg-tool-tab {
  width: 40px;
  height: 40px;
  border-radius: 14px;
  border: 1px solid rgba(15, 23, 42, 0.12);
  background: rgba(255,255,255,.92);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: rgba(15, 23, 42, .86);
  transition: transform .12s ease, box-shadow .12s ease, background .12s ease;
}

.sg-tool-tab:hover {
  transform: translateY(-1px);
  box-shadow: 0 14px 30px rgba(15, 23, 42, 0.10);
}

.sg-tool-tab.active {
  background: linear-gradient(135deg, rgba(109, 40, 217, .14), rgba(14, 165, 233, .12));
  border-color: rgba(109, 40, 217, .35);
  color: rgba(15, 23, 42, .96);
}

.sg-tool-panel {
  animation: sgFadeIn .12s ease;
}

@keyframes sgFadeIn {
  from { opacity: .65; transform: translateY(2px); }
  to { opacity: 1; transform: translateY(0); }
}

.sg-nav-link {
  border-radius: 12px;
  padding: .5rem .75rem;
  color: rgba(255,255,255,.9) !important;
}

.sg-nav-link:hover {
  background: rgba(255,255,255,.12);
}

.sg-nav-link.active {
  background: rgba(255,255,255,.18);
  color: #fff !important;
}

.sg-container {
  max-width: 1120px;
}

.sg-card {
  border: 1px solid var(--sg-border);
  border-radius: var(--sg-radius);
  background: var(--sg-surface);
  box-shadow: var(--sg-shadow-sm);
}

.sg-card .card-img-top {
  border-top-left-radius: var(--sg-radius);
  border-top-right-radius: var(--sg-radius);
}

.sg-pagehead {
  border-radius: 22px;
  border: 1px solid var(--sg-border);
  background:
    radial-gradient(1000px circle at 12% 10%, rgba(109, 40, 217, .10), transparent 55%),
    radial-gradient(700px circle at 95% 20%, rgba(14, 165, 233, .08), transparent 55%),
    rgba(255,255,255,.75);
  box-shadow: var(--sg-shadow-sm);
  backdrop-filter: blur(10px) saturate(140%);
}

.sg-pageicon {
  width: 44px;
  height: 44px;
  border-radius: 16px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, rgba(109, 40, 217, .16), rgba(14, 165, 233, .14));
  border: 1px solid rgba(15, 23, 42, 0.10);
}

.sg-card-hover {
  transition: transform .15s ease, box-shadow .15s ease;
}

.sg-card-hover:hover {
  transform: translateY(-2px);
  box-shadow: var(--sg-shadow);
}

.sg-hero {
  border-radius: 22px;
  border: 1px solid var(--sg-border);
  background:
    radial-gradient(1200px circle at 10% 10%, rgba(109, 40, 217, .18), transparent 55%),
    radial-gradient(900px circle at 95% 20%, rgba(14, 165, 233, .12), transparent 50%),
    #0b1220;
  color: rgba(255,255,255,.92);
  box-shadow: var(--sg-shadow);
}

.sg-hero .sg-hero-muted {
  color: rgba(255,255,255,.70);
}

.btn-primary.sg-btn {
  background: linear-gradient(135deg, var(--sg-brand), var(--sg-brand-2));
  border: 0;
  box-shadow: 0 10px 22px rgba(109, 40, 217, .18);
}

.btn,
.form-control,
.form-select,
.input-group-text {
  border-radius: var(--sg-radius-sm);
}

.form-control,
.form-select {
  border-color: rgba(15, 23, 42, 0.14);
  background: rgba(255,255,255,.92);
}

.form-control:focus,
.form-select:focus {
  border-color: rgba(109, 40, 217, 0.40);
  box-shadow: 0 0 0 .25rem rgba(109, 40, 217, .16);
}

.btn-primary.sg-btn:hover {
  filter: brightness(1.02);
}

.sg-kpi {
  display: inline-flex;
  align-items: center;
  gap: .5rem;
  padding: .35rem .6rem;
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,.18);
  background: rgba(255,255,255,.08);
  font-size: .875rem;
}

.table.sg-table {
  border-collapse: separate;
  border-spacing: 0;
  overflow: hidden;
  border-radius: 16px;
}

.table.sg-table thead th {
  background: rgba(15, 23, 42, 0.03);
  border-bottom: 1px solid var(--sg-border);
}

.table.sg-table tbody tr:hover td {
  background: rgba(109, 40, 217, 0.04);
}

.sg-avatar {
  width: 44px;
  height: 44px;
  border-radius: 16px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  letter-spacing: .2px;
  color: rgba(255,255,255,.95);
  background: linear-gradient(135deg, rgba(109, 40, 217, .92), rgba(14, 165, 233, .82));
  box-shadow: 0 10px 22px rgba(15, 23, 42, 0.16);
  overflow: hidden;
}

.sg-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.sg-copy {
  cursor: pointer;
}

.sg-copy[data-copied="1"] {
  outline: 2px solid rgba(34, 197, 94, .35);
}

.sg-muted {
  color: var(--sg-muted);
}

.sg-elements-list {
  display: grid;
  gap: 10px;
}

.sg-elements-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px;
  border: 1px solid rgba(15, 23, 42, 0.10);
  border-radius: 16px;
  background: rgba(248, 250, 252, 0.95);
}

.sg-elements-item.active {
  border-color: rgba(109, 40, 217, 0.35);
  box-shadow: 0 12px 28px rgba(15, 23, 42, 0.08);
}

.sg-elements-main {
  min-width: 0;
}

.sg-elements-title {
  font-weight: 600;
  color: #0f172a;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sg-elements-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 4px;
}

.sg-elements-tag {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.07);
  color: #334155;
  font-size: .72rem;
}

.sg-elements-tag.warn {
  background: rgba(220, 38, 38, 0.12);
  color: #991b1b;
}

.sg-elements-actions {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.sg-editor-layout {
  align-items: start;
}

.sg-editor-sidebar-card,
.sg-editor-stage-card,
.sg-editor-elements-card {
  overflow: hidden;
  background:
    linear-gradient(180deg, rgba(255,255,255,.96), rgba(248,250,252,.98));
}

.sg-editor-sidebar-card {
  position: sticky;
  top: 84px;
  max-height: calc(100vh - 108px);
}

.sg-editor-section + .sg-editor-section {
  margin-top: 1rem;
}

.sg-editor-section-title {
  font-weight: 700;
  font-size: .92rem;
  letter-spacing: .02em;
  color: #0f172a;
  margin-bottom: .75rem;
}

.sg-editor-subcard {
  padding: 14px;
  border-radius: 18px;
  border: 1px solid rgba(15, 23, 42, 0.08);
  background:
    linear-gradient(180deg, rgba(255,255,255,.95), rgba(248,250,252,.88));
  box-shadow: inset 0 1px 0 rgba(255,255,255,.7);
}

.sg-editor-subcard .row.g-2 {
  --bs-gutter-x: .55rem;
  --bs-gutter-y: .45rem;
}

.sg-editor-subcard .form-label,
.sg-editor-subcard .form-label-sm {
  margin-bottom: .2rem;
}

.sg-editor-subcard .form-control-sm,
.sg-editor-subcard .form-select-sm {
  min-height: calc(1.5em + .45rem + 2px);
  padding-top: .22rem;
  padding-bottom: .22rem;
}

.sg-editor-subcard .btn-sm,
.sg-editor-subcard .btn-group-sm > .btn {
  padding-top: .28rem;
  padding-bottom: .28rem;
}

.sg-editor-stage-card .p-3,
.sg-editor-elements-card .p-3,
.sg-editor-sidebar-card .p-3 {
  padding: 1.25rem !important;
}

.sg-editor-sidebar-card .p-3 {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  max-height: calc(100vh - 108px);
  overflow: auto;
}

.sg-editor-section-content {
  order: 2;
}

.sg-editor-section-inspector {
  order: 1;
}

.sg-editor-section-inspector .sg-editor-subcard {
  position: sticky;
  top: 0;
  z-index: 2;
  box-shadow:
    0 18px 38px rgba(15, 23, 42, 0.08),
    inset 0 1px 0 rgba(255,255,255,.7);
}

.sg-editor-section-style {
  display: none;
}

.sg-editor-stage-card .sg-stage {
  border-radius: 24px;
  border: 1px solid rgba(15, 23, 42, 0.10);
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,.65),
    0 16px 40px rgba(15, 23, 42, 0.08);
  background:
    linear-gradient(180deg, rgba(255,255,255,.98), rgba(248,250,252,.96));
}

.sg-canvas-toolbar {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
  min-height: 48px;
  padding: 7px 8px;
  border-radius: 10px;
  border: 1px solid rgba(15, 23, 42, 0.10);
  background:
    linear-gradient(180deg, rgba(255,255,255,.98), rgba(248,250,252,.96));
  box-shadow:
    0 10px 22px rgba(15, 23, 42, 0.08),
    inset 0 1px 0 rgba(255,255,255,.85);
}

.sg-canvas-toolbar .form-control-sm,
.sg-canvas-toolbar .form-select-sm,
.sg-canvas-toolbar .btn-sm {
  min-height: 30px;
  height: 30px;
  border-radius: 7px;
  font-size: .78rem;
}

.sg-toolbar-section {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding-right: 7px;
  margin-right: 2px;
  border-right: 1px solid rgba(15, 23, 42, 0.11);
}

.sg-toolbar-section.is-hidden {
  display: none;
}

.sg-toolbar-chip {
  height: 30px;
  display: inline-flex;
  align-items: center;
  padding: 0 10px;
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.05);
  color: #334155;
  font-size: .76rem;
  font-weight: 700;
  white-space: nowrap;
}

.sg-toolbar-font {
  width: 142px;
}

.sg-stepper {
  display: inline-flex;
  align-items: center;
}

.sg-stepper .btn {
  width: 30px;
  padding-inline: 0;
}

.sg-stepper .btn:first-child {
  border-top-right-radius: 0;
  border-bottom-right-radius: 0;
}

.sg-stepper .btn:last-child {
  border-top-left-radius: 0;
  border-bottom-left-radius: 0;
}

.sg-stepper input {
  width: 58px;
  border-radius: 0;
  text-align: center;
}

.sg-icon-only {
  width: 30px;
  padding-inline: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.sg-color-tool {
  width: 30px;
  height: 30px;
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 7px;
  border: 1px solid rgba(15, 23, 42, 0.14);
  background: rgba(255,255,255,.94);
  color: #0f172a;
  overflow: hidden;
  cursor: pointer;
}

.sg-color-tool input {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  cursor: pointer;
}

.sg-color-tool::after {
  content: "";
  position: absolute;
  left: 6px;
  right: 6px;
  bottom: 4px;
  height: 3px;
  border-radius: 999px;
  background: var(--sg-tool-color, #1f6feb);
}

.sg-mini-number {
  width: 54px;
  text-align: center;
}

.sg-tiny-number {
  width: 46px;
  padding-inline: 4px;
}

.sg-mini-range {
  width: 76px;
  height: 30px;
  padding: 0;
}

.sg-toolbar-spacer {
  flex: 1 1 auto;
  min-width: 8px;
}

.sg-canvas-toolbar .btn.active {
  color: #fff;
  border-color: rgba(37, 99, 235, .88);
  background: #2563eb;
  box-shadow: 0 8px 16px rgba(37, 99, 235, .18);
}

.sg-toolbar-sep {
  width: 1px;
  height: 26px;
  background: rgba(15, 23, 42, 0.12);
  margin-inline: 2px;
}

.sg-editor-stage-card {
  position: sticky;
  top: 84px;
}

.sg-editor-elements-card .sg-elements-list {
  max-height: 280px;
  overflow: auto;
  padding-right: 4px;
}

.sg-editor-sidebar-card .sg-tool-panel {
  padding: 14px;
  border-radius: 18px;
  border: 1px solid rgba(15, 23, 42, 0.08);
  background: rgba(255,255,255,.70);
}

.sg-editor-sidebar-card .sg-tool-panel.d-none {
  display: none !important;
}

@media (max-width: 1199.98px) {
  .sg-editor-sidebar-card {
    position: static;
    top: auto;
    max-height: none;
  }

  .sg-editor-sidebar-card .p-3 {
    max-height: none;
    overflow: visible;
  }

  .sg-editor-section-inspector .sg-editor-subcard,
  .sg-editor-stage-card {
    position: static;
    top: auto;
  }

  .sg-media-sidebar-card {
    position: static;
    top: auto;
  }
}

.auth-body {
  min-height: 100vh;
  background:
    radial-gradient(1200px circle at 10% -10%, rgba(109, 40, 217, .18), transparent 48%),
    radial-gradient(900px circle at 95% 10%, rgba(14, 165, 233, .14), transparent 42%),
    #0b1220;
  color: rgba(255,255,255,.9);
}

.auth-card {
  background: rgba(255,255,255,.92);
  color: var(--sg-text);
  border-radius: 22px;
  border: 1px solid rgba(255,255,255,.25);
  box-shadow: 0 18px 55px rgba(0,0,0,.35);
}

.auth-brand {
  display: inline-flex;
  align-items: center;
  gap: .5rem;
  font-weight: 800;
  letter-spacing: .2px;
}

/* ═══════════════════════════════════════════════════════════════
   FULL-VIEWPORT SLIDE EDITOR
   ═══════════════════════════════════════════════════════════════ */

body.sg-editor-body {
    margin: 0;
    padding: 0;
    overflow: hidden;
    height: 100vh;
    display: flex;
    flex-direction: column;
    background: #0d1117;
    font-family: var(--sg-font, Inter, Arial, sans-serif);
    color: var(--sg-text, #0f172a);
}

/* ── Top bar ─────────────────────────────────────────────────── */
.sg-ed-topbar {
    height: 52px;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 0 10px;
    background: #0b1220;
    border-bottom: 1px solid rgba(255,255,255,.08);
    z-index: 100;
}

.sg-ed-topbar-left {
    display: flex;
    align-items: center;
    gap: 8px;
    flex: 0 0 auto;
    min-width: 0;
}

.sg-ed-back {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px; height: 32px;
    border-radius: 9px;
    color: rgba(255,255,255,.70);
    text-decoration: none;
    background: rgba(255,255,255,.08);
    border: 1px solid rgba(255,255,255,.11);
    transition: background .12s, color .12s;
    flex-shrink: 0;
    font-size: .9rem;
}
.sg-ed-back:hover { background: rgba(255,255,255,.14); color: #fff; }

.sg-ed-title {
    background: transparent;
    border: 1px solid transparent;
    border-radius: 8px;
    color: rgba(255,255,255,.90);
    font-weight: 600;
    font-size: .875rem;
    padding: 4px 8px;
    min-width: 0;
    max-width: 200px;
    transition: border-color .12s, background .12s;
}
.sg-ed-title:hover  { border-color: rgba(255,255,255,.16); }
.sg-ed-title:focus  { outline: none; border-color: rgba(109,40,217,.55); background: rgba(255,255,255,.05); color: #fff; }

.sg-ed-topbar-tools {
    display: flex;
    align-items: center;
    gap: 4px;
    flex: 1;
    justify-content: center;
}

.sg-ed-toolbtn {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 5px 11px;
    border-radius: 9px;
    border: 1px solid rgba(255,255,255,.13);
    background: rgba(255,255,255,.07);
    color: rgba(255,255,255,.75);
    font-size: .78rem;
    font-weight: 600;
    line-height: 1;
    cursor: pointer;
    transition: background .12s, color .12s, border-color .12s;
}
.sg-ed-toolbtn .bi { font-size: .88rem; }
.sg-ed-toolbtn:hover  { background: rgba(255,255,255,.13); color: #fff; border-color: rgba(255,255,255,.20); }
.sg-ed-toolbtn.active {
    background: rgba(109,40,217,.35);
    border-color: rgba(109,40,217,.55);
    color: #fff;
    box-shadow: 0 0 0 2px rgba(109,40,217,.20);
}

.sg-ed-topbar-right {
    display: flex;
    align-items: center;
    gap: 5px;
    flex: 0 0 auto;
}

.sg-ed-sep {
    width: 1px;
    height: 22px;
    background: rgba(255,255,255,.12);
    margin-inline: 2px;
}

.sg-ed-icon-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 30px; height: 30px;
    border-radius: 8px;
    border: 1px solid rgba(255,255,255,.12);
    background: rgba(255,255,255,.06);
    color: rgba(255,255,255,.72);
    cursor: pointer;
    font-size: .84rem;
    transition: background .12s, color .12s;
}
.sg-ed-icon-btn:hover    { background: rgba(255,255,255,.13); color: #fff; }
.sg-ed-icon-btn:disabled { opacity: .32; cursor: default; pointer-events: none; }

/* Bg colour picker */
.sg-ed-bg-label {
    position: relative;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 5px 9px;
    border-radius: 9px;
    border: 1px solid rgba(255,255,255,.12);
    background: rgba(255,255,255,.06);
    color: rgba(255,255,255,.75);
    font-size: .76rem;
    font-weight: 600;
    cursor: pointer;
    overflow: hidden;
    transition: background .12s;
}
.sg-ed-bg-label:hover { background: rgba(255,255,255,.12); color: #fff; }
.sg-ed-bg-label input[type="color"] {
    position: absolute;
    inset: 0;
    opacity: 0;
    width: 100%;
    height: 100%;
    cursor: pointer;
    border: none;
    padding: 0;
}
.sg-ed-bg-swatch {
    width: 13px; height: 13px;
    border-radius: 4px;
    border: 1px solid rgba(255,255,255,.22);
    display: inline-block;
    background: #fff;
    flex-shrink: 0;
}

/* Duration input */
.sg-ed-dur-wrap {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 5px 8px;
    border-radius: 9px;
    border: 1px solid rgba(255,255,255,.12);
    background: rgba(255,255,255,.06);
    color: rgba(255,255,255,.75);
    font-size: .76rem;
    font-weight: 600;
    cursor: text;
}
.sg-ed-dur-input {
    width: 40px;
    background: transparent;
    border: none;
    color: rgba(255,255,255,.90);
    font-size: .8rem;
    font-weight: 700;
    text-align: center;
    padding: 0;
    -moz-appearance: textfield;
}
.sg-ed-dur-input::-webkit-inner-spin-button,
.sg-ed-dur-input::-webkit-outer-spin-button { -webkit-appearance: none; }
.sg-ed-dur-input:focus { outline: none; }

/* Template toggle */
.sg-ed-template-label {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 5px 9px;
    border-radius: 9px;
    border: 1px solid rgba(255,255,255,.12);
    background: rgba(255,255,255,.06);
    color: rgba(255,255,255,.68);
    font-size: .76rem;
    font-weight: 600;
    cursor: pointer;
    transition: background .12s, color .12s, border-color .12s;
}
.sg-ed-template-label:hover { background: rgba(255,255,255,.11); color: rgba(255,255,255,.90); }
.sg-ed-template-label input { display: none; }
.sg-ed-template-label:has(input:checked) {
    background: rgba(109,40,217,.22);
    border-color: rgba(109,40,217,.45);
    color: rgba(255,255,255,.92);
}

/* Save button */
.sg-ed-save-btn {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 6px 14px;
    border-radius: 9px;
    border: 0;
    background: linear-gradient(135deg, #6d28d9 0%, #0ea5e9 100%);
    color: #fff;
    font-weight: 700;
    font-size: .80rem;
    cursor: pointer;
    box-shadow: 0 6px 16px rgba(109,40,217,.30);
    transition: filter .12s, box-shadow .12s;
    white-space: nowrap;
}
.sg-ed-save-btn:hover {
    filter: brightness(1.07);
    box-shadow: 0 10px 22px rgba(109,40,217,.38);
}
.sg-ed-save-btn.is-dirty {
    animation: sg-save-pulse 2.2s ease-in-out infinite;
}
.sg-ed-save-btn.is-dirty::after {
    content: " ●";
    font-size: .55rem;
    vertical-align: 1px;
    opacity: .85;
}
@keyframes sg-save-pulse {
    0%, 100% { box-shadow: 0 6px 16px rgba(109,40,217,.30); }
    50%       { box-shadow: 0 6px 22px rgba(109,40,217,.65), 0 0 14px rgba(14,165,233,.45); }
}

/* ── Main editor layout ───────────────────────────────────────── */
.sg-ed-main {
    display: flex;
    flex: 1;
    min-height: 0;
    overflow: hidden;
}

/* ── Left panel ───────────────────────────────────────────────── */
.sg-ed-panel {
    width: 256px;
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    background: #f8fafc;
    border-right: 1px solid rgba(15,23,42,.10);
    overflow: hidden;
}

.sg-ed-panel-tabs {
    display: flex;
    border-bottom: 1px solid rgba(15,23,42,.08);
    background: #f1f5f9;
    flex-shrink: 0;
}

.sg-ed-ptab {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    padding: 8px 4px 6px;
    border: none;
    border-bottom: 2px solid transparent;
    background: transparent;
    color: #64748b;
    font-size: .65rem;
    font-weight: 600;
    cursor: pointer;
    transition: color .12s, border-color .12s, background .12s;
}
.sg-ed-ptab .bi { font-size: .95rem; }
.sg-ed-ptab:hover { color: #0f172a; background: rgba(15,23,42,.03); }
.sg-ed-ptab.active { color: #6d28d9; border-bottom-color: #6d28d9; background: rgba(109,40,217,.04); }

.sg-ed-panel-body {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    min-height: 0;
}

.sg-ed-panel-content {
    padding: 12px 11px;
}

.sg-ed-panel-title {
    font-size: .68rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .08em;
    color: #94a3b8;
    margin-bottom: 9px;
}

/* Text presets */
.sg-ed-text-presets {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.sg-ed-text-preset {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    padding: 10px 12px;
    border-radius: 12px;
    border: 1px solid rgba(15,23,42,.09);
    background: #fff;
    cursor: pointer;
    text-align: left;
    transition: border-color .12s, box-shadow .12s, transform .10s;
    box-shadow: 0 2px 8px rgba(15,23,42,.05);
}
.sg-ed-text-preset:hover {
    border-color: rgba(109,40,217,.28);
    box-shadow: 0 6px 18px rgba(109,40,217,.09);
    transform: translateY(-1px);
}
.sg-ed-preset-label { font-weight: 600; color: #0f172a; font-size: .84rem; }
.sg-ed-preset-h1 .sg-ed-preset-label { font-size: 1.05rem; }
.sg-ed-preset-h2 .sg-ed-preset-label { font-size: .92rem; }
.sg-ed-preset-size { font-size: .68rem; color: #94a3b8; font-weight: 500; }

.sg-ed-panel-hint {
    margin-top: 10px;
    padding: 7px 10px;
    border-radius: 9px;
    background: rgba(109,40,217,.06);
    color: #6d28d9;
    font-size: .70rem;
    font-weight: 500;
    text-align: center;
    line-height: 1.4;
}

/* Shape presets */
.sg-ed-shape-presets {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 7px;
}
.sg-ed-shape-preset {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 7px;
    padding: 14px 10px;
    border-radius: 12px;
    border: 1px solid rgba(15,23,42,.09);
    background: #fff;
    cursor: pointer;
    font-size: .75rem;
    font-weight: 600;
    color: #0f172a;
    transition: border-color .12s, box-shadow .12s, transform .10s;
    box-shadow: 0 2px 8px rgba(15,23,42,.05);
}
.sg-ed-shape-preset:hover {
    border-color: rgba(109,40,217,.28);
    box-shadow: 0 6px 18px rgba(109,40,217,.09);
    transform: translateY(-1px);
}
.sg-ed-shape-preset .bi { font-size: 1.4rem; color: #6d28d9; }

/* Elements list */
.sg-ed-elements-wrap {
    border-top: 1px solid rgba(15,23,42,.09);
    flex-shrink: 0;
    max-height: 220px;
    display: flex;
    flex-direction: column;
    background: #fff;
}
.sg-ed-elements-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 7px 11px;
    font-size: .67rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .08em;
    color: #94a3b8;
    background: #f8fafc;
    border-bottom: 1px solid rgba(15,23,42,.07);
    flex-shrink: 0;
}
.sg-ed-elements-body {
    overflow-y: auto;
    flex: 1;
    padding: 4px;
}

/* ── Canvas area ──────────────────────────────────────────────── */
.sg-ed-canvas-area {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    background: #111827;
    overflow: hidden;
}

/* Toolbar wrap (dark bg) */
.sg-ed-toolbar-wrap {
    flex-shrink: 0;
    padding: 7px 10px 0;
    background: #0d1929;
    border-bottom: 1px solid rgba(255,255,255,.06);
}

/* Canvas toolbar dark overrides */
.sg-ed-canvas-area .sg-canvas-toolbar {
    background: rgba(255,255,255,.05);
    border-color: rgba(255,255,255,.08);
    box-shadow: none;
    margin-bottom: 7px;
}
.sg-ed-canvas-area .sg-canvas-toolbar .form-control-sm,
.sg-ed-canvas-area .sg-canvas-toolbar .form-select-sm {
    background: rgba(255,255,255,.09);
    border-color: rgba(255,255,255,.14);
    color: rgba(255,255,255,.88);
}
.sg-ed-canvas-area .sg-canvas-toolbar .form-control-sm::placeholder { color: rgba(255,255,255,.35); }
.sg-ed-canvas-area .sg-canvas-toolbar .btn-outline-secondary {
    border-color: rgba(255,255,255,.16);
    color: rgba(255,255,255,.76);
    background: transparent;
}
.sg-ed-canvas-area .sg-canvas-toolbar .btn-outline-secondary:hover {
    background: rgba(255,255,255,.11);
    color: #fff;
    border-color: rgba(255,255,255,.24);
}
.sg-ed-canvas-area .sg-canvas-toolbar .btn-outline-secondary.active,
.sg-ed-canvas-area .sg-canvas-toolbar .btn-outline-secondary:active {
    background: rgba(109,40,217,.30);
    border-color: rgba(109,40,217,.50);
    color: #fff;
}
.sg-ed-canvas-area .sg-canvas-toolbar .btn-outline-danger {
    border-color: rgba(239,68,68,.40);
    color: rgba(239,68,68,.88);
    background: transparent;
}
.sg-ed-canvas-area .sg-canvas-toolbar .btn-outline-danger:hover {
    background: rgba(239,68,68,.14);
    color: #ef4444;
}
.sg-ed-canvas-area .sg-canvas-toolbar .sg-toolbar-section {
    border-right-color: rgba(255,255,255,.08);
}
.sg-ed-canvas-area .sg-canvas-toolbar .sg-toolbar-chip {
    background: rgba(255,255,255,.07);
    color: rgba(255,255,255,.55);
}
.sg-ed-canvas-area .sg-canvas-toolbar .sg-color-tool {
    background: rgba(255,255,255,.09);
    border-color: rgba(255,255,255,.14);
    color: rgba(255,255,255,.76);
}

/* ── Align bar ────────────────────────────────────────────────── */
.sg-ed-align-bar {
    display: none;
    align-items: center;
    gap: 3px;
    padding: 4px 10px 5px;
    background: #0d1929;
    border-bottom: 1px solid rgba(255,255,255,.05);
}
.sg-ed-align-bar.is-visible { display: flex; }

.sg-ed-align-label {
    font-size: .64rem;
    color: rgba(255,255,255,.35);
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .09em;
    margin-right: 3px;
}

.sg-ed-align-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 26px; height: 26px;
    border-radius: 7px;
    border: 1px solid rgba(255,255,255,.12);
    background: rgba(255,255,255,.05);
    color: rgba(255,255,255,.65);
    cursor: pointer;
    font-size: .80rem;
    transition: background .12s, color .12s;
}
.sg-ed-align-btn:hover { background: rgba(255,255,255,.13); color: #fff; border-color: rgba(255,255,255,.22); }

.sg-ed-align-sep {
    width: 1px; height: 16px;
    background: rgba(255,255,255,.10);
    margin-inline: 3px;
}

/* ── Stage outer container ────────────────────────────────────── */
.sg-ed-stage-outer {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    padding: 14px;
    min-height: 0;
}

.sg-ed-stage-inner {
    position: relative;
    flex-shrink: 0;
    border-radius: 6px;
    overflow: hidden;
    box-shadow:
        0 0 0 1px rgba(255,255,255,.08),
        0 24px 60px rgba(0,0,0,.55);
}

.sg-ed-stage-inner #stage-wrap,
.sg-ed-stage-inner #stage-container {
    width: 100%;
    height: 100%;
}

/* Stage-inner dimensions are set programmatically by fitStageIntoParent() */

/* Canvas tip text */
.sg-ed-canvas-tip {
    flex-shrink: 0;
    text-align: center;
    color: rgba(255,255,255,.25);
    font-size: .68rem;
    padding: 3px 0 5px;
}
