@keyframes nudge {
  0% {
    transform: rotate(-2deg);
  }

  33% {
    transform: rotate(2deg);
  }

  66% {
    transform: rotate(-2deg);
  }
}
@keyframes loadingAnimation {
  0%{
    transform: rotate(0deg);
  }
  100%{
    transform: rotate(360deg);
  }
}

body{
  font-size: 14px;
  background-color: #5d5d5d;
  overflow: hidden;
  height: 100vh;
}

.tooltip{
  font-size: 12px;
}

h1{
  letter-spacing: -1px;
  z-index: -1;
  text-shadow: 0 3px 4px rgba(0,0,0,.1);
}

h1,
h2,
h3,
h4,
h5,
h6{
  font-weight: 700;
  margin: 0 0 20px;
  color: #fff;
}

label{
  font-weight: 500;
  color: #fff;
}

h5,
h6{
  font-weight: 600;
}

a{
  color: #333;
  transition: .3s;
}
a:hover{
  color: #ffb65c;
  text-decoration: none;
}

.mfp-iframe-holder .mfp-content{
  max-width: 1400px;
}
.mfp-iframe html,
.mfp-iframe body{
  min-height: 100%;
}

.form-group{
  margin-bottom: 20px;
}

input:focus,
select:focus{
  outline: none;
}

input[type="text"],
input[type="search"],
.select2-container--default .select2-selection--single,
.form-control{
  background: transparent;
  border: none;
  border-radius: 25px;
  backdrop-filter: blur(5px);
  box-shadow: 4px 4px 60px rgba(0,0,0,0.2);
  color: #fff;
  height: auto;
  padding: .75rem;
  font-size: 13px;
  transition: all 0.2s ease-in-out;
  text-transform: capitalize;
}
select,
select.form-control,
select:focus,
select.form-control:focus{
  -webkit-appearance: none;
  -moz-appearance: none;
  background: transparent;
  background-image: url("data:image/svg+xml;utf8,<svg fill='white' height='24' viewBox='0 0 24 24' width='24' xmlns='http://www.w3.org/2000/svg'><path d='M7 10l5 5 5-5z'/><path d='M0 0h24v24H0z' fill='none'/></svg>");
  background-repeat: no-repeat;
  background-position-x: 95%;
  background-position-y: 14px;
}

.select2-container--default .select2-selection--single:focus,
.select2-container:focus,
select.form-control:focus{
  color: #495057;
  outline: none;
  background: rgba(255,255,255,0.1);
  box-shadow: 4px 4px 60px 8px rgba(0,0,0,0.2);
}
.select2-container--default .select2-selection--single .select2-selection__rendered{
  color: #fff;
  text-transform: capitalize;
}

.select2-dropdown{
  background: rgba( 255, 255, 255, 0.75 );
  box-shadow: 0 8px 32px 0 rgb(132 133 146 / 17%);
  backdrop-filter: blur( 4px );
  -webkit-backdrop-filter: blur( 4px );
  border-radius: 10px;
}
.select2-container--default .select2-selection--single .select2-selection__arrow{
  height: 46px;
  right: 10px;
}
.select2-results__option{
  border-radius: 25px;
  padding: 10px;
  margin: 5px;
}
.select2-container--default .select2-results__option--highlighted[aria-selected]{
  background-color: rgba(255,255,255,.8);
  color: #333;
}
.select2-container--default .select2-results__option[aria-selected=true]{

}
.select2-container--default .select2-search--dropdown .select2-search__field,
.select2-search--dropdown .select2-search__field{
  padding: .75rem;
  border: 0;
}
.select2-container--default .select2-search--dropdown .select2-search__field,
.select2-container--default .select2-search--dropdown .select2-search__field:focus{
  color: #333;
}

.studio_btn:focus{
  outline: none;
}
.form-control:focus{
  background: rgba(255,255,255,0.1);
  box-shadow: 4px 4px 60px 8px rgba(0,0,0,0.2);
  outline: none;
  color: #fff;
}

.form-control::placeholder {
  font-weight: 400;
  color: #fff;
  text-shadow: 2px 2px 4px rgba(0,0,0,0.4);
}

.form-control.error{
  border-color: #ffa4a4;
  box-shadow: 0 3px 24px rgba(255,0,0,.04);
  animation-name: nudge;
  animation-duration: 1s;
  animation-iteration-count: 1;
}

.studio_blockable{
  position: relative;
}
.studio_blockable.blocked{
  pointer-events: none;
}

.studio_blockable::after,
.studio_blockable::before{
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 100px;
  height: 100px;
  margin-left: -50px;
  margin-top: -50px;
  z-index: 4;
  border-radius: 10px;
  background-color: rgba(0,0,0,.4);
  display: none;
}

.studio_blockable::after{
  width: 30px;
  height: 30px;
  margin-left: -15px;
  margin-top: -15px;
  background-color: #5090ef;
}

.studio_blockable.blocked::after,
.studio_blockable.blocked::before{
  display: block;
}

.studio_blockable.blocked::after{
  animation-name: loadingAnimation;
  animation-iteration-count: infinite;
  animation-duration: 2s;
  animation-timing-function: linear;
}

.studio_btn{
  background: #5090ef;
  padding: 1em;
  border: none;
  border-radius: 50px;
  backdrop-filter: blur(5px);
  box-shadow: 4px 4px 60px rgba(0,0,0,0.2);
  color: #fff;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease-in-out;
  text-shadow: 2px 2px 4px rgba(0,0,0,0.2);
}
.studio_btn:hover{
  background: rgb(100 123 241 / 48%);
  box-shadow: 4px 4px 60px 8px rgba(0,0,0,0.2);
}

.studio_btn.success{
  background: #6ede86;
}
.studio_btn.success:hover{
  background: rgb(99 228 115 / 48%);
}
.studio_btn.danger{
  background: #ff7c7c;
}
.studio_btn.danger:hover{
  background: rgb(255 62 62 / 48%);
}
.studio_btn.light{
  background: transparent;
  backdrop-filter: blur(5px);
  box-shadow: 4px 4px 60px rgba(0,0,0,0.2);
}
.studio_btn.light:hover{
  background: rgba(255,255,255,0.1);
  box-shadow: 4px 4px 60px 8px rgba(0,0,0,0.2);
  outline: none;
}
.studio_btn.light.active{
  background: #5090ef;
}

.input-group-append .studio_btn{
  border-radius: 0 50px 50px 0;
  width: 40px;
}

.section{
  padding: 60px 0;
}

/* Test */
.studio_header{
  margin-bottom: 20px;
}
.studio_header ul{
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  align-items: center;
}

.studio_header ul li a{
  padding: 10px;
  display: block;
  text-align: center;
  font-weight: 600;
  min-width: 80px;
  border-radius: 10px;
  color: #fff;
}
.studio_header ul li a:hover{
  background-color: rgba( 255, 255, 255, 0.25 );
}
.studio_header ul li a.active{
  background-color: #ffb65c;
}

.studio_header ul li + li{
  margin-left: 10px;
}

input[type="file"] {
  display: none;
}
.studio_input-file{
  background-color: rgba( 255, 255, 255, 0.25 );
  border-radius: 10px;
  display: inline-block;
  margin: 0;
  padding: 10px 20px;
  cursor: pointer;
  transition: .3s;
}
.studio_input-file:focus,
.studio_input-file:hover{
  background-color: #ffb65c;
}
.studio_input-file i{
  margin-right: 5px;
}
.studio_file-test{
  position: relative;
  overflow: hidden;
}
.studio_file-test span{
  font-weight: 600;
  font-size: 16px;
  text-transform: uppercase;
  margin-bottom: 10px;
  display: block;
}
.studio_file-test > i{
  opacity: 0.4;
  margin-right: 5px;
}
.studio_file-test .studio_file-test-content{
  margin-top: 5px;
}
.studio_file-test + .studio_file-test{
  margin-top: 10px;
}
.studio_file-test .studio_file-test-content p{
  margin: 0;
  font-size: 12px;
}
.studio_file-test .studio_file-test-content p + p{
  margin-top: 5px;
}
.studio_file-test::before{
  position: absolute;
  top: -30px;
  right: -30px;
  font-size: 80px;
}
.studio_file-test.error::before,
.studio_file-test.success::before{
  content: "\f00c";
  font-family: "Font Awesome 5 Pro";
  font-weight: 400;
  -webkit-font-smoothing: antialiased;
  display: inline-block;
  font-style: normal;
  font-variant: normal;
  text-rendering: auto;
  color: #6ede86;
  line-height: 1;
  background-color: #ecfff1;
  border-radius: 50%;
  width: 120px;
  height: 120px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.studio_file-test.error::before{
  content: "\f00d";
  background-color: #ffecec;
  color: #e45555;
}

.studio_file-test > p{
  margin: 10px 0 0;
  font-weight: 600;
  color: #e45555;
}
.studio_file-test.success > p{
  color: #6ede86;
}

#section-test-form{
  display: flex;
  align-items: center;
  justify-content: space-between;
}
#section-test-form .studio_btn{
  display: none;
}

#section-test-uploaded-files .studio_card + .studio_card{
  margin-top: 20px;
}

.count-files{
  margin: 20px 0;
}

/* Vault */
.studio_categories{
  padding: 20px;
  background: rgba( 255, 255, 255, 0.25 );
  box-shadow: 0 8px 32px 0 rgb(132 133 146 / 17%);
  backdrop-filter: blur( 4px );
  -webkit-backdrop-filter: blur( 4px );
  border-radius: 10px;
  cursor: grab;
  position: relative;
}
.studio_categories + .studio_categories{
  margin-top: 20px;
}
.studio_categories h4 span{
  font-weight: 400;
  font-size: 12px;
}
.studio_categories h4 i{
  font-size: 13px;
}

.studio_category-sections span{
  display: inline-block;
  padding: 10px;
  cursor: pointer;
  transition: .3s;
  font-size: 13px;
  font-weight: 600;
  margin: 0 2.5px 5px 0;
  background: rgba( 255, 255, 255, 0.50 );
  box-shadow: 0 8px 32px 0 rgba( 31, 38, 135, 0.10 );
  backdrop-filter: blur( 4px );
  -webkit-backdrop-filter: blur( 4px );
  border-radius: 10px;
}

.studio_category-sections span a{
  margin-left: 5px;
}

.studio_category-sections span:hover{
  background-color: #f7f7f7;
}
.studio_category-sections span.selected{
  background-color: #ffb65c;
}
.studio_category-sections span.selected,
.studio_category-sections span.selected a{
  color: #fff;
}

.studio_categories .studio_category-disable{
  position: absolute;
  top: 20px;
  right: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  display: block;
  padding: 10px;
  background: #ff7c7c;
  -webkit-backdrop-filter: blur( 10.0px );
  border-radius: 10px;
  color: #fff;
  cursor: pointer;
  transition: .3s;
  border-radius: 10px;
}

.studio_categories.disabled .studio_category-disable,
.studio_categories .studio_category-disable:hover{
  background-color: #ff3333;
  color: #fff;
}
.studio_categories.disabled{
  background: rgba( 255, 51, 51, 0.60 );
  box-shadow: 0 8px 32px 0 rgb(132 133 146 / 17%);
  backdrop-filter: blur( 10.0px );
  -webkit-backdrop-filter: blur( 10.0px );
  border-radius: 10px;
  cursor: not-allowed;
}

.studio_categories.disabled .studio_category-sections span{
  pointer-events: none;
}

.studio_card{
  padding: 20px;
  background: rgba( 255, 255, 255, 0.25 );
  box-shadow: 0 8px 32px 0 rgb(132 133 146 / 17%);
  border-radius: 10px;
}
.studio_card + .studio_card{
  margin-top: 30px;
}

.studio_sticky{
  position: sticky;
  top: 20px;
}

.studio_section-added .dd-content .studio_section-added-controls{
  display: inline-flex;
  position: absolute;
  top: 50%;
  right: 10px;
  transform: translateY(-50%);
}
.studio_section-added p{
  margin: 0;
  display: block;
  width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.studio_section-added a{
  margin-left: 5px;
}

.dd {
  position: relative;
  display: block;
  margin: 0;
  padding: 0;
  max-width: 600px;
  list-style: none;
  font-size: 13px;
  line-height: 20px;
}

.dd-list {
  display: block;
  position: relative;
  margin: 0;
  padding: 0;
  list-style: none;
}

.dd-list .dd-list {
  padding-left: 10px;
}

.dd-collapsed .dd-list {
  display: none;
}

.dd-item, .dd-empty, .dd-placeholder {
  display: block;
  position: relative;
  margin: 0;
  padding: 0;
  min-height: 20px;
  font-size: 12px;
  line-height: 20px;
}

.dd-content, .dd-handle {
  display: block;
  position: relative;
  height: 40px;
  margin: 5px 0;
  padding: 9px 15px;
  color: #4a5779;
  text-decoration: none;
  font-weight: 500;
  border: 0;
  background: #fafafa;
  -webkit-border-radius: 3px;
  border-radius: 10px;
  box-sizing: border-box;
  -moz-box-sizing: border-box;
}

.dd-content:hover {
  background: #fff;
}

.dd-item>button {
  display: block;
  position: relative;
  cursor: pointer;
  float: left;
  width: 25px;
  height: 40px;
  margin: 0;
  padding: 0;
  text-indent: 100%;
  white-space: nowrap;
  overflow: hidden;
  border: 0;
  background: transparent;
  font-size: 12px;
  line-height: 1;
  text-align: center;
  font-weight: bold;
}

.dd-item>button:before {
  content: '+';
  display: block;
  position: absolute;
  width: 100%;
  text-align: center;
  text-indent: 0;
}

.dd-item>button[data-action="collapse"]:before {
  content: '-';
}

.dd-placeholder {
  margin: 5px 0;
  padding: 0;
  min-height: 40px;
  backdrop-filter: blur( 10.0px );
  box-shadow: 0 8px 32px 0 rgb(132 133 146 / 17%);
  visibility: visible;
  background: rgba( 255, 255, 255, 0.05 );
  border-radius: 10px;
}

.dd-empty {
  margin: 5px 0;
  padding: 0;
  min-height: 40px;
  background: #f2fbff;
  border: 1px dashed rgba(0, 0, 0, 0.1);
  box-sizing: border-box;
  -moz-box-sizing: border-box;
  border: 1px dashed #bbb;
  min-height: 100px;
  background-color: #e5e5e5;
  background-image: -webkit-linear-gradient(45deg, #fff 25%, transparent 25%, transparent 75%, #fff 75%, #fff), -webkit-linear-gradient(45deg, #fff 25%, transparent 25%, transparent 75%, #fff 75%, #fff);
  background-image: -moz-linear-gradient(45deg, #fff 25%, transparent 25%, transparent 75%, #fff 75%, #fff), -moz-linear-gradient(45deg, #fff 25%, transparent 25%, transparent 75%, #fff 75%, #fff);
  background-image: linear-gradient(45deg, #fff 25%, transparent 25%, transparent 75%, #fff 75%, #fff), linear-gradient(45deg, #fff 25%, transparent 25%, transparent 75%, #fff 75%, #fff);
  background-size: 60px 60px;
  background-position: 0 0, 30px 30px;
}

.dd-dragel {
  position: absolute;
  pointer-events: none;
  z-index: 9999;
}

.dd-dragel>.dd-item .dd-handle {
  margin-top: 0;
}

.dd-dragel .dd-handle {
  -webkit-box-shadow: 2px 4px 6px 0 rgba(0, 0, 0, 0.1);
  box-shadow: 2px 4px 6px 0 rgba(0, 0, 0, 0.1);
}

.dd-handle.dd-burger-handle {
  position: absolute;
  margin: 0;
  left: 0;
  z-index: 3;
  top: 0;
  cursor: pointer;
  width: 40px;
  height: 40px;
  padding: 8px;
  text-indent: 100%;
  white-space: nowrap;
  overflow: hidden;
  background: #5090ef;
  border: 0;
  border-top-right-radius: 0;
  border-bottom-right-radius: 0;
  display: flex;
  align-items: center;
  transition: .3s;
  justify-content: center;
}

.dd-handle.dd-burger-handle::before {
  content: "\f142";
  font-family: "Font Awesome 5 Pro";
  -webkit-font-smoothing: antialiased;
  display: inline-block;
  font-style: normal;
  font-variant: normal;
  text-rendering: auto;
  line-height: 1;
  display: block;
  left: 0;
  text-align: center;
  text-indent: 0;
  color: #fff;
  font-size: 14px;
}

.dd-handle.dd-burger-handle:hover {
  background: rgb(100 123 241 / 48%);
  box-shadow: 4px 4px 60px 8px rgba(0,0,0,0.2);
}

.dd-handle.dd-burger-handle+.dd-content {
  padding: 9px 50px;
}

.studio_template-item{
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.studio_template-item p{
  margin: 0;
}
.studio_template-item + .studio_template-item{
  margin-top: 10px;
}
.studio_template-item span{
  margin-left: 5px;
  transition: .3s;
  cursor: pointer;
}
.studio_template-item span:hover{
  color: #ffb65c;
}

.studio_collapse-trigger{
  position: relative;
  cursor: pointer;
  display: flex;
  align-items: center;
}
.studio_collapse-trigger::after{
  content: "\f078";
  font-family: "Font Awesome 5 Pro";
  -webkit-font-smoothing: antialiased;
  display: inline-block;
  font-style: normal;
  font-variant: normal;
  text-rendering: auto;
  line-height: 1;
  font-size: 12px;
  margin-left: auto;
  transition: .3s;
}

.studio_collapse-trigger.closed::after{
  transform: rotate(180deg);
}

.studio_search-controls{
  display: flex;
  align-items: center;
}

.studio_search-controls .form-group:first-child{
  flex: 1;
}
.studio_search-controls .form-group + .form-group{
  margin-left: 20px;
}
.studio_search-controls .form-group button{
  padding: 0;
  border-radius: 50%;
  width: 50px;
  height: 50px;
}

#result-area,
#templates-area,
.studio_templates-result,
.studio_pages-result{
  display: block;
  transition: .3s;
  font-size: 13px;
  font-weight: 600;
  margin: 0 0 20px;
}
#result-area p:last-child,
.studio_templates-result p:last-child,
.studio_pages-result p:last-child{
  margin-bottom: 0;
}

#result-area,
#templates-area{
  max-height: 200px;
  overflow-y: auto;
}

/* width */
#templates-area::-webkit-scrollbar,
#result-area::-webkit-scrollbar,
#pages-area::-webkit-scrollbar{
  width: 7px;
  border-radius: 25px;
}

/* Track */
#result-area::-webkit-scrollbar-track,
#templates-area::-webkit-scrollbar-track,
#pages-area::-webkit-scrollbar-track {
  background: #fff;
}

/* Handle */
#result-area::-webkit-scrollbar-thumb,
#templates-area::-webkit-scrollbar-thumb,
#pages-area::-webkit-scrollbar-thumb {
  background: #999;
}

/* Handle on hover */
#result-area::-webkit-scrollbar-thumb:hover,
#templates-area::-webkit-scrollbar-thumb:hover,
#pages-area::-webkit-scrollbar-thumb:hover {
  background: #555;
}

/* ── Niche Selector Row ──────────────────────────────── */
.studio_niche-selector {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 20px;
}

.studio_niche-card {
  flex: 1 0 calc(12.5% - 10px); /* up to 8 columns */
  min-width: 90px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 18px 10px;
  border-radius: 10px;
  cursor: pointer;
  background: rgba(255, 255, 255, 0.05);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.1);
  transition: all 0.2s ease-in-out;
  text-align: center;
}

.studio_niche-card i {
  font-size: 22px;
  color: #5090ef;
}

.studio_niche-card span {
  font-size: 12px;
  font-weight: 600;
  color: #fff;
  text-transform: capitalize;
  white-space: nowrap;
}

.studio_niche-card:hover {
  background: rgba(80, 144, 239, 0.15);
  border-color: rgba(80, 144, 239, 0.4);
  transform: translateY(-2px);
}

.studio_niche-card.active {
  background: rgba(80, 144, 239, 0.25);
  border-color: #5090ef;
  box-shadow: 0 0 16px rgba(80, 144, 239, 0.3);
}

/* ═══════════════════════════════════════════════════════════════
   APP SHELL LAYOUT  (index.php only — scoped via .studio_app-shell)
   ═══════════════════════════════════════════════════════════════ */

.studio_app-shell {
  display: flex;
  flex-direction: column;
  height: 100vh;
  overflow: hidden;
}

/* ── Topbar ───────────────────────────────────────────────────── */
.studio_topbar {
  height: 56px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 0 20px;
  background: rgba(255,255,255,0.10);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid rgba(255,255,255,0.12);
  z-index: 200;
}
.studio_topbar-brand {
  font-size: 17px;
  font-weight: 700;
  color: #fff;
  letter-spacing: .5px;
  white-space: nowrap;
}
.studio_topbar-nav { display: flex; gap: 6px; }
.studio_topbar-nav a {
  color: rgba(255,255,255,0.6);
  text-decoration: none;
  padding: 5px 14px;
  border-radius: 20px;
  font-size: 13px;
  transition: all 0.2s;
}
.studio_topbar-nav a.active,
.studio_topbar-nav a:hover {
  background: rgba(255,255,255,0.15);
  color: #fff;
}
.studio_topbar-meta {
  margin-left: auto;
  color: rgba(255,255,255,0.4);
  font-size: 12px;
  white-space: nowrap;
}

/* ── Shell Body ───────────────────────────────────────────────── */
.studio_shell-body {
  display: flex;
  flex: 1;
  overflow: hidden;
  min-height: 0;
}

/* ── Sidebar ──────────────────────────────────────────────────── */
.studio_sidebar {
  display: flex;
  flex-direction: row;
  flex-shrink: 0;
  height: 100%;
  background: rgba(255,255,255,0.04);
  border-right: 1px solid rgba(255,255,255,0.10);
}

/* Icon rail — always visible */
.studio_sidebar-rail {
  width: 64px;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 16px 0;
  gap: 4px;
  background: rgba(0,0,0,0.12);
  border-right: 1px solid rgba(255,255,255,0.07);
}
.studio_rail-icon {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  width: 48px;
  padding: 10px 4px;
  border: none;
  background: transparent;
  color: rgba(255,255,255,0.45);
  border-radius: 10px;
  cursor: pointer;
  transition: background 0.2s, color 0.2s;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: .3px;
}
.studio_rail-icon i { font-size: 17px; display: block; margin-bottom: 2px; }
.studio_rail-icon:hover  { background: rgba(255,255,255,0.10); color: #fff; }
.studio_rail-icon.active { background: rgba(80,144,239,0.25);  color: #5090ef; }

/* Expandable panel */
.studio_sidebar-panel {
  width: 260px;
  overflow-y: auto;
  overflow-x: hidden;
  background: rgba(255,255,255,0.06);
  transition: width 0.25s ease, opacity 0.2s;
  scrollbar-width: thin;
}
.studio_sidebar-panel.dna-expanded { width: 460px; } /* +200px when DNA mode is active */
.studio_sidebar.panel-closed .studio_sidebar-panel {
  width: 0;
  overflow: hidden;
  opacity: 0;
  pointer-events: none;
}

/* Panel content tabs */
.studio_panel-content { display: none; padding: 16px; }
.studio_panel-content.active { display: block; }

.studio_panel-title {
  font-size: 11px;
  font-weight: 700;
  color: rgba(255,255,255,0.35);
  text-transform: uppercase;
  letter-spacing: 1.2px;
  margin: 0 0 14px;
  padding-bottom: 8px;
  border-bottom: 1px solid rgba(255,255,255,0.10);
}

/* ── Center Canvas ────────────────────────────────────────────── */
.studio_canvas {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 20px 24px 32px;
  min-width: 0;
}

/* ── Right Drawer ─────────────────────────────────────────────── */
.studio_drawer {
  width: 280px;
  flex-shrink: 0;
  position: relative;
  display: flex;
  background: rgba(255,255,255,0.05);
  border-left: 1px solid rgba(255,255,255,0.10);
  transition: width 0.25s ease;
  overflow: visible;
}
.studio_drawer.collapsed { width: 0; }
.studio_drawer.collapsed .studio_drawer-inner { display: none; }

.studio_drawer-toggle {
  position: absolute;
  left: -20px;
  top: 50%;
  transform: translateY(-50%);
  width: 20px;
  height: 64px;
  background: rgba(80,144,239,0.85);
  backdrop-filter: blur(5px);
  border: none;
  border-radius: 8px 0 0 8px;
  color: #fff;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  z-index: 10;
  box-shadow: -4px 0 16px rgba(0,0,0,0.25);
  padding: 0;
}
.studio_drawer-toggle i { font-size: 10px; }
.studio_drawer-count {
  font-size: 10px;
  font-weight: 700;
  background: #ffb65c;
  color: #1a1a2e;
  border-radius: 10px;
  padding: 1px 4px;
  min-width: 16px;
  text-align: center;
  line-height: 1.4;
}
.studio_drawer-count.is-zero { display: none; }
.studio_drawer-inner {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 16px;
  min-width: 0;
  width: 280px;
}

/* ── App-shell overrides for inner elements ───────────────────── */
/* Remove max-height restriction on result/templates areas —
   the drawer/sidebar already scroll independently */
.studio_app-shell #result-area,
.studio_app-shell #templates-area {
  max-height: none;
  overflow-y: visible;
}

/* ── Responsive — collapse sidebar panel & drawer on small screens */
@media (max-width: 1100px) {
  .studio_sidebar-panel { width: 220px; }
}
@media (max-width: 900px) {
  .studio_sidebar.panel-closed .studio_sidebar-panel,
  .studio_sidebar-panel { width: 0; opacity: 0; pointer-events: none; overflow: hidden; }
  .studio_drawer { width: 0; }
  .studio_drawer.open { width: 280px; }
}

/* ═══════════════════════════════════════════════════════════════
   SECTIONS BROWSER PANEL + CANVAS PREVIEW  (Phase 2)
   ═══════════════════════════════════════════════════════════════ */

/* ── Topbar gear / action button ─────────────────────────────── */
.studio_topbar-action {
  width: 36px;
  height: 36px;
  border: none;
  background: rgba(255,255,255,0.08);
  color: rgba(255,255,255,0.55);
  border-radius: 8px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 15px;
  transition: background 0.2s, color 0.2s;
  flex-shrink: 0;
}
.studio_topbar-action:hover  { background: rgba(255,255,255,0.15); color: #fff; }
.studio_topbar-action.active { background: rgba(80,144,239,0.3);   color: #5090ef; }

/* ── Sections Browser Panel (absolute overlay, slides from right) */
.studio_shell-body { position: relative; }

.studio_sections-panel {
  position: absolute;
  right: 0;
  top: 0;
  height: 100%;
  width: 700px;
  max-width: calc(100vw - 64px);
  background: rgba(20, 24, 50, 0.97);
  backdrop-filter: blur(24px);
  border-left: 1px solid rgba(255,255,255,0.12);
  transform: translateX(100%);
  transition: transform 0.3s ease;
  z-index: 50;
  display: flex;
  flex-direction: column;
}
.studio_sections-panel.open { transform: translateX(0); }

.studio_sections-panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px 12px;
  border-bottom: 1px solid rgba(255,255,255,0.10);
  flex-shrink: 0;
}
.studio_sections-panel-search {
  padding: 12px 16px;
  border-bottom: 1px solid rgba(255,255,255,0.08);
  flex-shrink: 0;
}
.studio_sections-panel-body {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
}

/* ── Canvas — override Phase 1 padding/overflow for preview mode  */
.studio_app-shell .studio_canvas {
  padding: 0;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}
.studio_canvas-preview {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

/* Placeholder */
.studio_preview-placeholder {
  flex: 1;
  overflow-y: auto;
  padding: 28px 24px;
}
.studio_preview-empty {
  text-align: center;
  padding: 40px 20px;
}
.studio_preview-empty i {
  font-size: 52px;
  color: rgba(255,255,255,0.12);
  display: block;
  margin-bottom: 20px;
}
.studio_preview-empty h3 {
  font-size: 18px;
  font-weight: 600;
  color: rgba(255,255,255,0.45);
  margin-bottom: 10px;
}
.studio_preview-empty p {
  font-size: 13px;
  color: rgba(255,255,255,0.55);
  max-width: 340px;
  margin: 0 auto 24px;
  line-height: 1.7;
}

/* Preview iframe */
.studio_preview-frame-wrap {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.studio_preview-frame-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 16px;
  background: rgba(255,255,255,0.07);
  border-bottom: 1px solid rgba(255,255,255,0.10);
  flex-shrink: 0;
}
.studio_preview-frame-bar span {
  flex: 1;
  color: rgba(255,255,255,0.65);
  font-size: 13px;
  font-weight: 600;
}
#page-preview-frame {
  flex: 1;
  border: none;
  background: #fff;
}

/* ── Result / Templates empty state ──────────────────────────── */
.studio_result-empty {
  text-align: center;
  padding: 20px 12px;
  color: rgba(255,255,255,0.45);
}
.studio_result-empty i {
  font-size: 28px;
  display: block;
  margin-bottom: 10px;
  opacity: 0.5;
}
.studio_result-empty p {
  font-size: 12px;
  margin: 0;
  line-height: 1.5;
  color: rgba(255,255,255,0.45);
}

/* ── Section browser panel header — remove inline margin ─────── */
.studio_sections-panel-header .studio_panel-title { margin: 0; }

/* ── Disabled button state ───────────────────────────────────── */
.studio_btn:disabled,
.studio_btn[disabled] {
  opacity: 0.38;
  cursor: not-allowed;
  pointer-events: none;
}
/* Tooltip wrapper for disabled buttons — pointer-events restored on wrapper */
.studio_btn-wrap {
  display: block;
  width: 100%;
}
.studio_btn-wrap[data-toggle="tooltip"] {
  cursor: not-allowed;
}

/* ── Quick-switches strip (One Page + RTL) ───────────────────── */
.studio_quick-switches {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 12px 0 14px;
  border-bottom: 1px solid rgba(255,255,255,0.08);
  margin-bottom: 14px;
}

/* ── Accordion sections inside sidebar panel ─────────────────── */
.studio_panel-content .studio_collapse-trigger {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: rgba(255,255,255,0.55);
  padding: 8px 0;
  margin-bottom: 0;
  border-bottom: 1px solid rgba(255,255,255,0.06);
}
.studio_panel-content .studio_collapse-content {
  padding-top: 12px;
}
/* Spacing before the second accordion trigger */
.studio_panel-content .studio_collapse-content + .studio_collapse-trigger {
  margin-top: 14px;
}

/* ═══════════════════════════════════════════════════════════════════════════
   PRODUCTION UI OVERHAUL — CSS variables, components
   ═══════════════════════════════════════════════════════════════════════════ */

/* ── Design tokens ─────────────────────────────────────────────────────── */
:root {
  --db-bg:         #080f1a;
  --db-surface:    #0f1e30;
  --db-surface2:   #0a1628;
  --db-border:     #1e3a52;
  --db-accent:     #00d4ff;
  --db-accent-dim: #0e7490;
  --db-text:       #e2e8f0;
  --db-text-muted: #64748b;
  --db-text-dim:   #94a3b8;
  --db-dna-on:     #a78bfa;
  --db-dna-bg:     #2d1b69;
}

/* ── Visual DNA toggle pill switch ─────────────────────────────────────── */
.studio_dna-switch-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 4px 0;
}
#dna-mode { display: none; }
.dna-switch-track {
  display: inline-block;
  flex-shrink: 0;
  width: 44px;
  height: 24px;
  background: #1a2332;
  border: 1px solid var(--db-border);
  border-radius: 12px;
  position: relative;
  cursor: pointer;
  transition: background .2s, border-color .2s;
  vertical-align: middle;
}
.dna-switch-track::after {
  content: '';
  position: absolute;
  left: 3px;
  top: 3px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #64748b;
  transition: left .2s, background .2s;
}
#dna-mode:checked + .dna-switch-track {
  background: var(--db-dna-bg);
  border-color: #4c1d95;
}
#dna-mode:checked + .dna-switch-track::after {
  left: 23px;
  background: var(--db-dna-on);
}
.studio_dna-label {
  cursor: pointer;
  font-size: .82rem;
  font-weight: 600;
  color: var(--db-text-dim);
  margin: 0;
  line-height: 1.3;
  flex: 1;
}
.studio_dna-label:hover { color: var(--db-text); }

/* ── Collapsible settings groups (<details>) ──────────────────────────── */
.settings-group {
  border-bottom: 1px solid rgba(255,255,255,.06);
}
.settings-group + .settings-group {
  border-top: none;
}
.settings-group-hd {
  list-style: none;
  padding: 9px 0;
  font-size: .72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: rgba(255,255,255,.45);
  cursor: pointer;
  user-select: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  outline: none;
  transition: color .15s;
}
.settings-group-hd::-webkit-details-marker { display: none; }
.settings-group-hd::after {
  content: '›';
  font-family: system-ui, sans-serif;
  font-size: 1.1rem;
  line-height: 1;
  transition: transform .2s;
  opacity: .5;
}
.settings-group[open] > .settings-group-hd::after {
  transform: rotate(90deg);
  opacity: 1;
}
.settings-group-hd:hover { color: rgba(255,255,255,.75); }
.settings-group > *:not(summary) {
  padding-bottom: 12px;
}

/* ── Device switcher ───────────────────────────────────────────────────── */
#device-switcher {
  display: flex;
  gap: 6px;
  padding: 0;
  background: none;
  border-bottom: none;
  flex-shrink: 0;
}
.dev-btn {
  background: none;
  border: 1px solid var(--db-border);
  border-radius: 5px;
  color: var(--db-text-dim);
  font-size: .74rem;
  padding: 4px 10px;
  cursor: pointer;
  transition: background .15s, color .15s, border-color .15s;
}
.dev-btn:hover { background: var(--db-surface); color: var(--db-text); }
.dev-btn.active {
  background: var(--db-accent-dim);
  color: #fff;
  border-color: var(--db-accent-dim);
}

/* ── iframe area + stats bar ───────────────────────────────────────────── */
.studio_iframe-area {
  flex: 1;
  min-height: 0; /* prevent flex item overflow */
  position: relative;
  overflow: hidden;
  display: flex;
  align-items: stretch;
  justify-content: center;
  background: var(--db-bg);
  transition: background .25s;
}
.studio_iframe-area #page-preview-frame {
  width: 100%;
  height: 100%;
  border: none;
  transition: width .25s, box-shadow .25s;
}
.studio_iframe-area.device-frame {
  align-items: flex-start;
  overflow-y: auto;
  overflow-x: auto;
  padding: 16px;
  background: var(--db-bg);
}
.studio_iframe-area.device-frame #page-preview-frame {
  flex-shrink: 0;
  border-radius: 8px;
  box-shadow: 0 0 0 1px var(--db-border), 0 8px 32px rgba(0,0,0,.5);
}
#stats-bar {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  background: rgba(8,15,26,.82);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  padding: 5px 12px;
  display: flex;
  gap: 14px;
  align-items: center;
  font-size: .72rem;
  color: var(--db-text-dim);
  pointer-events: none;
  border-top: 1px solid rgba(30,58,82,.6);
}
#stat-dna        { color: var(--db-dna-on); }
#stat-personality { color: #818cf8; }

/* ── Template actions ──────────────────────────────────────────────────── */
#template-actions {
  display: flex;
  gap: 8px;
  padding: 10px 14px;
  border-top: 1px solid var(--db-border);
  background: var(--db-surface2);
  flex-shrink: 0;
}
.ta-btn {
  flex: 1;
  background: none;
  border: 1px solid var(--db-border);
  border-radius: 6px;
  color: var(--db-text-dim);
  font-size: .78rem;
  padding: 7px 10px;
  cursor: pointer;
  transition: background .15s, color .15s, border-color .15s;
}
.ta-btn:hover:not(:disabled) {
  background: var(--db-surface);
  color: var(--db-text);
  border-color: var(--db-accent-dim);
}
.ta-btn:disabled { opacity: .4; cursor: not-allowed; }

/* ── Override legacy rule: ensure preview-frame-wrap fills height ──────── */
.studio_preview-frame-wrap {
  height: 100%;
}

/* ═══════════════════════════════════════════════════════════════════════════
   ROUND 2 VISUAL REFRESH
   ═══════════════════════════════════════════════════════════════════════════ */

/* ── Updated CSS tokens (brighter, less grey) ──────────────────────────── */
:root {
  --db-text-dim:   #b0bec5;
  --db-text-muted: #78909c;
  --db-surface:    #132035;
  --db-surface2:   #0d1a2c;
  --db-border:     #243d57;
}

/* ── Sidebar panel — bigger readable fonts ─────────────────────────────── */
.studio_sidebar-panel { font-size: 13px; }
.studio_sidebar-panel .form-group label { font-size: 12px; font-weight: 600; color: var(--db-text-dim); }
.studio_sidebar-panel .form-control { font-size: 13px; }
.studio_sidebar-panel .studio_btn { font-size: 13px; }
.studio_panel-title { font-size: 13px !important; font-weight: 700; }
.settings-group-hd { font-size: 11px; letter-spacing: .07em; color: rgba(255,255,255,.5); }
.studio_quick-switches { display: flex; flex-direction: column; gap: 10px; padding-top: 6px; }
.studio_custom-switch-label { font-size: 13px; }
.custom-control-label { font-size: 13px; }

/* ── Topbar brand gradient ─────────────────────────────────────────────── */
.studio_topbar-brand {
  font-size: 17px;
  font-weight: 800;
  letter-spacing: -.4px;
  background: linear-gradient(130deg, #fff 35%, var(--db-accent));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* ── Generation status pill ────────────────────────────────────────────── */
#gen-status {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 12px;
  color: var(--db-accent);
  background: rgba(0,212,255,.08);
  border: 1px solid rgba(0,212,255,.2);
  border-radius: 20px;
  padding: 3px 12px;
  margin-left: 10px;
}

/* ── User dropdown trigger + menu ──────────────────────────────────────── */
.studio_user-trigger {
  background: none;
  border: none;
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 8px;
  transition: background .15s;
  color: inherit;
}
.studio_user-trigger:hover,
.studio_user-trigger:focus { background: rgba(255,255,255,.06); outline: none; }
.studio_user-trigger .dropdown-toggle::after { display: none; } /* hide BS arrow */
.studio_user-caret { font-size: 8px; color: var(--db-text-muted); margin-left: 2px; }
.studio_user-dropdown {
  background: var(--db-surface);
  border: 1px solid var(--db-border);
  border-radius: 12px;
  min-width: 210px;
  padding: 6px 0;
  box-shadow: 0 10px 36px rgba(0,0,0,.45);
  margin-top: 6px;
}
.studio_user-dropdown-header {
  padding: 10px 16px 8px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.studio_user-dropdown-header strong { font-size: 13px; color: var(--db-text); font-weight: 700; }
.studio_user-dropdown-header span   { font-size: 11px; color: var(--db-text-muted); }
.studio_user-dropdown .dropdown-divider { border-color: var(--db-border); margin: 4px 0; }
.studio_user-dropdown .dropdown-item {
  font-size: 13px;
  color: var(--db-text-dim);
  padding: 8px 16px;
  display: flex;
  align-items: center;
  gap: 10px;
  background: none;
  transition: background .12s, color .12s;
}
.studio_user-dropdown .dropdown-item i { width: 16px; text-align: center; opacity: .7; }
.studio_user-dropdown .dropdown-item:hover {
  background: rgba(255,255,255,.06);
  color: var(--db-text);
}
.studio_logout-item { color: #f87171 !important; }
.studio_logout-item:hover { background: rgba(248,113,113,.08) !important; color: #f87171 !important; }

/* ── Merged preview toolbar ────────────────────────────────────────────── */
.studio_preview-toolbar {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 7px 12px;
  background: var(--db-surface2);
  border-bottom: 1px solid var(--db-border);
  flex-shrink: 0;
}
.studio_toolbar-group { display: flex; align-items: center; gap: 4px; }
.studio_toolbar-sep { flex: 1; }

/* ── Icon action buttons ───────────────────────────────────────────────── */
.ta-icon-btn {
  width: 32px;
  height: 32px;
  border-radius: 7px;
  border: 1px solid var(--db-border);
  background: none;
  color: var(--db-text-dim);
  font-size: .88rem;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: background .15s, color .15s, border-color .15s, transform .1s;
  flex-shrink: 0;
}
.ta-icon-btn:hover:not(:disabled) {
  background: var(--db-surface);
  color: var(--db-text);
  border-color: var(--db-accent-dim);
  transform: translateY(-1px);
}
.ta-icon-btn:disabled { opacity: .3; cursor: not-allowed; transform: none; }
.ta-icon-btn.active-like  { color: #f87171; border-color: rgba(248,113,113,.5); background: rgba(248,113,113,.08); }
.ta-icon-btn.active-pin   { color: var(--db-accent); border-color: rgba(0,212,255,.4); background: rgba(0,212,255,.06); }
.ta-icon-btn.active-save  { color: #fbbf24; border-color: rgba(251,191,36,.4); background: rgba(251,191,36,.06); }

/* ── Device switcher inside merged toolbar ─────────────────────────────── */
#device-switcher .dev-btn {
  width: 32px; height: 32px; padding: 0;
  display: inline-flex; align-items: center; justify-content: center;
  border-radius: 7px; font-size: .88rem;
}

/* ── Generating overlay on canvas ──────────────────────────────────────── */
#canvas-preview { position: relative; }

/* ── Pages filmstrip ───────────────────────────────────────────────────── */
#pages-filmstrip {
  height: 114px;
  flex-shrink: 0;
  overflow-x: auto;
  overflow-y: hidden;
  border-top: 1px solid var(--db-border);
  background: var(--db-surface2);
  display: flex;
  align-items: center;
  /* custom scrollbar */
  scrollbar-width: thin;
  scrollbar-color: var(--db-border) transparent;
}
#pages-filmstrip::-webkit-scrollbar { height: 4px; }
#pages-filmstrip::-webkit-scrollbar-thumb { background: var(--db-border); border-radius: 2px; }
#filmstrip-inner {
  display: flex;
  gap: 8px;
  padding: 8px 12px;
  min-width: max-content;
}
.filmstrip-thumb {
  flex-shrink: 0;
  width: 84px;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  border-radius: 6px;
  overflow: hidden;
  border: 1.5px solid var(--db-border);
  transition: border-color .15s, transform .15s, box-shadow .15s;
}
.filmstrip-thumb:hover {
  border-color: var(--db-accent);
  transform: translateY(-2px);
  box-shadow: 0 4px 14px rgba(0,212,255,.15);
}
.filmstrip-thumb.active {
  border-color: var(--db-accent);
  box-shadow: 0 0 0 2px rgba(0,212,255,.25);
}
.filmstrip-iframe-wrap {
  width: 84px;
  height: 88px;
  overflow: hidden;
  position: relative;
  background: #fff;
  flex-shrink: 0;
}
.filmstrip-iframe-wrap iframe {
  width: 500%;
  height: 500%;
  transform: scale(0.2);
  transform-origin: 0 0;
  pointer-events: none;
  border: none;
  display: block;
}
.filmstrip-label {
  font-size: .62rem;
  text-align: center;
  color: var(--db-text-dim);
  padding: 3px 5px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  background: var(--db-surface2);
  border-top: 1px solid var(--db-border);
}

/* ── Template save card in right drawer ────────────────────────────────── */
#template-save-card { margin-top: 12px; }
#template-save-card .studio_panel-title { margin-bottom: 6px; }
#template-save-card .form-control { font-size: 13px; }

/* ── Right drawer — remove old ta-btn (replaced by ta-icon-btn) ────────── */
#template-actions { display: none; } /* hidden — replaced by toolbar icons */

/* ══════════════════════════════════════════════════════════════════════════
   DARK THEME FOUNDATION v2
   Root cause fix: body was #5d5d5d grey → all transparent glass overlays
   looked flat grey instead of dark navy. This block applies the --db-*
   tokens to every major container and overrides Bootstrap light defaults.
   ══════════════════════════════════════════════════════════════════════════ */

/* 1 ─ Dark base — most important single rule */
body {
  background: var(--db-bg);
  color: var(--db-text);
}
.studio_app-shell { background: var(--db-bg); }

/* 2 ─ Solidify layout panels: replace glass rgba → solid dark surfaces */
.studio_topbar {
  background: var(--db-surface);
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  border-bottom: 1px solid var(--db-border);
}
.studio_sidebar {
  background: var(--db-surface2);
  border-right: 1px solid var(--db-border);
}
.studio_sidebar-rail {
  background: var(--db-bg);
  border-right: 1px solid var(--db-border);
}
.studio_sidebar-panel {
  background: var(--db-surface2);
  scrollbar-color: var(--db-border) transparent;
}
.studio_canvas { background: var(--db-bg); }
.studio_drawer {
  background: var(--db-surface);
  border-left: 1px solid var(--db-border);
}
.studio_drawer-inner { background: var(--db-surface); }

/* 3 ─ Preview bar */
.studio_preview-frame-bar {
  background: var(--db-surface);
  border-bottom: 1px solid var(--db-border);
}
.studio_preview-frame-bar span { color: var(--db-text-dim); }

/* 4 ─ Cards */
.studio_card {
  background: var(--db-surface);
  border: 1px solid var(--db-border);
  border-radius: 10px;
  padding: 16px;
  color: var(--db-text);
}
.studio_card + .studio_card { margin-top: 12px; }
/* Nested card gets deeper surface */
.studio_card .studio_card { background: var(--db-surface2); }

/* 5 ─ Bootstrap form controls → dark */
.form-control,
.custom-select,
select.form-control,
textarea.form-control {
  background: rgba(255,255,255,.05);
  border: 1px solid var(--db-border);
  color: var(--db-text);
  border-radius: 6px;
  transition: border-color .2s, background .2s, box-shadow .2s;
}
.form-control:focus,
.custom-select:focus,
select.form-control:focus,
textarea.form-control:focus {
  background: rgba(255,255,255,.09);
  border-color: var(--db-accent);
  color: var(--db-text);
  box-shadow: 0 0 0 2px rgba(0,212,255,.12);
  outline: none;
}
.form-control::placeholder,
textarea.form-control::placeholder { color: var(--db-text-muted); }
select option { background: var(--db-surface); color: var(--db-text); }

/* 6 ─ Labels, headings, muted text */
label { color: var(--db-text-dim); font-weight: 500; }
h3, h4, h5, h6 { color: var(--db-text); }
.text-muted { color: var(--db-text-muted) !important; }
.custom-control-label { color: var(--db-text-dim); font-weight: 500; }
.studio_panel-title {
  color: rgba(255,255,255,.55);
  border-bottom-color: var(--db-border);
}

/* 7 ─ Bootstrap custom switch — dark skin */
.custom-control-label::before {
  background: rgba(255,255,255,.08);
  border-color: var(--db-border);
}
.custom-control-input:checked ~ .custom-control-label::before {
  background: var(--db-accent-dim);
  border-color: var(--db-accent);
}

/* 8 ─ studio_btn — complete redesign with dark tokens */
.studio_btn {
  background: var(--db-accent-dim);
  color: #fff;
  border: none;
  border-radius: 7px;
  padding: 8px 18px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  text-decoration: none;
  transition: background .15s, transform .12s, box-shadow .15s;
  text-shadow: none;
  box-shadow: none;
}
.studio_btn.btn-block { display: flex; width: 100%; }
.studio_btn:hover:not(:disabled):not([disabled]) {
  background: var(--db-accent);
  color: #000;
  text-decoration: none;
  transform: translateY(-1px);
  box-shadow: 0 4px 16px rgba(0,212,255,.25);
}
.studio_btn:focus { outline: none; }
.studio_btn.success {
  background: #065f46; color: #fff;
}
.studio_btn.success:hover:not(:disabled) {
  background: #059669; color: #fff;
  box-shadow: 0 4px 16px rgba(5,150,105,.3);
}
.studio_btn.warning {
  background: #92400e; color: #fff;
}
.studio_btn.warning:hover:not(:disabled) {
  background: #d97706; color: #fff;
  box-shadow: 0 4px 16px rgba(217,119,6,.3);
}
.studio_btn.danger {
  background: #7f1d1d; color: #fff;
}
.studio_btn.danger:hover:not(:disabled) {
  background: #ef4444; color: #fff;
}
.studio_btn.light {
  background: rgba(255,255,255,.07);
  color: var(--db-text-dim);
  border: 1px solid var(--db-border);
  text-shadow: none;
  box-shadow: none;
}
.studio_btn.light:hover:not(:disabled) {
  background: rgba(255,255,255,.14);
  color: #fff;
  box-shadow: none;
  transform: none;
}
.studio_btn:disabled,
.studio_btn[disabled] {
  opacity: .4;
  cursor: not-allowed;
  transform: none !important;
  box-shadow: none !important;
}

/* 9 ─ Nestable pages list */
.dd { background: transparent; }
.dd-item > .dd-content {
  background: var(--db-surface);
  border: 1px solid var(--db-border);
  color: var(--db-text);
  border-radius: 6px;
  margin-bottom: 4px;
}
.dd-item > .dd-content p { color: var(--db-text); font-size: 13px; margin: 0; }
.dd-handle {
  background: rgba(0,0,0,.2);
  border: none;
  border-right: 1px solid var(--db-border);
  color: var(--db-text-muted);
}
.studio_section-added-controls a { color: var(--db-text-muted); }
.studio_section-added-controls a:hover { color: var(--db-accent); }

/* 10 ─ Empty states */
.studio_result-empty {
  text-align: center;
  padding: 28px 8px;
  color: var(--db-text-muted);
}
.studio_result-empty i { font-size: 2rem; margin-bottom: 10px; display: block; opacity: .35; }
.studio_result-empty p { font-size: 13px; line-height: 1.5; }

/* 11 ─ Select2 dark skin */
.select2-container--default .select2-selection--single {
  background: rgba(255,255,255,.05);
  border: 1px solid var(--db-border);
  border-radius: 6px;
  color: var(--db-text);
  height: 36px;
}
.select2-container--default .select2-selection--single .select2-selection__rendered {
  color: var(--db-text);
  line-height: 34px;
  padding-left: 10px;
}
.select2-container--default .select2-selection--single .select2-selection__arrow { height: 34px; }
.select2-dropdown {
  background: var(--db-surface);
  border: 1px solid var(--db-border);
  border-radius: 8px;
}
.select2-container--default .select2-results__option {
  color: var(--db-text-dim);
  font-size: 13px;
}
.select2-container--default .select2-results__option--highlighted[aria-selected] {
  background: var(--db-accent-dim);
  color: #fff;
}
.select2-container--default .select2-results__option[aria-selected="true"] {
  background: rgba(0,212,255,.1);
  color: var(--db-accent);
}
.select2-search--dropdown .select2-search__field {
  background: rgba(255,255,255,.06);
  border: 1px solid var(--db-border);
  color: var(--db-text);
  border-radius: 4px;
  padding: 4px 8px;
}

/* 12 ─ Section browser panel (overlay) */
.studio_sections-panel {
  background: var(--db-surface2);
  border-left: 1px solid var(--db-border);
}
.studio_sections-panel-header {
  background: var(--db-surface);
  border-bottom: 1px solid var(--db-border);
}

/* 13 ─ Niche cards */
.studio_niche-card {
  background: rgba(255,255,255,.04);
  border: 1px solid var(--db-border);
}

/* 14 ─ Global custom scrollbars */
::-webkit-scrollbar { width: 5px; height: 5px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--db-border); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--db-accent-dim); }
* { scrollbar-width: thin; scrollbar-color: var(--db-border) transparent; }

/* 15 ─ Toastr notification backdrop */
#toast-container > div {
  background: var(--db-surface) !important;
  border: 1px solid var(--db-border) !important;
  box-shadow: 0 8px 32px rgba(0,0,0,.5) !important;
  opacity: 1 !important;
  color: var(--db-text) !important;
}
#toast-container > .toast-success { border-left: 3px solid #059669 !important; }
#toast-container > .toast-error   { border-left: 3px solid #ef4444 !important; }
#toast-container > .toast-warning { border-left: 3px solid #d97706 !important; }
#toast-container > .toast-info    { border-left: 3px solid var(--db-accent) !important; }

/* ── DNA dropdown labels ─────────────────────────────────────────────────── */
.studio_dna-meta-label {
  font-size: .68rem;
  font-weight: 700;
  color: var(--db-text-muted);
  margin-bottom: 4px;
  display: block;
  letter-spacing: .07em;
  text-transform: uppercase;
}

/* ── Dark native selects — appearance:none + SVG chevron ────────────────── */
#dna-archetype,
#dna-personality,
#auto-generate-topic,
#preset-combinations {
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  display: block;
  width: 100%;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  background-color: #080f1a;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6'%3E%3Cpath d='M1 1l4 4 4-4' stroke='%2378909c' stroke-width='1.5' fill='none' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
  background-size: 10px 6px;
  border: 1px solid var(--db-border);
  border-radius: 7px;
  color: var(--db-text);
  font-size: 12.5px;
  font-weight: 500;
  line-height: 1.4;
  padding: 8px 30px 8px 11px;
  cursor: pointer;
  transition: border-color .18s, box-shadow .18s;
}
#dna-archetype:hover,
#dna-personality:hover,
#auto-generate-topic:hover,
#preset-combinations:hover {
  border-color: var(--db-accent-dim);
}
#dna-archetype:focus,
#dna-personality:focus,
#auto-generate-topic:focus,
#preset-combinations:focus {
  border-color: var(--db-accent);
  box-shadow: 0 0 0 2px rgba(0,212,255,.14);
  outline: none;
}
#dna-archetype option,
#dna-personality option,
#auto-generate-topic option,
#preset-combinations option {
  background-color: #0d1a2c;
  color: var(--db-text);
  padding: 6px;
}

/* ── Sidebar panel wider — long option labels fit without wrapping ────────── */
.studio_sidebar-panel { width: 300px; }
.studio_sidebar-panel.dna-expanded { width: 500px; } /* +200px override for this theme */
.studio_sidebar.panel-closed .studio_sidebar-panel { width: 0; }
@media (max-width: 1100px) { .studio_sidebar-panel { width: 270px; } }
@media (max-width:  900px) { .studio_sidebar-panel { width: 240px; } }

/* Random style checkbox */
#dna-personality-wrap .custom-control-label {
  font-size: .72rem !important;
  color: var(--db-text-muted) !important;
}

/* ── Industry Accordion ──────────────────────────────────────────────────── */
.sigma-ind-list {
  max-height: 255px;
  overflow-y: auto;
  border: 1px solid rgba(255,255,255,.09);
  border-radius: 8px;
  scrollbar-width: thin;
  scrollbar-color: rgba(255,255,255,.15) transparent;
}
.sigma-ind-list::-webkit-scrollbar { width: 4px; }
.sigma-ind-list::-webkit-scrollbar-thumb { background: rgba(255,255,255,.18); border-radius: 2px; }
.sigma-ind-item { border-bottom: 1px solid rgba(255,255,255,.05); }
.sigma-ind-item:last-child { border-bottom: none; }
.sigma-ind-item.sigma-ind-extra { display: none; }
.sigma-ind-head {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 7px 10px;
  cursor: pointer;
  user-select: none;
  border-left: 3px solid transparent;
  transition: border-color .15s, background .15s;
}
.sigma-ind-head:hover {
  background: rgba(255,255,255,.05);
  border-left-color: hsl(var(--ind-hue), 38%, 48%);
}
.sigma-ind-item.active .sigma-ind-head {
  background: hsla(var(--ind-hue), 32%, 22%, 0.25);
  border-left-color: hsl(var(--ind-hue), 42%, 52%);
}
.sigma-ind-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: hsl(var(--ind-hue), 42%, 52%);
  flex-shrink: 0;
}
.sigma-ind-name {
  flex: 1;
  font-size: 11.5px;
  font-weight: 500;
  color: #ddd;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.sigma-ind-top-pers {
  font-size: 9.5px;
  color: hsl(var(--ind-hue), 42%, 65%);
  background: hsla(var(--ind-hue), 30%, 25%, 0.30);
  padding: 1px 6px;
  border-radius: 10px;
  white-space: nowrap;
  flex-shrink: 0;
}
.sigma-ind-chevron {
  font-size: 9px;
  color: rgba(255,255,255,.35);
  transition: transform .18s;
  flex-shrink: 0;
}
.sigma-ind-item.active .sigma-ind-chevron { transform: rotate(90deg); }
.sigma-ind-body {
  display: none;
  padding: 7px 10px 10px 20px;
  background: hsla(var(--ind-hue), 28%, 16%, 0.22);
  border-left: 3px solid hsl(var(--ind-hue), 40%, 48%);
}
.sigma-ind-item.active .sigma-ind-body { display: block; }
.sigma-ind-verts { display: flex; flex-wrap: wrap; gap: 4px; }
.sigma-ind-vert {
  font-size: 10px;
  padding: 2px 7px;
  border-radius: 10px;
  background: hsla(var(--ind-hue), 28%, 28%, 0.28);
  color: hsl(var(--ind-hue), 38%, 70%);
  border: 1px solid hsla(var(--ind-hue), 30%, 45%, 0.20);
  cursor: pointer;
  transition: background .15s, color .15s, border-color .15s;
}
.sigma-ind-vert.active {
  background: hsla(var(--ind-hue), 38%, 35%, 0.50);
  color: hsl(var(--ind-hue), 55%, 82%);
  border-color: hsla(var(--ind-hue), 45%, 55%, 0.50);
  font-weight: 600;
}
.sigma-ind-toggle-btn {
  margin-top: 6px;
  width: 100%;
  padding: 5px 0;
  font-size: 11px;
  color: rgba(255,255,255,.45);
  background: none;
  border: 1px dashed rgba(255,255,255,.14);
  border-radius: 6px;
  cursor: pointer;
  transition: color .18s, border-color .18s;
}
.sigma-ind-toggle-btn:hover { color: rgba(255,255,255,.8); border-color: rgba(255,255,255,.32); }
/* Expanded sidebar gives the list more scroll room */
.studio_sidebar-panel.dna-expanded .sigma-ind-list { max-height: 320px; }

/* ── Brand Style Tiles ───────────────────────────────────────────────────── */
.sigma-style-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 3px;
  margin-top: 4px;
}
.sigma-style-tile {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 10px;
  border-radius: 6px;
  border: 1px solid rgba(255,255,255,.1);
  cursor: pointer;
  background: rgba(255,255,255,.03);
  transition: border-color .15s, background .15s;
}
.sigma-style-tile:hover {
  background: rgba(255,255,255,.07);
  border-color: var(--tile-color);
}
.sigma-style-tile.active {
  background: rgba(255,255,255,.08);
  border-color: var(--tile-color);
  box-shadow: inset 2px 0 0 var(--tile-color);
}
.sigma-style-swatch {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--tile-color);
  flex-shrink: 0;
}
.sigma-style-label { font-size: 11px; color: #bbb; line-height: 1.2; }
.sigma-style-tile.active .sigma-style-label { color: #fff; }
.sigma-style-grid.sigma-random-on { opacity: .4; pointer-events: none; }
