.lem-sizeconfig-basic.panel {
  background: #ffffff;
  border: 1px solid #e5e7eb;
  border-radius: 10px;
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.05);
  margin-top: 1rem;
  overflow: hidden;
  transition: box-shadow 0.2s ease;
}
.lem-sizeconfig-basic.panel:hover {
  box-shadow: 0 8px 22px rgba(0, 0, 0, 0.08);
}

/* === Header (bleu nuit) === */
.lem-sizeconfig-basic .panel-heading {
  background: linear-gradient(135deg, #073156, #05233f);
  color: #fff;
  font-weight: 600;
  font-size: 1.1rem;
  padding: 0.85rem 1.2rem;
  display: flex;
  align-items: center;
  gap: 0.6rem;
}
.lem-sizeconfig-basic .panel-heading .icon-arrows {
  font-size: 1.1rem;
}

.lem-textual-basic .lem-textual-form-wrapper {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.lem-textual-entry {
  padding: 1rem;
}

.lem-textual-open-modal {
  width: 100%;
  min-height: 44px;
  border-radius: 10px;
  border: 1px solid #05233f;
  background: linear-gradient(135deg, #073156, #05233f);
  color: #fff;
  box-shadow: 0 10px 22px rgba(9, 35, 60, 0.16);
  font-size: 0.9rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  padding: 0.9rem 1rem;
  transition: background-color .2s ease, border-color .2s ease, transform .2s ease, box-shadow .2s ease;
}

.lem-textual-open-modal:hover,
.lem-textual-open-modal:focus,
.lem-textual-open-modal:active {
  border-color: #09233c;
  background: #09233c;
  color: #fff;
  box-shadow: 0 12px 26px rgba(9, 35, 60, 0.22);
}

.lem-textual-open-modal:focus-visible {
  outline: 2px solid #e1061b;
  outline-offset: 2px;
}

.lem-textual-basic .form-group {
  width: 100%;
}

.lem-sizeconfig-textual-error {
  color: #b94a48;
  margin-top: 0.25rem;
  display: none;
  font-size: 0.85rem;
}

.lem-textual-preview {
  margin-top: 0;
}

.lem-textual-modal {
  position: fixed;
  inset: 0;
  z-index: 10050;
  display: none;
}

.lem-textual-modal[aria-hidden="true"] {
  display: none;
}

.lem-textual-modal.is-open,
.lem-textual-modal[aria-hidden="false"] {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}

body.lem-textual-modal-open {
  overflow: hidden;
}

.lem-textual-modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(9, 35, 60, 0.42);
}

.lem-textual-modal__dialog {
  position: relative;
  margin: 0;
  width: min(1080px, calc(100% - 2rem));
  max-height: calc(100vh - 2rem);
  background: #fff;
  border-radius: 14px;
  border: 1px solid #d5dbe4;
  box-shadow: 0 18px 45px rgba(9, 35, 60, 0.22);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.lem-textual-modal__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.95rem 1.25rem;
  border-bottom: 1px solid #d5dbe4;
  background: #f6f7fb;
}

.lem-textual-modal__header h3 {
  margin: 0;
  font-size: 1.05rem;
  color: #0c2b49;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.02em;
}

.lem-textual-modal__close {
  border: 0;
  background: transparent;
  font-size: 1.8rem;
  line-height: 1;
  color: #0c2b49;
  cursor: pointer;
}

.lem-textual-modal__close:hover,
.lem-textual-modal__close:focus {
  color: #09233c;
}

.lem-textual-modal__close:focus-visible {
  outline: 2px solid #e1061b;
  outline-offset: 2px;
}

.lem-textual-modal__content {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  padding: 1rem;
  overflow: auto;
}

.lem-textual-modal .lem-textual-form-wrapper {
  padding: 0.35rem 0.3rem 0.35rem 0;
  background: linear-gradient(180deg, #fbfcff 0%, #f3f6fb 100%);
  border: 1px solid #d5dbe4;
  border-radius: 14px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.85);
}

.lem-textual-modal .lem-textual-form-wrapper .form-group {
  margin: 0;
  padding: 0.9rem 0.9rem 0.85rem;
  border-bottom: 1px solid #e2e7f1;
}

.lem-textual-modal .lem-textual-form-wrapper .form-group:last-child {
  border-bottom: 0;
}

.lem-textual-modal .lem-textual-form-wrapper .control-label {
  margin-bottom: 0.4rem;
  color: #0c2b49;
  font-weight: 700;
}

.lem-textual-modal .lem-textual-form-wrapper .form-control {
  border-radius: 9px;
  border: 1px solid #c8d2e2;
  background: #fff;
  min-height: 42px;
}

.lem-sizeconfig-textual-maxlength {
  margin-top: 0.35rem;
  color: #5f6f87;
  font-size: 0.8rem;
  font-weight: 600;
}

.lem-textual-required-warning {
  margin-top: 1rem;
  border: 1px solid #f0cf87;
  border-radius: 10px;
  background: linear-gradient(135deg, #fff8e7 0%, #fff2cf 100%);
  color: #8b5d00;
  padding: 0.9rem 1rem;
  font-weight: 600;
  text-align: center;
}

.lem-textual-required-warning[hidden] {
  display: none !important;
}

.lem-sizeconfig-svg-preview-inner {
  background: #f7f8fb;
  border: 1px solid #e3e6ef;
  border-radius: 8px;
  padding: 1rem;
}

.lem-sizeconfig-svg-preview-message {
  color: #4f566b;
  font-size: 0.9rem;
  margin-bottom: 0.75rem;
}

.lem-sizeconfig-svg-preview-canvas {
  min-height: 220px;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #fff;
  border: 1px dashed #cdd3e2;
  border-radius: 6px;
  padding: 0.75rem;
  overflow: hidden;
  cursor: zoom-in;
}

.lem-sizeconfig-svg-preview-canvas svg {
  display: block;
  width: 100%;
  max-width: 100%;
  height: auto;
  max-height: 480px;
}

.lem-sizeconfig-preview-zoom-trigger {
  position: absolute;
  right: 0.55rem;
  bottom: 0.55rem;
  z-index: 2;
  width: 34px;
  height: 34px;
  border-radius: 999px;
  border: 1px solid #c8d2e2;
  background: rgba(255, 255, 255, 0.95);
  color: #0c2b49;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 6px 14px rgba(9, 35, 60, 0.16);
  cursor: pointer;
}

.lem-sizeconfig-preview-zoom-trigger:hover,
.lem-sizeconfig-preview-zoom-trigger:focus {
  background: #ffffff;
  border-color: #9fb1ca;
}

.lem-sizeconfig-svg-preview-meta {
  margin-top: 0.5rem;
  color: #6d758d;
  font-size: 0.85rem;
}

.lem-textual-preview-lightbox {
  position: fixed;
  inset: 0;
  z-index: 10110;
  display: none;
}

.lem-textual-preview-lightbox[aria-hidden="false"],
.lem-textual-preview-lightbox.is-open {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}

.lem-textual-preview-lightbox__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(8, 18, 35, 0.75);
}

.lem-textual-preview-lightbox__dialog {
  position: relative;
  z-index: 1;
  width: min(1120px, calc(100vw - 2rem));
  height: min(88vh, calc(100dvh - 2rem));
  background: #fff;
  border-radius: 14px;
  border: 1px solid #d5dbe4;
  box-shadow: 0 18px 45px rgba(9, 35, 60, 0.28);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 3rem 1.25rem 1.25rem;
  overflow: hidden;
}

.lem-textual-preview-lightbox__close {
  position: absolute;
  top: 0.5rem;
  right: 0.75rem;
  border: 0;
  background: transparent;
  font-size: 2rem;
  line-height: 1;
  color: #0c2b49;
  cursor: pointer;
}

.lem-textual-preview-lightbox__canvas {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: auto;
}

.lem-textual-preview-lightbox__canvas svg {
  display: block;
  width: auto;
  height: auto;
  max-width: 100%;
  max-height: 100%;
}

body.lem-textual-preview-lightbox-open {
  overflow: hidden;
}

.lem-textual-preview--enhanced {
  position: relative;
  overflow: hidden;
  border: 1px solid #d5dbe4;
  border-radius: 14px;
  background: #fff;
  box-shadow: 0 12px 26px rgba(9, 35, 60, 0.08);
}

.lem-textual-preview--enhanced .lem-sizeconfig-svg-preview-inner {
  background: transparent;
  border: 0;
  border-radius: 0;
  padding: 1rem 1rem 1.25rem;
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-height: 100%;
}

.lem-textual-preview--enhanced .lem-sizeconfig-svg-preview-message {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  margin-bottom: 0.75rem;
  color: #0c2b49;
  font-size: 0.9rem;
  font-weight: 500;
}

.lem-textual-preview--enhanced .lem-sizeconfig-svg-preview-message::before {
  content: '';
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #0c2b49;
  box-shadow: 0 0 0 6px rgba(12, 43, 73, 0.14);
}

.lem-textual-preview--enhanced .lem-sizeconfig-svg-preview-canvas {
  border: 1px solid #d5dbe4;
  border-radius: 10px;
  background: #f6f7fb;
  min-height: 220px;
}

.lem-textual-preview--enhanced .lem-sizeconfig-svg-preview-meta {
  margin-top: 0.75rem;
  color: #556275;
  font-size: 0.84rem;
  font-weight: 600;
  letter-spacing: 0.01em;
}

@media (max-width: 900px) {
  .lem-textual-modal.is-open,
  .lem-textual-modal[aria-hidden="false"] {
    align-items: flex-start;
    padding: 0;
  }

  .lem-textual-modal__dialog {
    width: 100%;
    max-width: 100%;
    height: 100dvh;
    max-height: 100dvh;
    border-radius: 0;
    border: 0;
  }

  .lem-textual-modal__content {
    grid-template-columns: 1fr;
    gap: 0.85rem;
    padding: 0.85rem;
    overflow-y: auto;
    overflow-x: hidden;
    align-content: start;
  }

  .lem-textual-preview {
    width: 100%;
    min-height: 260px;
  }

  .lem-textual-preview--enhanced {
    display: block;
    width: 100%;
    min-height: 260px;
    overflow: visible;
  }

  .lem-textual-preview--enhanced .lem-sizeconfig-svg-preview-inner {
    padding: 0.85rem;
  }

  .lem-textual-preview--enhanced .lem-sizeconfig-svg-preview-canvas {
    min-height: 240px;
    padding: 0.5rem;
    overflow: auto;
  }

  .lem-sizeconfig-svg-preview-canvas svg {
    width: 100%;
    height: auto;
    max-width: 100%;
    max-height: none;
  }

  .lem-textual-preview-lightbox[aria-hidden="false"],
  .lem-textual-preview-lightbox.is-open {
    align-items: flex-start;
    padding: 0;
  }

  .lem-textual-preview-lightbox__dialog {
    width: 100%;
    height: 100dvh;
    max-height: 100dvh;
    border-radius: 0;
    border: 0;
    padding: 3.5rem 0.75rem 0.75rem;
  }

  .lem-textual-modal .lem-textual-form-wrapper {
    padding: 0;
  }
}

@media (max-width: 600px) {
  .lem-textual-preview,
  .lem-textual-preview--enhanced {
    min-height: 320px;
  }
}
