.ephcms-account-menu {
  display: flex;
  flex: 0 0 auto;
  justify-content: flex-end;
  justify-self: end;
  margin-left: auto;
  margin-right: 0;
  position: relative;
}

.ephcms-account-dropdown {
  position: relative;
}

.ephcms-account-dropdown > summary {
  list-style: none;
}

.ephcms-account-dropdown > summary::-webkit-details-marker {
  display: none;
}

.ephcms-account-avatar {
  align-items: center;
  background: #0ea5c0;
  border: 2px solid #0f172a;
  border-radius: 999px;
  box-shadow: 0 8px 18px rgba(15, 23, 42, .16);
  color: #062331;
  cursor: pointer;
  display: inline-flex;
  font-size: .9rem;
  font-weight: 850;
  height: 44px;
  justify-content: center;
  line-height: 1;
  padding: 0;
  text-decoration: none;
  width: 44px;
}

.ephcms-account-avatar:hover,
.ephcms-account-avatar:focus-visible {
  background: #22d3ee;
  box-shadow: 0 0 0 4px rgba(14, 165, 192, .18), 0 8px 18px rgba(15, 23, 42, .16);
  outline: 0;
}

.ephcms-account-menu-panel {
  background: #fff;
  border: 1px solid #d9e2ec;
  border-radius: .45rem;
  box-shadow: 0 18px 48px rgba(15, 23, 42, .18);
  color: #1f2937;
  min-width: 292px;
  overflow: hidden;
  padding: .55rem 0;
  position: absolute;
  right: 0;
  top: calc(100% + .65rem);
  z-index: 1100;
}

.ephcms-account-menu-header {
  align-items: center;
  background: #f8fafc;
  display: grid;
  gap: .85rem;
  grid-template-columns: 56px 1fr;
  margin: -.55rem .55rem .45rem;
  padding: 1rem;
}

.ephcms-account-menu-avatar {
  align-items: center;
  background: #0ea5c0;
  border-radius: 999px;
  color: #062331;
  display: inline-flex;
  font-size: 1.15rem;
  font-weight: 850;
  height: 56px;
  justify-content: center;
  line-height: 1;
  width: 56px;
}

.ephcms-account-menu-identity {
  min-width: 0;
}

.ephcms-account-menu-identity strong,
.ephcms-account-menu-identity span {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ephcms-account-menu-identity strong {
  color: #101828;
  font-size: 1.08rem;
  line-height: 1.25;
}

.ephcms-account-menu-identity span {
  color: #667085;
  font-size: .92rem;
  margin-top: .2rem;
}

.ephcms-account-menu-form {
  margin: 0;
}

.ephcms-account-menu-item {
  align-items: center;
  background: transparent;
  border: 0;
  color: #1f2937;
  display: flex;
  font: inherit;
  gap: .65rem;
  line-height: 1.25;
  padding: .78rem 1rem;
  text-align: left;
  text-decoration: none;
  width: 100%;
}

.ephcms-account-menu-item:hover,
.ephcms-account-menu-item:focus-visible {
  background: #eef5ff;
  color: #2458d3;
  outline: 0;
  text-decoration: none;
}

.ephcms-account-inline-form {
  align-items: center;
}

.cms-gallery__link {
  background: transparent;
  border: 0;
  cursor: zoom-in;
  display: block;
  padding: 0;
  text-align: inherit;
  width: 100%;
}

.cms-gallery__link:focus-visible {
  border-radius: .375rem;
  box-shadow: 0 0 0 .25rem rgba(37, 99, 235, .28);
  outline: 2px solid #2563eb;
  outline-offset: 3px;
}

.cms-gallery-lightbox[hidden] {
  display: none !important;
}

.cms-gallery-lightbox {
  align-items: center;
  display: flex;
  inset: 0;
  justify-content: center;
  padding: clamp(1rem, 3vw, 2.5rem);
  position: fixed;
  z-index: 2400;
}

.cms-gallery-lightbox-open {
  overflow: hidden;
}

.cms-gallery-lightbox__backdrop {
  background: rgba(2, 6, 23, .84);
  border: 0;
  cursor: zoom-out;
  inset: 0;
  padding: 0;
  position: absolute;
}

.cms-gallery-lightbox__dialog {
  background: #0f172a;
  border: 1px solid rgba(255, 255, 255, .16);
  border-radius: .5rem;
  box-shadow: 0 24px 80px rgba(2, 6, 23, .42);
  color: #f8fafc;
  display: grid;
  gap: .75rem;
  max-height: min(92vh, 60rem);
  max-width: min(96vw, 78rem);
  padding: clamp(.75rem, 2vw, 1rem);
  position: relative;
  width: max-content;
  z-index: 1;
}

.cms-gallery-lightbox__image {
  background: #020617;
  border-radius: .35rem;
  display: block;
  max-height: min(76vh, 48rem);
  max-width: min(92vw, 72rem);
  object-fit: contain;
  width: auto;
}

.cms-gallery-lightbox__close,
.cms-gallery-lightbox__nav {
  align-items: center;
  background: rgba(248, 250, 252, .92);
  border: 1px solid rgba(15, 23, 42, .18);
  border-radius: 999px;
  color: #0f172a;
  display: inline-flex;
  font: inherit;
  font-weight: 800;
  justify-content: center;
  min-height: 2.75rem;
  min-width: 2.75rem;
  position: absolute;
}

.cms-gallery-lightbox__close:hover,
.cms-gallery-lightbox__close:focus-visible,
.cms-gallery-lightbox__nav:hover,
.cms-gallery-lightbox__nav:focus-visible {
  background: #ffffff;
  box-shadow: 0 0 0 .25rem rgba(255, 255, 255, .24);
  outline: 2px solid #ffffff;
  outline-offset: 2px;
}

.cms-gallery-lightbox__close {
  right: .75rem;
  top: .75rem;
}

.cms-gallery-lightbox__nav {
  top: 50%;
  transform: translateY(-50%);
}

.cms-gallery-lightbox__nav--prev {
  left: .75rem;
}

.cms-gallery-lightbox__nav--next {
  right: .75rem;
}

.cms-gallery-lightbox__meta {
  display: grid;
  gap: .25rem;
  padding: 0 .25rem .1rem;
}

.cms-gallery-lightbox__counter {
  color: #cbd5e1;
  font-size: .875rem;
}

.cms-gallery-lightbox__title {
  font-size: 1rem;
  font-weight: 700;
}

.cms-gallery-lightbox__description {
  color: #dbeafe;
  font-size: .95rem;
}

@media (max-width: 575.98px) {
  .ephcms-account-menu-panel {
    max-width: calc(100vw - 2rem);
    min-width: min(292px, calc(100vw - 2rem));
  }

  .cms-gallery-lightbox {
    padding: .5rem;
  }

  .cms-gallery-lightbox__dialog {
    max-width: calc(100vw - 1rem);
    width: 100%;
  }

  .cms-gallery-lightbox__image {
    max-width: 100%;
  }

  .cms-gallery-lightbox__nav--prev {
    left: .35rem;
  }

  .cms-gallery-lightbox__nav--next {
    right: .35rem;
  }
}

/* CMS section edit tools and grid styles — shared by all hosts */

.ephcms-edit-tools {
  display: flex;
  justify-content: flex-end;
  margin: 0 0 8px;
  position: relative;
  z-index: 10;
}

.ephcms-edit-link {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  padding: 4px 8px;
  border: 1px solid rgba(15, 23, 42, .22);
  border-radius: 4px;
  background: rgba(255, 255, 255, .86);
  color: #475569;
  font-size: 12px;
  line-height: 1;
  text-decoration: none;
  box-shadow: 0 2px 8px rgba(15, 23, 42, .08);
}

.ephcms-edit-link:hover {
  color: #0f172a;
  background: #fff;
  text-decoration: none;
}

.ephcms-page-crud-tools {
  display: flex;
  justify-content: flex-end;
  gap: 6px;
  margin: 0 0 12px;
  position: relative;
  z-index: 10;
}

.ephcms-column-image {
  display: block;
  max-width: min(14rem, 100%);
  max-height: 10rem;
  object-fit: contain;
  border-radius: 4px;
}

.ephcms-grid-media-editor-preview {
  display: block;
  max-width: 9rem;
  max-height: 6rem;
  object-fit: contain;
}

.ephcms-grid-table-stable {
  table-layout: fixed;
}

.ephcms-grid-header,
.ephcms-grid-table thead {
  background: color-mix(in srgb, var(--bs-body-bg, #fff) 92%, var(--bs-secondary-bg, #f8f9fa));
}

.ephcms-grid-table thead th,
.ephcms-grid-header-cell {
  color: color-mix(in srgb, var(--bs-body-color, #212529) 78%, var(--bs-secondary-color, #6c757d));
  font-size: .875rem;
  font-weight: 650;
}

.ephcms-grid-table thead th {
  border-bottom-color: color-mix(in srgb, var(--bs-border-color, #dee2e6) 76%, var(--bs-body-color, #212529));
}

.ephcms-grid-sort-button {
  color: inherit;
  font: inherit;
  line-height: 1.25;
  text-align: left;
}

.ephcms-grid-sort-button:hover,
.ephcms-grid-sort-button:focus {
  color: var(--bs-primary, #0d6efd);
  text-decoration: none;
}

.ephcms-grid-table th,
.ephcms-grid-table td {
  overflow-wrap: anywhere;
  vertical-align: middle;
}

.ephcms-grid-table tr[data-ephcms-grid-editing="true"] > [data-ephcms-grid-cell] {
  padding: .2rem .25rem;
}

.ephcms-grid-table tr[data-ephcms-grid-editing="true"] > [data-ephcms-grid-cell] .form-control,
.ephcms-grid-table tr[data-ephcms-grid-editing="true"] > [data-ephcms-grid-cell] .form-select,
.ephcms-grid-table tr[data-ephcms-grid-editing="true"] > [data-ephcms-grid-cell] .input-group {
  box-sizing: border-box;
  min-width: 0;
  width: 100%;
}

.ephcms-grid-table tr[data-ephcms-grid-editing="true"] > [data-ephcms-grid-cell] .form-control,
.ephcms-grid-table tr[data-ephcms-grid-editing="true"] > [data-ephcms-grid-cell] .form-select {
  display: block;
}

.ephcms-grid-readonly {
  display: inline-block;
  padding: .25rem 0;
}

.cms-media-url-preview-image {
  display: block;
  max-width: 12rem;
  max-height: 8rem;
  object-fit: contain;
}
