/* NULLING STYLES */
* {
  padding: 0;
  margin: 0;
  border: 0;
}
*,
*:before,
*:after {
  -moz-box-sizing: border-box;
  -webkit-box-sizing: border-box;
  box-sizing: border-box;
}
:focus,
:active {
  outline: none;
}
a:focus,
a:active {
  outline: none;
}
nav,
footer,
header,
aside {
  display: block;
}
html,
body {
  height: 100%;
  width: 100%;
  font-size: 100%;
  line-height: 1;
  font-size: 14px;
  -ms-text-size-adjust: 100%;
  -moz-text-size-adjust: 100%;
  -webkit-text-size-adjust: 100%;
}
input,
button,
textarea {
  font-family: inherit;
}
input::-ms-clear {
  display: none;
}
button {
  cursor: pointer;
}
button::-moz-focus-inner {
  padding: 0;
  border: 0;
}
a,
a:visited {
  text-decoration: none;
}
a:hover {
  text-decoration: none;
}
ul li {
  list-style: none;
}
img {
  vertical-align: top;
}
h1,
h2,
h3,
h4,
h5,
h6 {
  font-size: inherit;
  font-weight: inherit;
}
a {
  color: inherit;
}
/*--------------------*/

/* VARIABLES */
:root {
  --color-primary: #7380ec;
  --color-secondary: #4db8ff;
  --color-danger: #ff7782;
  --color-success: #41f1b6;
  --color-warning: #ffbb55;
  --color-white: #fff;
  --color-info-dark: #7d8da1;
  --color-info-light: #dce1eb;
  --color-dark: #363949;
  --color-light: rgba(132, 139, 200, 0.18);
  --color-primary-variant: #111e88;
  --color-dark-variant: #677483;
  --color-background: #f6f6f9;
  --color-valid: #339933;
  --color-invalid: #cc0000;
  --color-black: #000;
  --color-tb-light: rgba(132, 139, 200, 0.18);
  --border-table: none;

  --white: #fff;
  --black: #000;

  --card-border-radius: 2rem;
  --border-radius-1: 0.4rem;
  --border-radius-2: 0.8rem;
  --border-radius-3: 1.2rem;

  --card-padding: 1.8rem;
  --padding-1: 1.2rem;

  --box-shadow: 0 2rem 3rem var(--color-light);
}

/* DARK THEME VARIABLES */
.dark-theme-variables {
  --color-background: #181a1e;
  --color-white: #202528;
  --color-dark: #edeffd;
  --color-dark-variant: #a3bdcc;
  --color-light: rgba(0, 0, 0, 0.4);
  --color-info-light: #333333;
  --white: #000;
  --black: #fff;
  --border-table: 1px solid rgb(242, 242, 242);
  --color-tb-light: rgb(242, 242, 242);
  --box-shadow: 0 2rem 3rem var(--color-light);
}
* {
  font-family: "Montserrat", sans-serif;
}
body {
  background-color: var(--color-background);
}

a {
  color: var(--color-dark);
}

img {
  display: block;
  width: 100%;
}

h1 {
  display: block;
  font-size: 2em;
  margin-left: 0;
  margin-right: 0;
  font-weight: bold;
}

h2 {
  display: block;
  font-size: 1.5em;
  margin-left: 0;
  margin-right: 0;
  font-weight: bold;
}

h3 {
  display: block;
  font-size: 1.17em;
  margin-left: 0;
  margin-right: 0;
  font-weight: bold;
}

h4 {
  display: block;
  font-size: 1em;
  margin-left: 0;
  margin-right: 0;
  font-weight: bold;
}

h5 {
  display: block;
  font-size: 0.83em;
  margin-left: 0;
  margin-right: 0;
  font-weight: bold;
}

h6 {
  display: block;
  font-size: 0.67em;
  margin-left: 0;
  margin-right: 0;
  font-weight: bold;
}

._lock {
  overflow: hidden;
}

small {
  font-size: 0.75rem;
  color: var(--color-info-dark);
}

.profile-photo {
  width: 2.8rem;
  height: 2.8rem;
  border-radius: 50%;
  overflow: hidden;
  object-fit: cover;
}

.text-muted {
  color: var(--color-info-dark);
}

p {
  color: var(--color-dark-variant);
  margin: 0;
}

b {
  color: var(--color-dark);
}

p.show-ago {
  margin-top: 7px;
}

.primary {
  color: var(--color-primary);
}

.danger {
  color: var(--color-danger);
}

.success {
  color: var(--color-success);
}

.warning {
  color: var(--color-warning);
}

.bg-primary {
  background: var(--color-primary);
}

.bg-danger {
  background: var(--color-danger);
}

.bg-success {
  background: var(--color-success);
}

.color-dark {
  color: var(--color-dark);
}

.wrapper {
  position: relative;
}

.page-dark-overlay {
  width: 100%;
  height: 100%;
  position: fixed;
  background-color: rgba(0, 0, 0, 0.4);
  z-index: 101;
  visibility: hidden;
  opacity: 0;
  transition: all 0.4s ease-in-out;
}

.page-dark-overlay._active {
  visibility: visible;
  opacity: 1;
}

header {
  width: 100%;
  position: sticky;
  top: 0;
  z-index: 100;
  background-color: #28282b;
  padding: 0px 25px;
}

header .close-mode {
  font-size: 28px;
  color: var(--color-white);
  cursor: pointer;
}

.sidebar {
  position: fixed;
  width: 35%;
  height: 100%;
  background-color: #28282b;
  padding: 20px;
  z-index: 102;
  left: -100%;
  transition: all 0.4s ease-in-out;
}

.sidebar._active {
  left: 0;
}

.sidebar h2,
.sidebar .close-mode {
  font-size: 32px;
  color: var(--color-white);
  font-weight: 300;
  cursor: pointer;
}

.form-edit {
  background-color: #4e4e55;
  padding: 35px 15px;
  margin-top: 20px;
  border-radius: 8px;
}

.note-editable {
  background-color: var(--color-white);
  line-height: 1.5;
}

.form-edit label {
  font-size: 16px;
  color: var(--color-white);
  font-weight: 500;
}

.form-edit textarea {
  height: 200px;
  background-color: var(--color-white) !important;
}
.form-edit textarea,
.form-edit select,
.form-edit input {
  padding: 10px 7px;
  border-radius: 6px;
  font-size: 16px;
}

/* ACTION BUTTONS */
.action-buttons-area {
  display: flex;
  flex-direction: row;
  align-items: center;
  margin-bottom: 20px;
}

.btn-action {
  width: 200px;
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  text-align: center;
  font-weight: 600;
  padding: 20px 10px;
  cursor: pointer;
  border-radius: 10px;
  transition: all 0.3s ease-in-out;
  margin: 12px 6px;
  color: white !important;
}

.btn-action span {
  margin-left: 12px;
}

.btn-success {
  background-color: var(--color-valid);
}

.btn-primary {
  background-color: var(--color-primary);
}

.btn-warning {
  background-color: var(--color-warning);
}

.btn-danger {
  background-color: var(--color-invalid);
}

.btn-success:hover,
.btn-primary:hover,
.btn-warning:hover,
.btn-danger:hover {
  filter: brightness(75%);
}
/* ACTION BUTTONS */

.modal-image-slider .sl-nv {
  font-weight: 600 !important;
  color: var(--color-info-dark) !important;
}
/* MODALS */
.modal-image-slider-wrapper,
.modal-photo-wrapper,
.modal-confirm-wrapper,
.modal-error-wrapper {
  z-index: 100;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.6);
  transition: all 0.3s ease-in-out;
  opacity: 0;
  visibility: hidden;
}

.modal-image-slider-wrapper.active,
.modal-photo-wrapper.active,
.modal-confirm-wrapper.active,
.modal-error-wrapper.active {
  opacity: 1;
  visibility: visible;
}

.modal-confirm,
.modal-error {
  background-color: var(--color-white);
  max-width: 400px;
  width: 100%;
  border-radius: var(--border-radius-2);
  position: absolute;
  top: -100%;
  left: 50%;
  transform: translateX(-50%);
  padding: 20px 30px;
  transition: all 0.6s ease-in-out;
}

.modal-confirm.active,
.modal-error.active {
  top: 50px;
}

.modal-confirm h2 {
  font-size: 22px;
  color: var(--color-secondary);
  line-height: 30px;
  font-weight: 500;
  margin-bottom: 20px;
}

.modal-error h2 {
  font-size: 22px;
  color: var(--color-warning);
  line-height: 30px;
  font-weight: 500;
  margin-bottom: 20px;
}
.modal-confirm h2 span {
  font-size: 30px;
  color: var(--color-secondary);
  margin-right: 10px;
}

.modal-error h2 span {
  font-size: 30px;
  color: var(--color-warning);
  margin-right: 10px;
}

.modal-confirm p,
.modal-error p {
  font-size: 15px;
  color: var(--color-dark);
  line-height: 30px;
  font-weight: 600;
  margin-bottom: 30px;
}

.modal-confirm .buttons {
  gap: 30px;
  width: 100%;
}

.modal-confirm .buttons a,
.modal-error .buttons a {
  max-width: 300px;
  width: 100%;
  padding: 16px 15px;
  font-size: 14px;
  border-radius: var(--border-radius-2);
  color: #fff;
  transition: all 0.3s ease-in-out;
  cursor: pointer;
}

.modal-confirm .buttons a:hover,
.modal-error .buttons a:hover {
  opacity: 0.6;
}

.modal-confirm .buttons a.accept-confirm {
  background-color: var(--color-valid);
}

.modal-confirm .buttons a.cancel-confirm {
  background-color: var(--color-invalid);
}

.modal-error .buttons a.cancel-error {
  background-color: var(--color-warning);
}

.modal-photo-wrapper .modal-window {
  background-color: rgba(300, 300, 300, 0.9);
  position: relative;
  transition: all 0.5s ease-in-out;
  max-width: 1000px;
  height: auto;
  bottom: -100%;
  transform: scale(0.7);
}

.modal-photo-wrapper .modal-window.active {
  bottom: 0;
  transform: scale(1);
}

.modal-photo-wrapper .modal-window img {
  /* position: absolute; */
  width: 100%;
  max-height: 600px;

  /* object-fit: cover; */
  cursor: zoom-out;
}

.modal-photo-wrapper .close-modal-photo {
  position: absolute;
  top: 25px;
  right: 25px;
  font-size: 50px;
  color: #fff;
  cursor: pointer;
  transition: all 0.3s ease-in-out;
}

.close-md:hover,
.modal-photo-wrapper .close-modal-photo:hover {
  color: var(--color-danger);
}

.modal-gallery {
  max-width: 500px;
  max-height: 600px;
  /* border: 1px solid red; */
}

.modal-image-slider .swiper-wrapper .gallery-item {
  position: relative;
  width: 100%;
  height: 100%;
}

.modal-image-slider-wrapper .modal-gallery {
  position: relative;
  transition: all 0.5s ease-in-out;
  bottom: -100%;
  transform: scale(0.7);
}

.modal-image-slider-wrapper .modal-gallery.active {
  bottom: 0;
  transform: scale(1);
}

.modal-image-slider .swiper-wrapper .gallery-item img {
  /* position: absolute; */
  width: 100%;
  height: 100%;
  object-fit: cover;
  /* border: 1px solid red; */
}

.close-md {
  position: fixed;
  top: 20px;
  right: 20px;
  font-size: 50px;
  font-weight: 700;
  color: var(--color-white);
  cursor: pointer;
  transition: all 0.2s ease-in-out;
  z-index: 1000;
}

/* MODALS */

@media (max-width: 1380px) {
  .sidebar {
    position: fixed;
    width: 50% !important;
    height: 100%;
    background-color: #28282b;
    padding: 20px;
    z-index: 102;
    left: -100%;
    transition: all 0.4s ease-in-out;
  }
}

@media screen and (max-width: 1200px) {
  .row-container {
    flex-direction: column !important;
    flex-wrap: wrap;
  }
  /* .flex-row {
    flex-wrap: wrap;
  } */

  .resp {
    width: 100%;
  }

  .sidebar {
    position: fixed;
    width: 70% !important;
    height: 100%;
    background-color: #28282b;
    padding: 20px;
    z-index: 102;
    left: -100%;
    transition: all 0.4s ease-in-out;
  }
}

@media screen and (max-width: 970px) {
  .items-row {
    flex-direction: column !important;
  }

  /* .header-actions {
    display: none !important;
  } */
}

@media screen and (max-width: 800px) {
  header nav .header-actions {
    gap: 30px;
  }
  .header-actions .date-time {
    display: none;
  }

  aside {
    width: 100%;
  }

  .sidebar {
    position: fixed;
    width: 80% !important;
    height: 100%;
    background-color: #28282b;
    padding: 20px;
    z-index: 102;
    left: -100%;
    transition: all 0.4s ease-in-out;
  }
}

@media screen and (max-width: 600px) {
  .form-wrapper,
  .grid-wrapper {
    width: 96%;
  }
  table.resp {
    border: none;
    background-color: transparent;
  }

  table.resp caption {
    font-size: 1.3em;
  }

  table.resp thead {
    border: none;
    clip: rect(0 0 0 0);
    height: 1px;
    margin: -1px;
    overflow: hidden;
    padding: 0;
    position: absolute;
    width: 1px;
    margin-bottom: 20px;
    display: none;
  }

  table tr {
    border-bottom: 3px solid #ddd;
    border-top: 3px solid #ddd;
    display: flex;
    flex-direction: column;
    width: 100%;
    margin-bottom: 0.625em;
    padding: 20px;
    background-color: var(--color-white);
    margin-bottom: 30px;
  }

  table.detail-view tr {
    border-top: 2px solid #ddd;
    border-bottom: none;
  }

  table tr td {
    font-size: 14px;
    height: auto;
    border: none;
  }

  table.detail-view tr th {
    width: 100%;
    text-align: center;
    border-right: none;
    padding: 25px;
    color: var(--color-dark);
    font-weight: 600;
    font-size: 16px;
    height: auto;
  }

  table.resp td {
    border-bottom: 1px solid #ddd;
    font-size: 14px;
    height: auto;
    line-height: 26px;
    text-align: right;
    padding: 30px 5px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: space-between;
    width: 100%;
  }

  table.resp td a {
    padding: 0;
    margin: 0;
  }

  table.resp td::before {
    content: attr(data-label);
    font-weight: bold;
    text-transform: normal;
  }

  .sidebar {
    position: fixed;
    width: 100% !important;
    height: 100%;
    background-color: #28282b;
    padding: 20px;
    z-index: 102;
    left: -100%;
    transition: all 0.4s ease-in-out;
  }
}

/* ACCOUnt ACTIVATE */
.success-flash {
  max-width: 100%;
  padding: 20px 10px;
  background: #339966;
  color: #fff;
  font-size: 16px;
  font-weight: 400;
  border-radius: 20px;
  margin-bottom: 20px;
  line-height: 27px;
  text-align: center;
}

.error-flash {
  max-width: 100%;
  padding: 20px 10px;
  background: var(--color-invalid);
  color: #fff;
  font-size: 16px;
  font-weight: 400;
  border-radius: 20px;
  margin-bottom: 20px;
  line-height: 27px;
  text-align: center;
}

.form-wrapper-acc {
  min-height: 100vh;
  width: 100%;
}

.form-wrapper-acc form {
  max-width: 350px;
  width: 100%;
  -webkit-box-shadow: 0 0 7px var(--color-info-dark);
  box-shadow: 0 0 7px var(--color-info-dark);
  border-radius: var(--border-radius-2);
  padding: 30px 20px;
  height: auto;
}

.form-wrapper-acc form .fgt {
  color: cornflowerblue;
  margin-top: 15px;
  font-size: 16px;
  line-height: 26px;
  align-self: flex-start;
}

.form-wrapper-acc form h5 {
  font-size: 18px;
  font-weight: 400;
  color: var(--color-dark);
  text-align: center;
  margin-bottom: 18px;
}

.form-wrapper-acc form input {
  padding: 10px 6px;
  font-size: 16px;
  margin-bottom: 7px;
}

.form-wrapper-acc form button {
  padding: 15px 6px;
  max-width: 250px;
  width: 100%;
  color: var(--color-white);
  font-size: 14px;
  margin-bottom: 7px;
  background-color: var(--color-dark);
  transition: all 0.3s ease-in-out;
  border-radius: var(--border-radius-1);
}

.form-wrapper-acc form button:hover {
  background-color: var(--color-primary);
}

h3 {
  font-size: 22px;
  color: var(--color-dark);
  font-weight: 500;
}
/* ACCOUnt ACTIVATE */

/***** LOADER AJAX *****/
.it-wrp {
  position: relative;
}
.form-area,
.table-area {
  width: 100%;
  position: relative;
  opacity: 1;
  pointer-events: all;
  transition: all 0.5s ease-in-out;
}
.it-wrp.active,
.table-area.active,
.form-area.active {
  opacity: 0.6;
  pointer-events: none;
}
.loader-ajax {
  border: 10px solid #e6e6e6;
  border-radius: 50%;
  border-top: 10px solid #3498db;
  width: 75px;
  height: 75px;
  -webkit-animation: spin 2s linear infinite; /* Safari */
  animation: spin 2s linear infinite;
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  transition: all 0.4s ease-in-out;
  visibility: 0;
  opacity: 0;
  z-index: 100;
}

.loader-ajax.active {
  visibility: visible;
  opacity: 1;
}

/* Safari */
@-webkit-keyframes spin {
  0% {
    -webkit-transform: rotate(0deg);
  }
  100% {
    -webkit-transform: rotate(360deg);
  }
}

@keyframes spin {
  0% {
    transform: rotate(0deg);
  }
  100% {
    transform: rotate(360deg);
  }
}

/***** End LOADER AJAX *****/

@media screen and (max-width: 465px) {
  header nav .header-actions {
    gap: 30px;
  }
  header nav .header-actions .profile-header .user-info {
    display: none !important;
  }

  header nav .header-actions .night-mode span {
    padding: 3px 10px;
    font-size: 15px;
    border-radius: 6px;
    color: var(--black);
    cursor: pointer;
  }

  .modal-photo-wrapper .modal-window {
    max-width: 300px;
  }
}

/***** Shine Loader *****/
.section-edit-wrapper {
  background-color: var(--color-white);
  border-radius: var(--border-radius-3);
  padding: 30px;
  margin-bottom: 40px;
}

.sec-lang {
  margin: 20px 0;
}

.lang-section {
  background-color: #f2f2f2;
  border-radius: var(--border-radius-3);
  padding: 30px;
  margin-bottom: 30px;
}
/***** End Shine Loader *****/

/* Modal CSS */

.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  background-color: rgba(0, 0, 0, 0.7);
  z-index: 1000;
  visibility: hidden;
  opacity: 0;
  transition: all 0.4s ease-in-out;
}
.modal-overlay._active {
  visibility: visible;
  opacity: 1;
}
/* .modal_animation {
  animation-duration: 3s;
  animation-name: slidein;
} */

/* @keyframes slidein {
  from {
    margin-left: 100%;
    width: 300%;
  }

  to {
    margin-left: 0%;
    width: 100%;
  }
} */

.modal-overlay .close-modal-window {
  position: absolute;
  top: 20px;
  right: 20px;
  color: var(--color-white);
  font-size: 40px;
  cursor: pointer;
  transition: all 0.3s ease-in-out;
}
.modal-body {
  transition: all 0.5s ease-in-out;
  top: -100%;
  transition-delay: 0.2s;
  position: absolute;
  opacity: 1;
  visibility: hidden;
}
.modal-overlay._active .modal-body {
  visibility: visible;
  opacity: 1;
  top: 20px;
}
.modal-overlay .close-modal-window:hover {
  transform: rotate(90deg);
  color: #ff8080;
}

/* MODAL WIDNOW */
/***** CONTACT MODAL WINDOW *****/
.search-modal-body,
.promo-modal-body {
  max-width: 800px;
  width: 100%;
  background-color: var(--color-white);
  border-radius: var(--border-radius-24);
  overflow: hidden;
  margin: 10px;
}

.search-modal-body .img-wrapper,
.promo-modal-body .img-wrapper {
  width: 30%;
  position: relative;
  padding: 0 0 66.25% 0;
}

.search-modal-body .img-wrapper img,
.promo-modal-body .img-wrapper img {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.search-modal-body .text-wrapper,
.promo-modal-body .text-wrapper {
  width: 70%;
  padding: 35px 5px;
  gap: 10px;
}

._lock {
  overflow: hidden;
}

@media (max-width: 992px) {
  .search-modal-body .text-wrapper,
  .promo-modal-body .text-wrapper {
    width: 100%;
  }
}

.search-modal-body .text-wrapper h2,
.promo-modal-body .text-wrapper h2 {
  font-size: 32px;
  font-weight: 400;
  line-height: var(--line-height-150);
  color: var(--color-dark-blue);
}

.search-modal-body .text-wrapper h4,
.promo-modal-body .text-wrapper h4 {
  font-size: 18px;
  font-weight: 300;
  line-height: var(--line-height-150);
  color: var(--text-color);
  margin-bottom: 15px;
}

.contact-form-popup,
.promo-form-popup {
  max-width: 95%;
  width: 100%;
  gap: 20px;
}

.contact-form-popup input,
.promo-form-popup input {
  width: 100%;
  background-color: #f2f2f2;
  border: none;
  padding: 15px 20px;
  border-radius: 30px;
  font-size: 17px;
  font-weight: 400;
  color: var(--black-color);
  outline: none;
}

.contact-form-popup .get-quote,
.promo-form-popup .get-quote {
  border: none;
  outline: none;
  color: #fff;
  background-color: var(--theme-color);
  font-size: 18px;
  line-height: 150%;
  transition: all 0.45s ease-in-out;
  margin-top: 10px;
  border-radius: 12px;
  padding: 10px;
}

.contact-form-popup .get-quote:hover,
.promo-form-popup .get-quote:hover {
  animation: none;
  background-color: var(--theme-color2);
}

/* End Modal CSS  */

/* Start Promo Modal */

.theme-bg-color {
  background-color: #ffffff;
}

.def-border-radius {
  border-radius: 30px;
}

.input-color {
  background-color: #eeeeee;
}

.default-padding {
  padding: 10px;
}

.img-radius-left {
  border-radius: 30px 0px 0px 30px;
}

.img-radius-right {
  border-radius: 0px 30px 30px 0px;
}

.modal-form {
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 10px;
}

.background-color-close-icon {
  background-color: gray;
  border-radius: 30px;
}

.search-modal-widget {
  display: flex !important;
  justify-content: center !important;
  align-items: center !important;
}

.actions_search {
  width: 100%;
  display: flex;
  justify-content: flex-end;
  align-items: flex-end;
}

.title-form {
  margin-bottom: 5%;
  padding-left: 8px !important;
}
/* End Promo Modal */
/* 
.frm-section {
  width: 500px;
}

@media (min-width: 768px) {
  .frm-section {
    width: 270px;
  }
} */

.search-form-admin .frm-section {
  margin: 10px;
  width: 300px;
}

@media (max-width: 768px) {
  .search-form-admin .frm-section {
    width: 100% !important ;
  }
}

/* Edit mode — save notification toast */
.edit-notification {
  position: fixed;
  bottom: 24px;
  right: 24px;
  min-width: 240px;
  max-width: 360px;
  padding: 14px 20px;
  border-radius: var(--border-radius-2);
  font-size: 14px;
  font-weight: 600;
  color: #fff;
  background-color: var(--color-dark);
  z-index: 99999;
  opacity: 0;
  transform: translateY(12px);
  transition: opacity 0.3s ease-in-out, transform 0.3s ease-in-out;
  pointer-events: none;
}

.edit-notification--visible {
  opacity: 1;
  transform: translateY(0);
}

.edit-notification--success {
  background-color: var(--color-valid);
}

.edit-notification--error {
  background-color: var(--color-invalid);
}

/* ================================================================
   EDIT MODE PREMIUM DESIGN SYSTEM
   ================================================================ */

/* --- Design tokens --- */
#edit-sdb,
.em-notification,
header.header,
#edit-frame,
.em-diff-modal,
.em-confirm-modal,
.em-device-toolbar,
.em-page-navigator {
  --em-accent:       #5b6cf9;
  --em-accent-hover: #4756e8;
  --em-accent-light: rgba(91, 108, 249, 0.08);
  --em-success:      #10b981;
  --em-error:        #f43f5e;
  --em-warning:      #f59e0b;
  --em-bg:           #ffffff;
  --em-bg-2:         #f8f9fe;
  --em-border:       rgba(91, 108, 249, 0.12);
  --em-border-strong: rgba(91, 108, 249, 0.28);
  --em-text:         #1a1d2e;
  --em-text-muted:   #6b7280;
  --em-shadow:       -8px 0 56px rgba(26, 29, 46, 0.14);
  --em-radius:       14px;
  --em-radius-sm:    8px;
  --em-sidebar-w:    440px;
  --em-topbar-h:     58px;
  --em-transition:   0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

/* expose to :root for iframe height calc */
:root {
  --em-topbar-h: 58px;
  --em-sidebar-w: 440px;
}

/* ===== TOPBAR ===== */
header.header {
  height: var(--em-topbar-h);
  background: rgba(255, 255, 255, 0.97) !important;
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid rgba(91, 108, 249, 0.12);
  box-shadow: 0 1px 32px rgba(91, 108, 249, 0.07);
  padding: 0 28px;
}

.em-brand-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--em-accent);
  display: inline-block;
  box-shadow: 0 0 0 3px rgba(91, 108, 249, 0.2);
  flex-shrink: 0;
}

.em-brand-label {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--em-text);
}

.em-page-navigator {
  position: relative;
  flex-shrink: 0;
}

.em-page-nav-btn {
  height: 34px;
  min-width: 150px;
  max-width: 260px;
  padding: 0 12px;
  border-radius: var(--em-radius-sm);
  border: 1.5px solid rgba(91, 108, 249, 0.16);
  background: rgba(91, 108, 249, 0.06);
  color: var(--em-text);
  display: inline-flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  font-size: 12px;
  font-weight: 650;
  line-height: 1;
  cursor: pointer;
  font-family: inherit;
  white-space: nowrap;
  transition: background 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
}

.em-page-nav-btn span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
}

.em-page-nav-btn i {
  color: var(--em-accent);
  font-size: 14px;
  flex-shrink: 0;
}

.em-page-nav-btn:hover,
.em-page-navigator--open .em-page-nav-btn {
  background: rgba(91, 108, 249, 0.10);
  border-color: rgba(91, 108, 249, 0.30);
  box-shadow: 0 2px 12px rgba(91, 108, 249, 0.12);
}

.em-page-nav-chevron {
  transition: transform 0.16s ease;
}

.em-page-navigator--open .em-page-nav-chevron {
  transform: rotate(180deg);
}

.em-page-nav-menu {
  position: absolute;
  top: calc(100% + 9px);
  left: 0;
  z-index: 220;
  width: min(340px, calc(100vw - 32px));
  max-height: calc(100vh - var(--em-topbar-h, 58px) - 28px);
  overflow-y: auto;
  background: var(--em-bg);
  border: 1px solid var(--em-border);
  border-radius: var(--em-radius-sm);
  box-shadow: 0 18px 48px rgba(26, 29, 46, 0.16);
  padding: 8px;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-4px);
  transition: opacity 0.14s ease, transform 0.14s ease, visibility 0.14s ease;
}

.em-page-navigator--open .em-page-nav-menu {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.em-page-nav-group + .em-page-nav-group {
  border-top: 1px solid var(--em-border);
  margin-top: 8px;
  padding-top: 8px;
}

.em-page-nav-group-title {
  padding: 6px 9px 5px;
  color: var(--em-text-muted);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.em-page-nav-item {
  width: 100%;
  min-height: 34px;
  padding: 8px 9px;
  border-radius: 7px;
  border: none;
  background: transparent;
  color: var(--em-text);
  display: flex;
  align-items: center;
  text-align: left;
  font-family: inherit;
  font-size: 12px;
  font-weight: 600;
  line-height: 1.35;
  cursor: pointer;
}

.em-page-nav-item:hover {
  background: rgba(91, 108, 249, 0.08);
  color: var(--em-accent);
}

.em-page-nav-state {
  padding: 12px 10px;
  color: var(--em-text-muted);
  font-size: 12px;
  line-height: 1.4;
}

.em-toggle-btn {
  height: 38px;
  padding: 0 18px;
  border-radius: 20px;
  background: rgba(91, 108, 249, 0.08);
  border: 1.5px solid rgba(91, 108, 249, 0.18);
  color: var(--em-accent);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--em-transition);
  line-height: 1;
}

.em-toggle-btn:hover,
.em-toggle-btn[data-active="true"] {
  background: var(--em-accent);
  color: #fff;
  border-color: var(--em-accent);
  box-shadow: 0 4px 16px rgba(91, 108, 249, 0.32);
}

.em-exit-btn {
  height: 36px;
  padding: 0 14px;
  border-radius: var(--em-radius-sm);
  background: transparent;
  border: 1.5px solid rgba(244, 63, 94, 0.2);
  color: #f43f5e;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--em-transition);
  text-decoration: none;
}

.em-exit-btn:hover {
  background: rgba(244, 63, 94, 0.07);
  border-color: #f43f5e;
  color: #f43f5e;
}

/* ===== SIDEBAR — LEFT PANEL ===== */
#edit-sdb.sidebar {
  position: fixed !important;
  top: 0 !important;
  left: calc(-1 * (var(--em-sidebar-w) + 60px)) !important;
  right: auto !important;
  width: var(--em-sidebar-w) !important;
  height: 100% !important;
  background: var(--em-bg) !important;
  background-color: var(--em-bg) !important;
  border-right: 1px solid var(--em-border) !important;
  border-left: none !important;
  box-shadow: 8px 0 56px rgba(26, 29, 46, 0.14) !important;
  z-index: 201 !important;
  display: flex !important;
  flex-direction: column !important;
  padding: 0 !important;
  transition: left var(--em-transition) !important;
  overflow: hidden !important;
}

#edit-sdb.sidebar._active {
  left: 0 !important;
  right: auto !important;
}

/* Sidebar header */
.em-sidebar-header {
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: space-between;
  padding: 18px 24px;
  border-bottom: 1px solid var(--em-border);
  background: var(--em-bg-2);
  flex-shrink: 0;
}

.em-sidebar-header-left {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.em-element-tag {
  display: inline-flex;
  align-items: center;
  height: 20px;
  padding: 0 9px;
  border-radius: 5px;
  background: rgba(91, 108, 249, 0.08);
  color: var(--em-accent);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  width: fit-content;
  border: 1px solid rgba(91, 108, 249, 0.18);
}

.em-sidebar-title-group {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.em-sidebar-title {
  font-size: 15px;
  font-weight: 600;
  color: var(--em-text);
  line-height: 1.3;
}

.em-sidebar-lang {
  font-size: 11px;
  font-weight: 500;
  color: var(--em-accent);
  letter-spacing: 0.02em;
  opacity: 0.85;
}

.em-close-btn {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: transparent;
  border: 1.5px solid var(--em-border);
  color: var(--em-text-muted);
  font-size: 12px;
  cursor: pointer;
  transition: all var(--em-transition);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.em-close-btn:hover {
  background: rgba(244, 63, 94, 0.07);
  border-color: rgba(244, 63, 94, 0.4);
  color: #f43f5e;
}

/* Sidebar scrollable body */
.em-sidebar-body {
  flex: 1;
  overflow-y: auto;
  padding: 24px;
  scrollbar-width: thin;
  scrollbar-color: rgba(91, 108, 249, 0.15) transparent;
}

.em-sidebar-body::-webkit-scrollbar { width: 4px; }
.em-sidebar-body::-webkit-scrollbar-track { background: transparent; }
.em-sidebar-body::-webkit-scrollbar-thumb {
  background: rgba(91, 108, 249, 0.18);
  border-radius: 4px;
}

/* Sidebar fixed footer */
.em-sidebar-footer {
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
  padding: 12px 20px;
  border-top: 1px solid var(--em-border);
  background: var(--em-bg-2);
  flex-shrink: 0;
}

/* ===== FORM ===== */
.em-form {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.em-form label {
  display: block;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--em-text-muted);
  margin-bottom: 5px;
}

.em-form textarea,
.em-form input[type="text"],
.em-form select {
  display: block;
  width: 100%;
  padding: 11px 14px;
  border-radius: var(--em-radius-sm);
  border: 1.5px solid rgba(91, 108, 249, 0.15);
  background: var(--em-bg);
  color: var(--em-text);
  font-size: 14px;
  font-family: "Montserrat", sans-serif;
  line-height: 1.5;
  transition: border-color var(--em-transition), box-shadow var(--em-transition);
  outline: none;
  -webkit-appearance: none;
  box-sizing: border-box;
}

.em-form textarea {
  height: 110px;
  resize: vertical;
  min-height: 70px;
}

.em-form textarea:focus,
.em-form input[type="text"]:focus,
.em-form select:focus {
  border-color: var(--em-accent);
  box-shadow: 0 0 0 3px rgba(91, 108, 249, 0.1);
}

/* Image preview */
.em-image-preview {
  display: block;
  width: 100%;
  height: 140px;
  object-fit: cover;
  border-radius: var(--em-radius-sm);
  border: 1.5px solid rgba(91, 108, 249, 0.12);
  background: var(--em-bg-2);
  margin-top: 8px;
}

/* ===== VIDEO FORM ===== */
.em-video-preview-wrap {
  width: 100%;
  aspect-ratio: 16 / 9;
  border-radius: var(--em-radius-sm);
  overflow: hidden;
  border: 1.5px solid rgba(14, 165, 233, 0.18);
  background: #000;
  margin-top: 8px;
}

.em-video-preview {
  width: 100%;
  height: 100%;
  border: 0;
  display: block;
}

.em-video-url-status {
  font-size: 11px;
  font-weight: 600;
  min-height: 18px;
  margin-top: 5px;
  transition: color 0.18s ease;
}

.em-video-url-ok  { color: #10b981; }
.em-video-url-err { color: #f43f5e; }

/* Choose file button */
.em-btn-choose {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  padding: 10px 14px;
  border-radius: var(--em-radius-sm);
  border: 1.5px dashed rgba(91, 108, 249, 0.25);
  background: var(--em-bg-2);
  color: var(--em-accent);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--em-transition);
  margin-top: 8px;
  font-family: "Montserrat", sans-serif;
}

.em-btn-choose:hover {
  border-color: var(--em-accent);
  background: rgba(91, 108, 249, 0.06);
}

/* Link destination hint */
.em-link-hint {
  font-size: 11px;
  color: var(--em-text-muted);
  padding: 7px 11px;
  background: var(--em-bg-2);
  border-radius: var(--em-radius-sm);
  border: 1px solid rgba(91, 108, 249, 0.1);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-top: 4px;
}

/* ===== BUTTONS ===== */
.em-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  height: 40px;
  padding: 0 20px;
  border-radius: 20px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--em-transition);
  border: 1.5px solid transparent;
  white-space: nowrap;
  outline: none;
  flex-shrink: 0;
  font-family: "Montserrat", sans-serif;
}

.em-btn-primary {
  background: var(--em-accent);
  color: #fff;
  border-color: var(--em-accent);
}

.em-btn-primary:hover:not(:disabled) {
  background: var(--em-accent-hover);
  border-color: var(--em-accent-hover);
  box-shadow: 0 4px 16px rgba(91, 108, 249, 0.3);
}

.em-btn-primary:disabled {
  opacity: 0.65;
  cursor: not-allowed;
}

.em-btn-ghost {
  background: transparent;
  color: var(--em-text-muted);
  border-color: rgba(91, 108, 249, 0.14);
}

.em-btn-ghost:hover:not(:disabled) {
  background: var(--em-bg-2);
  color: var(--em-text);
  border-color: rgba(91, 108, 249, 0.24);
}

.em-btn-ghost:disabled {
  opacity: 0.42;
  cursor: not-allowed;
  pointer-events: none;
}

.em-btn-sm {
  height: 34px;
  padding: 0 13px;
  font-size: 12px;
  border-radius: 17px;
  gap: 5px;
}

/* Save button state-based visuals */
.em-btn-save .em-save-icon-check { display: none; }
.em-btn-save .em-save-spinner    { display: none; }

.em-btn-save[data-state="loading"] .em-save-label  { display: none; }
.em-btn-save[data-state="loading"] .em-save-spinner {
  display: inline-block;
  width: 14px;
  height: 14px;
  border: 2px solid rgba(255, 255, 255, 0.35);
  border-top-color: #fff;
  border-radius: 50%;
  animation: em-spin 0.65s linear infinite;
}
.em-btn-save[data-state="loading"] { opacity: 0.8; cursor: wait; }

.em-btn-save[data-state="success"] {
  background: var(--em-success);
  border-color: var(--em-success);
}
.em-btn-save[data-state="success"] .em-save-label      { display: none; }
.em-btn-save[data-state="success"] .em-save-icon-check { display: inline; }

.em-btn-save[data-state="error"] {
  background: var(--em-error);
  border-color: var(--em-error);
}

@keyframes em-spin {
  to { transform: rotate(360deg); }
}

/* ===== NOTIFICATION TOAST ===== */
.em-notification {
  position: fixed;
  top: calc(var(--em-topbar-h, 58px) + 16px);
  right: 28px;
  bottom: auto;
  min-width: 280px;
  max-width: 400px;
  padding: 14px 18px;
  border-radius: 14px;
  color: #fff;
  background: #1a1d2e;
  z-index: 99999;
  opacity: 0;
  transform: translateY(-18px);
  transition: opacity 0.3s ease, transform 0.3s ease;
  pointer-events: none;
  box-shadow: 0 8px 40px rgba(26, 29, 46, 0.24);
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 14px;
}

.em-notification--visible {
  opacity: 1;
  transform: translateY(0);
}

.em-notification--success { background: var(--em-success); }
.em-notification--error   { background: var(--em-error); }
.em-notification--warning { background: var(--em-warning); }

/* Toast inner structure */
.em-toast-icon {
  flex-shrink: 0;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.18);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 15px;
  font-weight: 700;
}

.em-toast-body {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.em-toast-title {
  font-size: 13px;
  font-weight: 700;
  color: #fff;
  line-height: 1.2;
  display: block;
}

.em-toast-msg {
  font-size: 12px;
  font-weight: 400;
  color: rgba(255, 255, 255, 0.82);
  line-height: 1.35;
  display: block;
}

/* ===== IFRAME ===== */
#edit-frame {
  width: 100%;
  height: calc(100vh - var(--em-topbar-h, 58px));
  border: none;
  display: block;
  transition: height 0.28s ease;
}

/* ===== DEVICE PREVIEW TOOLBAR ===== */
.em-device-toolbar {
  display: flex;
  align-items: center;
  gap: 3px;
  background: rgba(91, 108, 249, 0.06);
  border: 1px solid rgba(91, 108, 249, 0.14);
  border-radius: 10px;
  padding: 4px;
}

.em-device-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  height: 30px;
  padding: 0 12px;
  border-radius: 7px;
  border: none;
  background: transparent;
  color: #6b7280;
  font-size: 11.5px;
  font-weight: 600;
  cursor: pointer;
  letter-spacing: 0.025em;
  transition: background 0.15s ease, color 0.15s ease, box-shadow 0.15s ease;
  white-space: nowrap;
  font-family: inherit;
  line-height: 1;
}

.em-device-btn i {
  font-size: 13px;
  line-height: 1;
  flex-shrink: 0;
}

.em-device-btn:hover {
  background: rgba(91, 108, 249, 0.09);
  color: #5b6cf9;
}

.em-device-btn.active {
  background: #5b6cf9;
  color: #fff;
  box-shadow: 0 2px 10px rgba(91, 108, 249, 0.30);
}

/* ===== PREVIEW CANVAS ===== */
.preview-canvas {
  position: relative; /* anchor for the absolute loader overlay */
  overflow-x: hidden;
  transition: background 0.28s ease, padding 0.28s ease;
}

/* Tablet and Mobile canvas — grey background, centered */
.preview-canvas.em-canvas--tablet,
.preview-canvas.em-canvas--mobile {
  display: flex;
  flex-direction: column;
  align-items: center;
  background: #d9dce6;
  padding: 28px 20px 52px;
  min-height: calc(100vh - var(--em-topbar-h, 58px));
}

/* ===== DEVICE FRAME ===== */
.preview-device-frame {
  transition:
    width 0.28s ease,
    max-width 0.28s ease,
    border-radius 0.28s ease,
    box-shadow 0.28s ease;
}

/* Desktop — full width, no visual frame */
.preview-device-frame.desktop {
  width: 100%;
}

/* Tablet — 768 px with dark bezel */
.preview-device-frame.tablet {
  width: 768px;
  max-width: calc(100% - 32px);
  flex-shrink: 0;
  border-radius: 14px;
  overflow: hidden;
  box-shadow:
    0 0 0 8px #1e2235,
    0 0 0 9px #2e3250,
    0 20px 64px rgba(0, 0, 0, 0.30);
}

/* Mobile — 390 px with phone bezel */
.preview-device-frame.mobile {
  width: 390px;
  max-width: calc(100% - 32px);
  flex-shrink: 0;
  border-radius: 46px;
  overflow: hidden;
  box-shadow:
    0 0 0 10px #1e2235,
    0 0 0 11px #2e3250,
    0 24px 72px rgba(0, 0, 0, 0.32);
}

/* iframe height inside framed modes */
.preview-device-frame.tablet #edit-frame,
.preview-device-frame.mobile #edit-frame {
  height: calc(100vh - var(--em-topbar-h, 58px) - 80px) !important;
  min-height: 500px;
}

/* ===== OVERLAY ===== */
.page-dark-overlay._active {
  z-index: 200;
  background-color: rgba(26, 29, 46, 0.28);
}

/* ===== DARK MODE ===== */
.dark-theme-variables #edit-sdb.sidebar,
.dark-theme-variables .em-sidebar-header,
.dark-theme-variables .em-sidebar-body,
.dark-theme-variables .em-sidebar-footer {
  --em-bg:       #1a1d2e;
  --em-bg-2:     #1f2237;
  --em-border:   rgba(91, 108, 249, 0.18);
  --em-text:     #e8eaf6;
  --em-text-muted: #8892b0;
}

.dark-theme-variables header.header {
  background: rgba(26, 29, 46, 0.97) !important;
  border-bottom-color: rgba(91, 108, 249, 0.18);
}

.dark-theme-variables .em-device-toolbar {
  background: rgba(91, 108, 249, 0.10);
  border-color: rgba(91, 108, 249, 0.22);
}

.dark-theme-variables .em-device-btn {
  color: #8892b0;
}

.dark-theme-variables .em-device-btn:hover {
  background: rgba(91, 108, 249, 0.15);
  color: #a0abff;
}

.dark-theme-variables .preview-canvas.em-canvas--tablet,
.dark-theme-variables .preview-canvas.em-canvas--mobile {
  background: #141625;
}

/* ===== RESPONSIVE ===== */
@media (max-width: 1380px) {
  #edit-sdb.sidebar {
    --em-sidebar-w: 400px !important;
    left: calc(-1 * (400px + 60px)) !important;
    right: auto !important;
    width: 400px !important;
  }
}

@media (max-width: 900px) {
  #edit-sdb.sidebar {
    --em-sidebar-w: 100vw !important;
    left: -100vw !important;
    right: auto !important;
    width: 100vw !important;
  }
  #edit-sdb.sidebar._active { left: 0 !important; right: auto !important; }

  .em-topbar-brand .em-brand-label { display: none; }
  .em-exit-btn span { display: none; }
  .em-page-nav-btn {
    min-width: 42px;
    width: 42px;
    padding: 0;
    justify-content: center;
  }
  .em-page-nav-btn span,
  .em-page-nav-chevron {
    display: none;
  }
  /* Compact device toolbar on small screens */
  .em-device-btn span { display: none; }
  .em-device-btn { padding: 0 9px; }
}

/* ===== ANIMATIONS ===== */

@keyframes em-form-fadein {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: translateY(0); }
}
.em-form.em-form-anim {
  animation: em-form-fadein 0.28s ease forwards;
}

@keyframes em-body-slide {
  from { opacity: 0; transform: translateX(-12px); }
  to   { opacity: 1; transform: translateX(0); }
}
#edit-sdb._active .em-sidebar-body {
  animation: em-body-slide 0.3s 0.1s ease both;
}

.em-form.is-saving {
  opacity: 0.55;
  pointer-events: none;
  transition: opacity 0.2s ease;
}

/* ===== SIDEBAR TABS ===== */
.em-sidebar-tabs {
  display: flex;
  flex-direction: row;
  border-bottom: 1px solid var(--em-border);
  background: var(--em-bg-2);
  flex-shrink: 0;
}

.em-tab {
  flex: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  height: 42px;
  padding: 0 16px;
  font-size: 12px;
  font-weight: 600;
  color: var(--em-text-muted);
  background: transparent;
  border: none;
  border-bottom: 2px solid transparent;
  cursor: pointer;
  transition: color var(--em-transition), border-color var(--em-transition);
  font-family: "Montserrat", sans-serif;
  position: relative;
  bottom: -1px;
}

.em-tab:hover {
  color: var(--em-text);
}

.em-tab--active {
  color: var(--em-accent);
  border-bottom-color: var(--em-accent);
}

.em-history-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 9px;
  background: var(--em-accent);
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  line-height: 1;
}

/* History panel — same as edit body, hidden by default */
.em-history-panel {
  display: none;
}

/* ===== HISTORY CARDS ===== */
.em-history-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.em-history-loading,
.em-history-empty {
  text-align: center;
  color: var(--em-text-muted);
  font-size: 13px;
  padding: 32px 16px;
  line-height: 1.5;
}

.em-history-card {
  border: 1px solid var(--em-border);
  border-radius: var(--em-radius-sm);
  background: var(--em-bg);
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  transition: border-color var(--em-transition), box-shadow var(--em-transition);
}

.em-history-card:hover {
  border-color: rgba(91, 108, 249, 0.3);
  box-shadow: var(--em-shadow-sm);
}

.em-history-card--restored {
  opacity: 0.65;
}

.em-history-card-header {
  display: flex;
  flex-direction: row;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
}

.em-history-meta {
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 0;
}

.em-history-date {
  font-size: 13px;
  font-weight: 700;
  color: var(--em-text);
  line-height: 1.2;
}

.em-history-user {
  font-size: 11px;
  color: var(--em-accent);
  font-weight: 600;
}

.em-history-ip {
  font-size: 10px;
  color: var(--em-text-muted);
  font-family: monospace;
}

.em-history-badge {
  display: inline-flex;
  align-items: center;
  height: 20px;
  padding: 0 8px;
  border-radius: 4px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  flex-shrink: 0;
}

.em-history-badge--latest {
  background: rgba(91, 108, 249, 0.1);
  color: var(--em-accent);
  border: 1px solid rgba(91, 108, 249, 0.2);
}

.em-history-badge--restored {
  background: rgba(245, 158, 11, 0.1);
  color: #d97706;
  border: 1px solid rgba(245, 158, 11, 0.2);
}

.em-history-fields {
  display: flex;
  flex-direction: row;
  flex-wrap: wrap;
  gap: 5px;
}

.em-field-badge {
  display: inline-flex;
  align-items: center;
  height: 20px;
  padding: 0 8px;
  border-radius: 4px;
  background: var(--em-bg-2);
  border: 1px solid var(--em-border);
  color: var(--em-text-muted);
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.em-history-actions {
  display: flex;
  flex-direction: row;
  gap: 8px;
}

.em-btn-hist {
  flex: 1;
  height: 32px;
  padding: 0 12px;
  border-radius: var(--em-radius-sm);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--em-transition);
  border: 1.5px solid var(--em-border);
  background: transparent;
  color: var(--em-text-muted);
  font-family: "Montserrat", sans-serif;
}

.em-btn-hist:hover {
  background: var(--em-bg-2);
  color: var(--em-text);
  border-color: rgba(91, 108, 249, 0.25);
}

.em-btn-hist-restore {
  color: var(--em-accent);
  border-color: rgba(91, 108, 249, 0.25);
}

.em-btn-hist-restore:hover {
  background: rgba(91, 108, 249, 0.08);
  border-color: var(--em-accent);
  color: var(--em-accent);
}

/* ===== DIFF MODAL ===== */
.em-diff-modal {
  position: fixed;
  inset: 0;
  z-index: 300;
  display: flex;
  align-items: center;
  justify-content: center;
  visibility: hidden;
  opacity: 0;
  transition: opacity 0.25s ease, visibility 0.25s ease;
}

.em-diff-modal--visible {
  visibility: visible;
  opacity: 1;
}

.em-diff-overlay {
  position: absolute;
  inset: 0;
  background: rgba(26, 29, 46, 0.55);
  cursor: pointer;
}

.em-diff-panel {
  position: relative;
  z-index: 1;
  width: min(840px, calc(100vw - 48px));
  max-height: calc(100vh - 64px);
  background: var(--em-bg);
  border-radius: var(--em-radius);
  box-shadow: 0 24px 80px rgba(26, 29, 46, 0.22);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  animation: em-modal-in 0.28s ease;
}

@keyframes em-modal-in {
  from { transform: scale(0.94) translateY(12px); opacity: 0; }
  to   { transform: scale(1)    translateY(0);    opacity: 1; }
}

.em-diff-header {
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: space-between;
  padding: 18px 24px;
  border-bottom: 1px solid var(--em-border);
  flex-shrink: 0;
  background: var(--em-bg-2);
}

.em-diff-title {
  font-size: 15px;
  font-weight: 700;
  color: var(--em-text);
}

.em-diff-close {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 1.5px solid var(--em-border);
  background: transparent;
  color: var(--em-text-muted);
  font-size: 12px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--em-transition);
}

.em-diff-close:hover {
  background: rgba(244, 63, 94, 0.07);
  border-color: rgba(244, 63, 94, 0.4);
  color: #f43f5e;
}

.em-diff-body {
  flex: 1;
  overflow-y: auto;
  padding: 20px 24px;
  display: flex;
  flex-direction: column;
  gap: 20px;
  scrollbar-width: thin;
  scrollbar-color: rgba(91, 108, 249, 0.15) transparent;
}

.em-diff-field {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.em-diff-field-label {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--em-text-muted);
}

.em-diff-cols {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

@media (max-width: 600px) {
  .em-diff-cols { grid-template-columns: 1fr; }
}

.em-diff-col {
  border-radius: var(--em-radius-sm);
  padding: 12px 14px;
  min-height: 56px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.em-diff-old {
  background: rgba(244, 63, 94, 0.05);
  border: 1px solid rgba(244, 63, 94, 0.18);
}

.em-diff-new {
  background: rgba(16, 185, 129, 0.05);
  border: 1px solid rgba(16, 185, 129, 0.18);
}

.em-diff-col-label {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.07em;
}

.em-diff-old .em-diff-col-label { color: #f43f5e; }
.em-diff-new .em-diff-col-label { color: var(--em-success); }

.em-diff-text {
  font-size: 13px;
  line-height: 1.55;
  color: var(--em-text);
  word-break: break-word;
  white-space: pre-wrap;
}

/* ===== IMAGE DIFF IN MODAL ===== */
.em-diff-field--image .em-diff-cols {
  align-items: stretch;
}

.em-diff-img-wrap {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.em-diff-img {
  width: 100%;
  max-height: 220px;
  object-fit: cover;
  border-radius: 6px;
  border: 1px solid rgba(0, 0, 0, 0.07);
  display: block;
  background: #f3f4f6;
}

.em-diff-img-placeholder {
  height: 120px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #f3f4f6;
  border-radius: 6px;
  border: 1px dashed #d1d5db;
  font-size: 12px;
  color: #9ca3af;
  font-style: italic;
}

.em-diff-img-path {
  font-size: 10.5px;
  color: #6b7280;
  word-break: break-all;
  padding: 4px 7px;
  background: rgba(0, 0, 0, 0.03);
  border-radius: 4px;
  font-family: "Courier New", monospace;
  line-height: 1.5;
}

/* ===== IMAGE THUMBNAILS IN HISTORY CARDS ===== */
.em-hist-thumb-row {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 8px;
  padding: 8px 0 2px;
}

.em-hist-thumb-wrap {
  flex: 1;
  min-width: 0;
}

.em-hist-thumb {
  width: 100%;
  height: 54px;
  object-fit: cover;
  border-radius: 5px;
  border: 1px solid rgba(0, 0, 0, 0.07);
  display: block;
  background: #f3f4f6;
}

.em-hist-thumb--empty {
  height: 54px;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #f3f4f6;
  border-radius: 5px;
  border: 1px dashed #d1d5db;
  font-size: 18px;
  color: #d1d5db;
}

.em-hist-thumb-arrow {
  font-size: 13px;
  color: #9ca3af;
  flex-shrink: 0;
  user-select: none;
}

/* ===== CONFIRM MODAL ===== */
.em-confirm-modal {
  position: fixed;
  inset: 0;
  z-index: 400;
  display: flex;
  align-items: center;
  justify-content: center;
  visibility: hidden;
  opacity: 0;
  transition: opacity 0.2s ease, visibility 0.2s ease;
}

.em-confirm-modal--visible {
  visibility: visible;
  opacity: 1;
}

.em-confirm-overlay {
  position: absolute;
  inset: 0;
  background: rgba(26, 29, 46, 0.52);
  backdrop-filter: blur(3px);
  cursor: pointer;
}

.em-confirm-card {
  position: relative;
  z-index: 1;
  width: min(420px, calc(100vw - 40px));
  background: #ffffff;
  border-radius: 16px;
  box-shadow: 0 20px 60px rgba(26, 29, 46, 0.18), 0 4px 16px rgba(26, 29, 46, 0.08);
  padding: 32px 28px 24px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  text-align: center;
  animation: em-modal-in 0.22s ease;
}

.em-confirm-icon-wrap {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: rgba(91, 108, 249, 0.08);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  margin-bottom: 4px;
  flex-shrink: 0;
}

.em-confirm-icon-wrap--warning {
  background: rgba(245, 158, 11, 0.1);
}

.em-confirm-title {
  font-size: 17px;
  font-weight: 700;
  color: #1a1d2e;
  line-height: 1.3;
}

.em-confirm-desc {
  font-size: 13.5px;
  line-height: 1.6;
  color: #6b7280;
  max-width: 340px;
}

.em-confirm-actions {
  display: flex;
  flex-direction: row;
  gap: 10px;
  margin-top: 8px;
  width: 100%;
}

.em-confirm-btn {
  flex: 1;
  height: 40px;
  border-radius: 9px;
  font-size: 13.5px;
  font-weight: 600;
  cursor: pointer;
  border: 1.5px solid transparent;
  transition: all 0.18s ease;
  font-family: "Montserrat", sans-serif;
}

.em-confirm-cancel {
  background: #f3f4f6;
  color: #374151;
  border-color: #e5e7eb;
}

.em-confirm-cancel:hover {
  background: #e5e7eb;
  border-color: #d1d5db;
}

.em-confirm-ok {
  background: #5b6cf9;
  color: #ffffff;
  border-color: #5b6cf9;
}

.em-confirm-ok:hover {
  background: #4756e8;
  border-color: #4756e8;
}

.em-confirm-ok--danger {
  background: #f43f5e;
  border-color: #f43f5e;
}

.em-confirm-ok--danger:hover {
  background: #e11d48;
  border-color: #e11d48;
}

/* Image block form sections */
.em-image-block-section {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.em-image-block-heading {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: #f97316;
}

.em-form-separator {
  border: none;
  border-top: 1px solid #e5e7eb;
  margin: 10px 0 2px;
}

/* ===== LIVE TEXT PREVIEW ===== */
.em-preview-section {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 4px;
}

.em-preview-label {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--em-text-muted);
}

.em-preview-card {
  border: 1.5px solid var(--em-border);
  border-radius: var(--em-radius-sm);
  background: #ffffff;
  padding: 18px 20px;
  min-height: 60px;
  max-height: 200px;
  overflow-y: auto;
  box-shadow: 0 2px 12px rgba(26, 29, 46, 0.06);
  scrollbar-width: thin;
  scrollbar-color: rgba(91, 108, 249, 0.15) transparent;
  /* Extra right padding so text doesn't sit against the scrollbar */
  padding-right: 12px;
}

.em-preview-card::-webkit-scrollbar { width: 4px; }
.em-preview-card::-webkit-scrollbar-track { background: transparent; }
.em-preview-card::-webkit-scrollbar-thumb {
  background: rgba(91, 108, 249, 0.18);
  border-radius: 4px;
}

.em-preview-inner {
  word-break: break-word;
  white-space: pre-wrap;
  max-width: 100%;
  /* font-* overridden inline by JS from getComputedStyle */
  transition: opacity 0.15s ease;
}

/* ── Bootstrap Icon editor — quick-pick grid ── */
.em-icon-quick-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.em-icon-quick-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border: 1.5px solid var(--em-border);
  border-radius: var(--em-radius-sm);
  background: var(--em-surface);
  color: var(--em-text);
  font-size: 17px;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s, color 0.15s, box-shadow 0.15s;
}
.em-icon-quick-btn:hover {
  border-color: var(--em-accent);
  background: rgba(91, 108, 249, 0.07);
  color: var(--em-accent);
  box-shadow: 0 0 0 3px rgba(91, 108, 249, 0.10);
}

/* ── History card — icon diff row ── */
.em-hist-icon-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 0 4px;
  flex-wrap: wrap;
}

.em-hist-icon-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  min-width: 52px;
  font-size: 10px;
  color: var(--em-text-muted);
  letter-spacing: 0.03em;
}

.em-hist-icon-wrap i {
  font-size: 1.5rem;
  color: var(--em-text);
}

/* ===== DRAFT / PUBLISH WORKFLOW ===== */

/* --- Live/Draft preview mode toolbar (header) --- */
.em-preview-mode-toolbar {
  display: flex;
  align-items: center;
  gap: 3px;
  background: rgba(16, 185, 129, 0.06);
  border: 1px solid rgba(16, 185, 129, 0.18);
  border-radius: 10px;
  padding: 4px;
}

.em-preview-mode-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  height: 30px;
  padding: 0 12px;
  border-radius: 7px;
  border: none;
  background: transparent;
  color: #6b7280;
  font-size: 11.5px;
  font-weight: 600;
  cursor: pointer;
  letter-spacing: 0.025em;
  transition: background 0.15s ease, color 0.15s ease, box-shadow 0.15s ease;
  white-space: nowrap;
  font-family: inherit;
  line-height: 1;
}

.em-preview-mode-btn i {
  font-size: 13px;
  line-height: 1;
  flex-shrink: 0;
}

.em-preview-mode-btn:hover {
  background: rgba(16, 185, 129, 0.10);
  color: #059669;
}

.em-preview-mode-btn.active[data-preview="live"] {
  background: #10b981;
  color: #fff;
  box-shadow: 0 2px 10px rgba(16, 185, 129, 0.32);
}

.em-preview-mode-btn.active[data-preview="draft"] {
  background: #f59e0b;
  color: #fff;
  box-shadow: 0 2px 10px rgba(245, 158, 11, 0.32);
}

/* --- Draft status bar (sidebar) --- */
.em-draft-status-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 8px 20px;
  border-bottom: 1px solid var(--em-border);
  background: var(--em-bg-2);
  min-height: 40px;
}

.em-draft-status {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: 0.04em;
  border-radius: 20px;
  padding: 3px 10px 3px 7px;
  transition: color 0.2s ease, background 0.2s ease;
}

.em-status-dot {
  font-size: 7px !important;
  line-height: 1 !important;
}

/* Published / no draft */
.em-status--live {
  color: #059669;
  background: rgba(16, 185, 129, 0.10);
}

/* Unpublished draft exists */
.em-status--draft {
  color: #d97706;
  background: rgba(245, 158, 11, 0.12);
}

/* Loading */
.em-status--loading {
  color: var(--em-text-muted);
  background: rgba(107, 114, 128, 0.08);
}

/* Dirty — unsaved changes in form */
.em-status--dirty {
  color: var(--em-accent, #5b6cf9);
  background: rgba(91, 108, 249, 0.12);
}

/* Discard draft button */
.em-btn-discard {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  height: 26px;
  padding: 0 10px;
  border-radius: 6px;
  border: 1.5px solid rgba(244, 63, 94, 0.25);
  background: transparent;
  color: #f43f5e;
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease;
  font-family: inherit;
  white-space: nowrap;
}

.em-btn-discard:hover {
  background: rgba(244, 63, 94, 0.07);
  border-color: #f43f5e;
}

/* --- Save Draft button (sidebar footer) --- */
.em-btn-draft {
  background: rgba(91, 108, 249, 0.10) !important;
  border: 1.5px solid rgba(91, 108, 249, 0.22) !important;
  color: var(--em-accent) !important;
}

.em-btn-draft:hover:not(:disabled),
.em-btn-draft[data-state="loading"] {
  background: var(--em-accent) !important;
  color: #fff !important;
  border-color: var(--em-accent) !important;
}

.em-btn-draft:disabled {
  opacity: 0.42;
  cursor: not-allowed;
  pointer-events: none;
}

.em-btn-draft[data-state="success"] {
  background: #10b981 !important;
  color: #fff !important;
  border-color: #10b981 !important;
}

.em-btn-draft[data-state="error"] {
  background: #f43f5e !important;
  color: #fff !important;
  border-color: #f43f5e !important;
}

/* --- Publish button (sidebar footer) --- */
.em-btn-publish {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 38px;
  padding: 0 16px;
  border-radius: var(--em-radius-sm);
  border: 1.5px solid rgba(16, 185, 129, 0.28);
  background: rgba(16, 185, 129, 0.08);
  color: #059669;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--em-transition);
  font-family: inherit;
  white-space: nowrap;
}

.em-btn-publish:disabled {
  opacity: 0.38;
  cursor: not-allowed;
}

.em-btn-publish:not(:disabled):hover {
  background: #10b981;
  border-color: #10b981;
  color: #fff;
  box-shadow: 0 4px 16px rgba(16, 185, 129, 0.32);
}

/* --- Instant Publish button — filled/primary, strongest visual weight --- */
.em-btn-publish-instant {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 38px;
  padding: 0 16px;
  border-radius: var(--em-radius-sm);
  border: 1.5px solid #059669;
  background: #10b981;
  color: #fff;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  transition: all var(--em-transition);
  font-family: inherit;
  white-space: nowrap;
  box-shadow: 0 2px 10px rgba(16, 185, 129, 0.30);
}

.em-btn-publish-instant:hover:not(:disabled) {
  background: #059669;
  border-color: #047857;
  box-shadow: 0 4px 18px rgba(16, 185, 129, 0.42);
}

.em-btn-publish-instant:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

/* Footer action group — Save Draft + Publish grouped on the right */
.em-footer-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.em-footer-actions .em-btn {
  height: 36px;
  padding: 0 14px;
  font-size: 13px;
}

/* Wrap to next row only on very narrow viewports */
@media (max-width: 360px) {
  .em-sidebar-footer { justify-content: flex-end; }
  .em-footer-actions { width: 100%; }
  .em-footer-actions .em-btn-publish-instant { flex: 1; }
}

/* Dark mode overrides */
.dark-theme-variables .em-preview-mode-toolbar {
  background: rgba(16, 185, 129, 0.08);
  border-color: rgba(16, 185, 129, 0.22);
}

.dark-theme-variables .em-draft-status-bar {
  background: var(--em-bg-2);
  border-bottom-color: var(--em-border);
}

/* Responsive: hide button text for preview mode on small screens */
@media (max-width: 900px) {
  .em-preview-mode-btn span { display: none; }
  .em-preview-mode-btn { padding: 0 9px; }
}

/* ===== IFRAME PREVIEW LOADER ===== */
.em-preview-loader {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(237, 240, 255, 0.80);
  backdrop-filter: blur(3px);
  -webkit-backdrop-filter: blur(3px);
  z-index: 8888;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.28s ease;
  border-radius: inherit;
}

.em-preview-loader--visible {
  opacity: 1;
  pointer-events: auto;
}

/* Dual-ring spinner — reuses @keyframes em-spin defined above */
.em-preview-loader__ring {
  width: 50px;
  height: 50px;
  border-radius: 50%;
  border: 4px solid rgba(91, 108, 249, 0.15);
  border-top-color: #5b6cf9;
  animation: em-spin 0.72s linear infinite;
}

/* Dark theme override */
.dark-theme-variables .em-preview-loader {
  background: rgba(18, 20, 38, 0.82);
}

.dark-theme-variables .em-preview-loader__ring {
  border-color: rgba(91, 108, 249, 0.18);
  border-top-color: #a0abff;
}

/* ===== URL address-bar control ===== */

.editmode-url-control {
  position: relative;
  flex: 1 1 280px;
  min-width: 190px;
  max-width: 460px;
  height: 34px;
  display: flex;
  align-items: center;
  border: 1.5px solid rgba(91, 108, 249, 0.16);
  border-radius: var(--em-radius-sm);
  background: rgba(255, 255, 255, 0.92);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.8);
  transition: border-color 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
}

.editmode-url-control:focus-within {
  border-color: rgba(91, 108, 249, 0.45);
  box-shadow: 0 0 0 3px rgba(91, 108, 249, 0.10);
  background: #fff;
}

.editmode-url-icon {
  width: 32px;
  flex: 0 0 32px;
  color: var(--em-accent);
  font-size: 14px;
  text-align: center;
  line-height: 1;
}

.editmode-url-input {
  min-width: 0;
  flex: 1 1 auto;
  height: 100%;
  padding: 0 8px 0 0;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--color-dark);
  font-family: inherit;
  font-size: 12px;
  font-weight: 600;
  line-height: 34px;
}

.editmode-url-input::placeholder {
  color: #6b7280;
  opacity: 0.72;
}

.editmode-url-go {
  height: 28px;
  margin-right: 3px;
  padding: 0 10px;
  border: 0;
  border-radius: 7px;
  background: var(--em-accent);
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  font-family: inherit;
  font-size: 11.5px;
  font-weight: 700;
  line-height: 1;
  white-space: nowrap;
  cursor: pointer;
  transition: background 0.15s ease, box-shadow 0.15s ease;
}

.editmode-url-go:hover {
  background: var(--em-accent-hover);
  box-shadow: 0 2px 10px rgba(91, 108, 249, 0.24);
}

.editmode-url-go i {
  font-size: 13px;
  line-height: 1;
}

.editmode-url-error {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  z-index: 430;
  max-width: min(360px, calc(100vw - 32px));
  padding: 6px 9px;
  border-radius: 7px;
  background: #fff;
  border: 1px solid rgba(244, 63, 94, 0.22);
  color: #f43f5e;
  box-shadow: 0 10px 28px rgba(26, 29, 46, 0.14);
  font-size: 11.5px;
  font-weight: 600;
  line-height: 1.35;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-3px);
  transition: opacity 0.14s ease, transform 0.14s ease, visibility 0.14s ease;
}

.editmode-url-control--error {
  border-color: rgba(244, 63, 94, 0.48);
  box-shadow: 0 0 0 3px rgba(244, 63, 94, 0.08);
}

.editmode-url-control--error .editmode-url-error {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.dark-theme-variables .editmode-url-control,
.dark-theme-variables .editmode-url-error {
  background: var(--em-bg, #1a1d2e);
  border-color: var(--em-border, rgba(91, 108, 249, 0.12));
}

.dark-theme-variables .editmode-url-control:focus-within {
  border-color: var(--em-border-strong, rgba(91, 108, 249, 0.28));
}

@media (max-width: 900px) {
  .editmode-url-control {
    flex-basis: 160px;
    min-width: 120px;
  }
  .editmode-url-icon {
    width: 28px;
    flex-basis: 28px;
  }
  .editmode-url-go {
    width: 30px;
    padding: 0;
  }
  .editmode-url-go span {
    display: none;
  }
}

/* ===== UI (interface) language dropdown ===== */

.em-lang-dropdown {
  position: relative;
}

.em-lang-toggle {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  height: 34px;
  padding: 0 12px;
  border: 1px solid #e2e5ee;
  border-radius: 9px;
  background: #fff;
  color: var(--color-dark);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
  line-height: 1;
  white-space: nowrap;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.em-lang-toggle:hover {
  border-color: var(--color-primary);
}

.em-lang-toggle > .bi-translate {
  color: var(--color-primary);
  font-size: 14px;
}

.em-lang-chevron {
  font-size: 10px;
  color: #9aa2b1;
  transition: transform 0.15s ease;
}

.em-lang-menu {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  min-width: 190px;
  padding: 5px;
  background: #fff;
  border: 1px solid #e2e5ee;
  border-radius: 10px;
  box-shadow: 0 10px 32px rgba(17, 30, 136, 0.14);
  z-index: 400;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-4px);
  transition: all 0.15s ease;
}

.em-ui-lang-dropdown:hover .em-lang-menu,
.em-ui-lang-dropdown:focus-within .em-lang-menu {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.em-lang-dropdown._open .em-lang-menu {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.em-lang-dropdown._open .em-lang-chevron {
  transform: rotate(180deg);
}

/* Sidebar: "save for languages" checkbox pills */
.em-lang-apply {
  padding: 10px 16px;
  border-top: 1px solid #eef0f5;
  background: #fafbfe;
}

.em-lang-apply-title {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #6b7280;
  margin-bottom: 8px;
}

.em-lang-apply-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.em-lang-check {
  margin: 0;
  cursor: pointer;
  user-select: none;
}

.em-lang-check-input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.em-lang-check-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 5px 11px;
  border-radius: 999px;
  border: 1px solid #dfe3ee;
  background: #fff;
  color: #6b7280;
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: 0.04em;
  line-height: 1;
  transition: all 0.15s ease;
}

.em-lang-check-pill em {
  font-style: normal;
  font-weight: 500;
  color: #9aa2b1;
}

.em-lang-check:hover .em-lang-check-pill {
  border-color: var(--color-primary);
}

.em-lang-check-input:checked + .em-lang-check-pill {
  background: var(--color-primary);
  border-color: var(--color-primary);
  color: #fff;
}

.em-lang-check-input:checked + .em-lang-check-pill em {
  color: rgba(255, 255, 255, 0.75);
}

.em-lang-check--all .em-lang-check-pill {
  border-style: dashed;
}

[data-admin-theme="dark"] .em-lang-apply {
  background: rgba(255, 255, 255, 0.02);
  border-top-color: rgba(255, 255, 255, 0.08);
}

[data-admin-theme="dark"] .em-lang-check-pill {
  background: rgba(255, 255, 255, 0.04);
  border-color: rgba(255, 255, 255, 0.12);
  color: #a3bdcc;
}

.em-lang-option {
  display: flex;
  align-items: center;
  gap: 9px;
  width: 100%;
  padding: 8px 10px;
  border: none;
  border-radius: 7px;
  background: transparent;
  cursor: pointer;
  font-family: inherit;
  text-align: left;
  text-decoration: none;
  transition: background 0.12s ease;
}

.em-lang-option:hover {
  background: #f2f4fb;
}

.em-lang-option-code {
  min-width: 26px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.06em;
  color: var(--color-primary);
}

.em-lang-option-name {
  flex: 1;
  font-size: 12.5px;
  color: var(--color-dark);
}

.em-lang-option-check {
  font-size: 14px;
  color: var(--color-primary);
  opacity: 0;
}

.em-lang-option.active {
  background: #eef1fd;
}

.em-lang-option.active .em-lang-option-check {
  opacity: 1;
}

.em-ui-lang-dropdown {
  flex-shrink: 0;
}

.em-ui-lang-toggle {
  background: rgba(124, 58, 237, 0.06);
  border-color: rgba(124, 58, 237, 0.18);
}

.em-ui-lang-toggle > .bi-fonts {
  color: #7c3aed;
  font-size: 15px;
}

.em-ui-lang-label {
  color: #6b7280;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
}

.em-ui-lang-code {
  min-width: 24px;
  color: #312e81;
  font-size: 12px;
  font-weight: 800;
}

.em-ui-lang-menu {
  min-width: 180px;
}

@media (max-width: 900px) {
  .em-lang-toggle { padding: 0 10px; }
  .em-lang-menu { left: auto; right: 0; }
  .em-ui-lang-label { display: none; }
}


/* ==================== IMAGE DROPZONE (cinova addition) ==================== */
/* Drag & drop upload in the image forms — files land in
   core/uploads/images/editmode/, replaced files are deleted server-side. */

.em-dropzone {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 74px;
  margin: 8px 0;
  padding: 12px 14px;
  border-radius: var(--em-radius-sm);
  border: 1.5px dashed rgba(91, 108, 249, 0.35);
  background: var(--em-bg-2);
  color: var(--em-text-2, #6b7280);
  font-size: 12.5px;
  text-align: center;
  cursor: pointer;
  transition: border-color 0.15s ease, background-color 0.15s ease;
}

.em-dropzone:hover {
  border-color: var(--em-accent);
  background: rgba(91, 108, 249, 0.06);
}

.em-dropzone--over {
  border-color: var(--em-accent);
  border-style: solid;
  background: rgba(91, 108, 249, 0.1);
  color: var(--em-accent);
}

.em-dropzone--busy {
  opacity: 0.6;
  pointer-events: none;
}

.em-dropzone-text {
  pointer-events: none;
}
