/* TheaCRM v2.8.559 – universal e-mail composer modal shell */
.thea-email-composer-modal[hidden] { display: none !important; }
.thea-email-composer-modal {
  position: fixed;
  inset: 0;
  z-index: 42000;
  display: grid;
  place-items: center;
  padding: 1.25rem;
}
.thea-email-composer-modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, .56);
  backdrop-filter: blur(4px);
}
.thea-email-composer-modal__dialog {
  position: relative;
  z-index: 1;
  width: min(1180px, calc(100vw - 2.5rem));
  height: min(94dvh, 980px);
  min-height: 560px;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  overflow: hidden;
  background: #f4f7f5;
  border: 1px solid rgba(255, 255, 255, .74);
  border-radius: 22px;
  box-shadow: 0 30px 90px rgba(15, 23, 42, .34);
  transform: translateY(10px) scale(.992);
  opacity: 0;
  transition: transform .18s ease, opacity .18s ease;
}
.thea-email-composer-modal.is-open .thea-email-composer-modal__dialog {
  transform: translateY(0) scale(1);
  opacity: 1;
}
.thea-email-composer-modal__header {
  min-height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: .65rem .8rem .65rem 1rem;
  background: rgba(255, 255, 255, .97);
  border-bottom: 1px solid #dfe8e2;
}
.thea-email-composer-modal__heading {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: .75rem;
}
.thea-email-composer-modal__heading > div {
  min-width: 0;
  display: grid;
  gap: .05rem;
}
.thea-email-composer-modal__heading strong {
  display: block;
  color: #17281d;
  font-size: 1rem;
  line-height: 1.2;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.thea-email-composer-modal__heading small {
  color: #66736b;
  font-size: .76rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.thea-email-composer-modal__icon {
  width: 2.35rem;
  height: 2.35rem;
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  background: #e8f5ec;
  color: #257238;
  font-size: 1.1rem;
}
.thea-email-composer-modal__actions {
  display: flex;
  align-items: center;
  gap: .45rem;
  flex: 0 0 auto;
}
.thea-email-composer-modal__actions .btn {
  min-height: 38px;
  border-radius: 12px;
  font-weight: 750;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .35rem;
}
.thea-email-composer-modal__close {
  width: 40px;
  padding: 0 !important;
  font-size: 1.05rem;
}
.thea-email-composer-modal__body {
  position: relative;
  min-height: 0;
  overflow: hidden;
  background: #f4f7f5;
}
.thea-email-composer-modal__frame {
  width: 100%;
  height: 100%;
  display: block;
  border: 0;
  background: #f4f7f5;
  opacity: 0;
  transition: opacity .15s ease;
}
.thea-email-composer-modal__frame.is-ready { opacity: 1; }
.thea-email-composer-modal__loading {
  position: absolute;
  inset: 0;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: .65rem;
  color: #405247;
  background: #f4f7f5;
  font-weight: 700;
}
.thea-email-composer-modal__loading[hidden] { display: none !important; }
body.thea-email-composer-modal-open { overflow: hidden !important; }

@media (max-width: 767.98px) {
  .thea-email-composer-modal {
    padding: 0;
    place-items: stretch;
  }
  .thea-email-composer-modal__dialog {
    width: 100vw;
    height: 100dvh;
    min-height: 0;
    border: 0;
    border-radius: 0;
    box-shadow: none;
  }
  .thea-email-composer-modal__header {
    min-height: 58px;
    padding: calc(.5rem + env(safe-area-inset-top)) .55rem .5rem .7rem;
  }
  .thea-email-composer-modal__heading { gap: .55rem; }
  .thea-email-composer-modal__icon {
    width: 2.05rem;
    height: 2.05rem;
    font-size: .95rem;
  }
  .thea-email-composer-modal__heading strong { font-size: .94rem; }
  .thea-email-composer-modal__heading small { display: none; }
  .thea-email-composer-modal__actions .btn span { display: none; }
  .thea-email-composer-modal__actions .btn {
    width: 40px;
    padding: 0;
  }
}

@media (prefers-reduced-motion: reduce) {
  .thea-email-composer-modal__dialog,
  .thea-email-composer-modal__frame { transition: none; }
}

/* v2.8.560 – výsledek odeslání / uložení konceptu */
.thea-email-composer-result {
  position: fixed;
  z-index: 10980;
  right: max(1rem, env(safe-area-inset-right));
  bottom: max(1rem, env(safe-area-inset-bottom));
  width: min(560px, calc(100vw - 2rem));
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: .8rem;
  padding: .8rem .85rem;
  border: 1px solid rgba(37, 114, 56, .24);
  border-radius: 16px;
  background: #1f6f36;
  color: #fff;
  box-shadow: 0 18px 48px rgba(15, 43, 24, .28);
  opacity: 0;
  transform: translateY(18px);
  transition: opacity .2s ease, transform .2s ease;
}
.thea-email-composer-result.is-visible {
  opacity: 1;
  transform: translateY(0);
}
.thea-email-composer-result__icon {
  width: 2.5rem;
  height: 2.5rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  background: rgba(255, 255, 255, .16);
  font-size: 1.12rem;
}
.thea-email-composer-result__content {
  min-width: 0;
  display: grid;
  gap: .1rem;
}
.thea-email-composer-result__content strong {
  line-height: 1.25;
  font-size: .95rem;
}
.thea-email-composer-result__content small {
  display: block;
  opacity: .86;
  line-height: 1.25;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.thea-email-composer-result__actions {
  display: flex;
  align-items: center;
  gap: .35rem;
}
.thea-email-composer-result__actions .btn-light {
  color: #1f6333;
  font-weight: 800;
  border-radius: 10px;
  white-space: nowrap;
}
.thea-email-composer-result__close {
  width: 36px;
  height: 36px;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  border: 0;
  border-radius: 10px;
}
.thea-email-composer-result__close:hover,
.thea-email-composer-result__close:focus {
  color: #fff;
  background: rgba(255, 255, 255, .16);
}

@media (max-width: 575.98px) {
  .thea-email-composer-result {
    left: .6rem;
    right: .6rem;
    bottom: calc(.6rem + env(safe-area-inset-bottom));
    width: auto;
    grid-template-columns: auto minmax(0, 1fr) auto;
    gap: .55rem;
    padding: .7rem;
  }
  .thea-email-composer-result__icon {
    width: 2.15rem;
    height: 2.15rem;
  }
  .thea-email-composer-result__content small { white-space: normal; }
  .thea-email-composer-result__actions .btn-light {
    width: 38px;
    height: 38px;
    padding: 0;
    overflow: hidden;
    text-indent: -9999px;
    position: relative;
  }
  .thea-email-composer-result__actions .btn-light::after {
    content: '\F1C5';
    font-family: 'bootstrap-icons';
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    text-indent: 0;
    font-size: 1rem;
  }
}
