.document-template-picker-modal,
.pdf-template-picker-modal {
  display: grid;
  height: min(86vh, 820px);
  grid-template-rows: auto auto auto minmax(0, 1fr);
}

/* Prevent React filename/filter flash before overlay is ready */
.document-template-picker-modal > .document-template-filters,
.document-template-picker-modal > .document-template-picker-grid {
  display: none !important;
}

.document-template-picker-modal:not(.regab-template-picker-ready)::before {
  content: "Vorlagen werden geladen …";
  grid-column: 1 / -1;
  grid-row: 2 / -1;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #64748b;
  font-size: 0.95rem;
  padding: 2rem;
}

.document-template-picker-modal.regab-template-picker-ready {
  position: relative;
  width: min(1720px, calc(100vw - 20px)) !important;
  max-width: none;
  height: min(96vh, 1040px);
  max-height: min(96vh, 1040px);
  padding: 0;
  overflow: hidden;
  grid-template-rows: minmax(0, 1fr);
  background: #fff;
}

.document-create-modal .document-template-picker-modal.regab-template-picker-ready {
  width: 100% !important;
  height: 100% !important;
  max-height: none !important;
}

.document-template-picker-modal.regab-template-picker-ready > .settings-mini-modal-head {
  position: absolute;
  top: 12px;
  right: 12px;
  z-index: 6;
  margin: 0;
  padding: 0;
  background: transparent;
}

.document-template-picker-modal.regab-template-picker-ready > .settings-mini-modal-head > div {
  display: none;
}

.document-template-picker-modal.regab-template-picker-ready .document-template-filters,
.document-template-picker-modal.regab-template-picker-ready .document-template-picker-grid {
  display: none !important;
}

.regab-template-picker-shell {
  min-height: 0;
  height: 100%;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 400px;
}

.regab-template-picker-main {
  min-width: 0;
  min-height: 0;
  display: grid;
  grid-template-rows: auto auto auto auto minmax(0, 1fr);
  gap: 16px;
  padding: 32px 32px 28px;
  overflow: hidden;
}

.regab-template-picker-intro {
  display: grid;
  gap: 4px;
}

.regab-template-picker-eyebrow {
  color: #3d78ed;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .12em;
  text-transform: uppercase;
}

.regab-template-picker-intro h2 {
  margin: 0;
  color: #111827;
  font-size: 32px;
  font-weight: 800;
  letter-spacing: -.03em;
  line-height: 1.15;
}

.regab-template-picker-count {
  color: #6b7280;
  font-size: 13px;
  font-weight: 600;
}

.regab-template-picker-aside {
  min-height: 0;
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding: 28px 22px;
  background: #f3f4f6;
  border-left: 1px solid #e5e7eb;
}

.regab-template-preview-empty {
  margin: auto;
  max-width: 220px;
  display: grid;
  justify-items: center;
  gap: 10px;
  color: #6b7280;
  text-align: center;
}

.regab-template-preview-empty svg {
  color: #9ca3af;
}

.regab-template-preview-empty strong {
  color: #111827;
  font-size: 16px;
  font-weight: 800;
}

.regab-template-preview-empty p {
  margin: 0;
  font-size: 13px;
  line-height: 1.45;
}

.regab-template-preview-frame {
  flex: 1 1 auto;
  min-height: 220px;
  overflow: hidden;
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  background: #fff;
}

.regab-template-preview-frame img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: top center;
  background: #fff;
}

.regab-template-preview-frame.is-missing {
  background: linear-gradient(180deg, #e5e7eb 0%, #f3f4f6 100%);
}

.regab-template-preview-meta {
  display: grid;
  gap: 4px;
}

.regab-template-preview-meta em {
  color: #3d78ed;
  font-size: 11px;
  font-style: normal;
  font-weight: 800;
  letter-spacing: .06em;
  text-transform: uppercase;
}

.regab-template-preview-meta strong {
  color: #111827;
  font-size: 18px;
}

.regab-template-preview-meta span {
  color: #6b7280;
  font-size: 13px;
}

.regab-template-preview-use {
  min-height: 42px;
  border: 0;
  border-radius: 10px;
  background: #111827;
  color: #fff;
  font: inherit;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
}

.regab-template-preview-use:hover {
  background: #1f2937;
}

.pdf-template-picker-modal > .settings-mini-modal-head > div > small {
  display: block;
  color: #1d2b3d;
  font-size: 20px;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: none;
}

.pdf-template-picker-modal > .settings-mini-modal-head > div > strong[hidden] {
  display: none !important;
}

.document-template-picker-modal .document-template-picker-grid,
.pdf-template-picker-modal .pdf-template-picker-grid {
  min-height: 0;
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
  align-content: start;
  padding-right: 4px;
  scrollbar-gutter: stable;
}

.pdf-template-picker-search,
.document-template-picker-search {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  margin: 2px 0 10px;
  color: #9ca3af;
}

.document-template-picker-modal .document-template-picker-search {
  margin: 0;
  padding: 0 14px;
  min-height: 48px;
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  background: #fff;
}

.pdf-template-picker-search input,
.document-template-picker-search input {
  width: 100%;
  min-height: 48px;
  border: 1px solid #d8e2ef;
  border-radius: 14px;
  background: #fff;
  color: #1d2b3d;
  font: inherit;
  font-size: 16px;
  padding: 0 16px;
  outline: none;
  box-shadow: inset 0 1px 0 rgba(15, 23, 42, .03);
}

.document-template-picker-modal .document-template-picker-search input {
  min-height: 46px;
  padding: 0;
  border: 0;
  border-radius: 0;
  box-shadow: none;
  background: transparent;
}

.pdf-template-picker-search input:focus,
.document-template-picker-search input:focus {
  border-color: #3977ed;
  box-shadow: 0 0 0 4px rgba(57, 119, 237, .14);
}

.document-template-picker-modal .document-template-picker-search:focus-within {
  border-color: #111827;
  box-shadow: 0 0 0 3px rgba(17, 24, 39, .08);
}

.document-template-picker-modal .document-template-picker-search input:focus {
  border: 0;
  box-shadow: none;
}

.regab-template-category-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0 0 12px;
}

.document-template-picker-modal .regab-template-category-badges {
  margin: 0;
}

.regab-template-category-badges button {
  min-height: 34px;
  padding: 0 12px;
  border: 1px solid #d8e2ef;
  border-radius: 999px;
  background: #f7fafc;
  color: #4b5e73;
  font: inherit;
  font-size: 12px;
  font-weight: 800;
  cursor: pointer;
}

.document-template-picker-modal .regab-template-category-badges button {
  min-height: 36px;
  padding: 0 14px;
  border-color: #e5e7eb;
  background: #fff;
  color: #374151;
  font-size: 13px;
  font-weight: 700;
}

.regab-template-category-badges button:hover {
  border-color: #9ab8f7;
  background: #f2f6ff;
  color: #1f5fd4;
}

.document-template-picker-modal .regab-template-category-badges button:hover {
  border-color: #d1d5db;
  background: #f9fafb;
  color: #111827;
}

.regab-template-category-badges button.is-active {
  border-color: #3d78ed;
  background: #eaf1ff;
  color: #1f5fd4;
}

.document-template-picker-modal .regab-template-category-badges button.is-active {
  border-color: #111827;
  background: #111827;
  color: #fff;
}

.regab-template-gallery {
  min-height: 0;
  overflow: auto;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
  gap: 12px;
  align-content: start;
  padding: 2px 4px 8px 0;
}

.document-template-picker-modal .regab-template-gallery {
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 16px;
  padding: 0 6px 12px 0;
}

.regab-template-tile {
  position: relative;
  display: flex !important;
  flex-direction: column;
  align-items: flex-start;
  justify-content: flex-start;
  gap: 6px;
  min-height: 108px;
  height: auto !important;
  padding: 14px 16px !important;
  border: 1px solid #d7e1ec;
  border-radius: 14px;
  background: #fff !important;
  color: #18283a;
  text-align: left;
  cursor: pointer;
  overflow: hidden;
}

.document-template-picker-modal .regab-template-tile {
  min-width: 0;
  min-height: 168px;
  height: auto !important;
  gap: 10px;
  padding: 18px 18px 16px !important;
  border-color: #e5e7eb;
  border-radius: 16px;
  overflow: visible;
}

.regab-template-tile:hover,
.regab-template-tile:focus-visible {
  border-color: #3d78ed;
  outline: none;
  z-index: 4;
}

.document-template-picker-modal .regab-template-tile:hover,
.document-template-picker-modal .regab-template-tile:focus-visible {
  border-color: #d1d5db;
  box-shadow: 0 8px 24px rgba(17, 24, 39, .06);
  z-index: 1;
}

.document-template-picker-modal .regab-template-tile.is-active {
  border-color: #111827;
  box-shadow: 0 0 0 1px #111827;
}

.regab-template-tile-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  width: 100%;
  min-width: 0;
  flex-wrap: wrap;
}

.regab-template-tile-top em {
  flex: 1 1 140px;
  min-width: 0;
  overflow-wrap: anywhere;
}

.regab-template-tile-top small {
  flex: 0 0 auto;
  color: #9ca3af;
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
}

.document-template-picker-modal .regab-template-tile strong {
  width: 100%;
  min-width: 0;
  font-size: 17px !important;
  line-height: 1.25;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.document-template-picker-modal .regab-template-tile-meta,
.document-template-picker-modal .regab-template-tile-places {
  width: 100%;
  min-width: 0;
  overflow-wrap: anywhere;
  word-break: break-word;
  white-space: normal !important;
}

.document-template-picker-modal .regab-template-tile-places {
  display: flex;
  align-items: flex-start;
}

.regab-template-tile-preview {
  position: absolute;
  inset: 0;
  z-index: 1;
  display: none;
  height: auto;
  overflow: hidden;
  border: 0;
  border-radius: inherit;
  background: #e8eef5;
  pointer-events: none;
}

.regab-template-tile:hover .regab-template-tile-preview,
.regab-template-tile:focus-visible .regab-template-tile-preview,
.regab-template-tile.is-preview-open .regab-template-tile-preview {
  display: block;
}

.regab-template-tile-preview img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: top center;
}

.regab-template-tile-preview.is-missing {
  background:
    linear-gradient(180deg, #dbe6f2 0%, #edf2f7 100%);
}

.regab-template-tile-body {
  position: relative;
  z-index: 2;
  display: grid;
  gap: 4px;
  min-width: 0;
  width: 100%;
  background: transparent;
}

.regab-template-tile:hover .regab-template-tile-body,
.regab-template-tile:focus-visible .regab-template-tile-body,
.regab-template-tile.is-preview-open .regab-template-tile-body {
  padding: 8px 10px;
  margin: -4px -6px 0;
  border-radius: 10px;
  background: rgba(255, 255, 255, .94);
  box-shadow: 0 8px 20px rgba(15, 23, 42, .12);
}

.regab-template-tile em {
  margin: 0;
  color: #3d78ed !important;
  font-size: 11px !important;
  font-style: normal;
  font-weight: 800;
  letter-spacing: .04em;
  line-height: 1.3;
  text-transform: uppercase;
}

.regab-template-tile strong {
  display: block !important;
  margin: 0;
  color: #18283a !important;
  font-size: 16px !important;
  font-weight: 800;
  line-height: 1.3;
  overflow-wrap: anywhere;
  white-space: normal !important;
}

.regab-template-tile-places {
  color: #355577 !important;
  font-size: 12px !important;
  font-weight: 700;
  line-height: 1.35;
  overflow-wrap: anywhere;
}

.document-template-picker-modal .regab-template-tile-places {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: auto;
  color: #6b7280 !important;
  font-weight: 600;
}

.document-template-picker-modal .regab-template-tile-places svg {
  flex: 0 0 auto;
  color: #9ca3af;
}

.regab-template-tile-meta {
  color: #6b7c8f !important;
  font-size: 12px !important;
  font-weight: 600;
  line-height: 1.4;
  overflow-wrap: anywhere;
}

.pdf-template-picker-card {
  position: relative;
  overflow: visible !important;
}

.pdf-template-picker-card > button:first-child .regab-template-tile-preview {
  width: auto;
  height: auto;
  margin: 0;
  aspect-ratio: auto;
}

.pdf-template-picker-card > button:first-child .regab-template-tile-body {
  padding: 0;
  width: 100%;
}

.pdf-template-picker-empty,
.document-template-picker-empty {
  display: none;
  grid-column: 1 / -1;
  padding: 22px;
  border: 1px dashed #c9d6e6;
  border-radius: 16px;
  color: #6b7c8f;
  text-align: center;
  background: #f8fbff;
  font-weight: 700;
}

.pdf-template-picker-card {
  cursor: pointer;
}

.pdf-template-picker-card > button:first-child {
  box-sizing: border-box;
  width: 100%;
  min-width: 0;
  min-height: 132px;
  height: 100%;
  display: flex !important;
  flex-direction: column;
  align-items: flex-start;
  justify-content: flex-start;
  gap: 8px;
  padding: 16px 52px 16px 16px;
  border-radius: inherit;
}

.pdf-template-picker-card > button:first-child:focus-visible {
  outline: 3px solid rgba(57, 119, 237, .35);
  outline-offset: -3px;
}

.pdf-template-picker-card:hover {
  border-color: #9db7dc;
  box-shadow: 0 12px 28px rgba(15, 23, 42, .08);
}

.pdf-template-picker-card.is-active:hover {
  border-color: #3977ed;
}

.pdf-template-picker-card strong,
.pdf-template-picker-card span {
  max-width: 100%;
  overflow: visible;
  white-space: normal;
  overflow-wrap: anywhere;
  line-height: 1.3;
}

.pdf-template-picker-empty.is-visible,
.document-template-picker-empty.is-visible {
  display: block;
}

html.theme-dark .pdf-template-picker-search input,
html[data-theme="dark"] .pdf-template-picker-search input,
body.theme-dark .pdf-template-picker-search input,
body.force-dark .pdf-template-picker-search input,
html.theme-dark .document-template-picker-search input,
html[data-theme="dark"] .document-template-picker-search input,
body.theme-dark .document-template-picker-search input,
body.force-dark .document-template-picker-search input {
  color: #eaf3ff !important;
  background: #0a1c2b !important;
  border-color: #244b70 !important;
}

html.theme-dark .pdf-template-picker-empty,
html[data-theme="dark"] .pdf-template-picker-empty,
body.theme-dark .pdf-template-picker-empty,
body.force-dark .pdf-template-picker-empty,
html.theme-dark .document-template-picker-empty,
html[data-theme="dark"] .document-template-picker-empty,
body.theme-dark .document-template-picker-empty,
body.force-dark .document-template-picker-empty {
  color: #a9bed6 !important;
  background: #0d2137 !important;
  border-color: #244b70 !important;
}

html.theme-dark .document-template-picker-modal.regab-template-picker-ready,
html[data-theme="dark"] .document-template-picker-modal.regab-template-picker-ready,
body.theme-dark .document-template-picker-modal.regab-template-picker-ready,
body.force-dark .document-template-picker-modal.regab-template-picker-ready {
  background: #071522 !important;
  color: #edf6ff;
  border-color: #244b70;
}

html.theme-dark .document-template-picker-modal.regab-template-picker-ready .icon-button,
html[data-theme="dark"] .document-template-picker-modal.regab-template-picker-ready .icon-button,
body.theme-dark .document-template-picker-modal.regab-template-picker-ready .icon-button,
body.force-dark .document-template-picker-modal.regab-template-picker-ready .icon-button {
  color: #eaf3ff;
  background: #10283d;
  border-color: #244b70;
}

html.theme-dark .regab-template-picker-intro h2,
html[data-theme="dark"] .regab-template-picker-intro h2,
body.theme-dark .regab-template-picker-intro h2,
body.force-dark .regab-template-picker-intro h2,
html.theme-dark .regab-template-preview-empty strong,
html[data-theme="dark"] .regab-template-preview-empty strong,
body.theme-dark .regab-template-preview-empty strong,
body.force-dark .regab-template-preview-empty strong,
html.theme-dark .regab-template-preview-meta strong,
html[data-theme="dark"] .regab-template-preview-meta strong,
body.theme-dark .regab-template-preview-meta strong,
body.force-dark .regab-template-preview-meta strong {
  color: #edf6ff !important;
}

html.theme-dark .regab-template-picker-count,
html[data-theme="dark"] .regab-template-picker-count,
body.theme-dark .regab-template-picker-count,
body.force-dark .regab-template-picker-count,
html.theme-dark .regab-template-preview-empty,
html[data-theme="dark"] .regab-template-preview-empty,
body.theme-dark .regab-template-preview-empty,
body.force-dark .regab-template-preview-empty,
html.theme-dark .regab-template-preview-empty p,
html[data-theme="dark"] .regab-template-preview-empty p,
body.theme-dark .regab-template-preview-empty p,
body.force-dark .regab-template-preview-empty p,
html.theme-dark .regab-template-preview-meta span,
html[data-theme="dark"] .regab-template-preview-meta span,
body.theme-dark .regab-template-preview-meta span,
body.force-dark .regab-template-preview-meta span {
  color: #a7b8cc !important;
}

html.theme-dark .regab-template-picker-aside,
html[data-theme="dark"] .regab-template-picker-aside,
body.theme-dark .regab-template-picker-aside,
body.force-dark .regab-template-picker-aside {
  background: #0a1c2b !important;
  border-left-color: #244b70 !important;
  border-top-color: #244b70 !important;
}

html.theme-dark .document-template-picker-modal .document-template-picker-search,
html[data-theme="dark"] .document-template-picker-modal .document-template-picker-search,
body.theme-dark .document-template-picker-modal .document-template-picker-search,
body.force-dark .document-template-picker-modal .document-template-picker-search {
  background: #10283d !important;
  border-color: #244b70 !important;
  color: #8aa0b6 !important;
}

html.theme-dark .document-template-picker-modal .document-template-picker-search input,
html[data-theme="dark"] .document-template-picker-modal .document-template-picker-search input,
body.theme-dark .document-template-picker-modal .document-template-picker-search input,
body.force-dark .document-template-picker-modal .document-template-picker-search input {
  background: transparent !important;
  color: #edf6ff !important;
  border: 0 !important;
  box-shadow: none !important;
}

html.theme-dark .document-template-picker-modal .document-template-picker-search:focus-within,
html[data-theme="dark"] .document-template-picker-modal .document-template-picker-search:focus-within,
body.theme-dark .document-template-picker-modal .document-template-picker-search:focus-within,
body.force-dark .document-template-picker-modal .document-template-picker-search:focus-within {
  border-color: #5b9cff !important;
  box-shadow: 0 0 0 3px rgba(57, 119, 237, .22) !important;
}

html.theme-dark .regab-template-category-badges button,
html[data-theme="dark"] .regab-template-category-badges button,
body.theme-dark .regab-template-category-badges button,
body.force-dark .regab-template-category-badges button,
html.theme-dark .document-template-picker-modal .regab-template-category-badges button,
html[data-theme="dark"] .document-template-picker-modal .regab-template-category-badges button,
body.theme-dark .document-template-picker-modal .regab-template-category-badges button,
body.force-dark .document-template-picker-modal .regab-template-category-badges button {
  color: #c5d6e8 !important;
  background: #10283d !important;
  border-color: #244b70 !important;
}

html.theme-dark .document-template-picker-modal .regab-template-category-badges button:hover,
html[data-theme="dark"] .document-template-picker-modal .regab-template-category-badges button:hover,
body.theme-dark .document-template-picker-modal .regab-template-category-badges button:hover,
body.force-dark .document-template-picker-modal .regab-template-category-badges button:hover {
  color: #edf6ff !important;
  background: #143657 !important;
  border-color: #346a9e !important;
}

html.theme-dark .regab-template-category-badges button.is-active,
html[data-theme="dark"] .regab-template-category-badges button.is-active,
body.theme-dark .regab-template-category-badges button.is-active,
body.force-dark .regab-template-category-badges button.is-active,
html.theme-dark .document-template-picker-modal .regab-template-category-badges button.is-active,
html[data-theme="dark"] .document-template-picker-modal .regab-template-category-badges button.is-active,
body.theme-dark .document-template-picker-modal .regab-template-category-badges button.is-active,
body.force-dark .document-template-picker-modal .regab-template-category-badges button.is-active {
  color: #071522 !important;
  background: #edf6ff !important;
  border-color: #edf6ff !important;
}

html.theme-dark .regab-template-tile,
html[data-theme="dark"] .regab-template-tile,
body.theme-dark .regab-template-tile,
body.force-dark .regab-template-tile,
html.theme-dark .regab-template-tile-body,
html[data-theme="dark"] .regab-template-tile-body,
body.theme-dark .regab-template-tile-body,
body.force-dark .regab-template-tile-body,
html.theme-dark .document-template-picker-modal .regab-template-tile,
html[data-theme="dark"] .document-template-picker-modal .regab-template-tile,
body.theme-dark .document-template-picker-modal .regab-template-tile,
body.force-dark .document-template-picker-modal .regab-template-tile {
  background: #10283d !important;
  border-color: #244b70 !important;
  color: #edf6ff !important;
}

html.theme-dark .document-template-picker-modal .regab-template-tile:hover,
html[data-theme="dark"] .document-template-picker-modal .regab-template-tile:hover,
body.theme-dark .document-template-picker-modal .regab-template-tile:hover,
body.force-dark .document-template-picker-modal .regab-template-tile:hover,
html.theme-dark .document-template-picker-modal .regab-template-tile:focus-visible,
html[data-theme="dark"] .document-template-picker-modal .regab-template-tile:focus-visible,
body.theme-dark .document-template-picker-modal .regab-template-tile:focus-visible,
body.force-dark .document-template-picker-modal .regab-template-tile:focus-visible {
  border-color: #5b9cff !important;
  box-shadow: 0 8px 24px rgba(0, 0, 0, .28) !important;
}

html.theme-dark .document-template-picker-modal .regab-template-tile.is-active,
html[data-theme="dark"] .document-template-picker-modal .regab-template-tile.is-active,
body.theme-dark .document-template-picker-modal .regab-template-tile.is-active,
body.force-dark .document-template-picker-modal .regab-template-tile.is-active {
  border-color: #edf6ff !important;
  box-shadow: 0 0 0 1px #edf6ff !important;
}

html.theme-dark .regab-template-tile strong,
html[data-theme="dark"] .regab-template-tile strong,
body.theme-dark .regab-template-tile strong,
body.force-dark .regab-template-tile strong,
html.theme-dark .document-template-picker-modal .regab-template-tile strong,
html[data-theme="dark"] .document-template-picker-modal .regab-template-tile strong,
body.theme-dark .document-template-picker-modal .regab-template-tile strong,
body.force-dark .document-template-picker-modal .regab-template-tile strong {
  color: #edf6ff !important;
}

html.theme-dark .regab-template-tile em,
html[data-theme="dark"] .regab-template-tile em,
body.theme-dark .regab-template-tile em,
body.force-dark .regab-template-tile em {
  color: #7eb3ff !important;
}

html.theme-dark .regab-template-tile-top small,
html[data-theme="dark"] .regab-template-tile-top small,
body.theme-dark .regab-template-tile-top small,
body.force-dark .regab-template-tile-top small {
  color: #8aa0b6 !important;
}

html.theme-dark .regab-template-tile-places,
html[data-theme="dark"] .regab-template-tile-places,
body.theme-dark .regab-template-tile-places,
body.force-dark .regab-template-tile-places,
html.theme-dark .document-template-picker-modal .regab-template-tile-places,
html[data-theme="dark"] .document-template-picker-modal .regab-template-tile-places,
body.theme-dark .document-template-picker-modal .regab-template-tile-places,
body.force-dark .document-template-picker-modal .regab-template-tile-places {
  color: #9ec0ea !important;
}

html.theme-dark .document-template-picker-modal .regab-template-tile-places svg,
html[data-theme="dark"] .document-template-picker-modal .regab-template-tile-places svg,
body.theme-dark .document-template-picker-modal .regab-template-tile-places svg,
body.force-dark .document-template-picker-modal .regab-template-tile-places svg {
  color: #8aa0b6 !important;
}

html.theme-dark .regab-template-tile-meta,
html[data-theme="dark"] .regab-template-tile-meta,
body.theme-dark .regab-template-tile-meta,
body.force-dark .regab-template-tile-meta,
html.theme-dark .document-template-picker-modal .regab-template-tile-meta,
html[data-theme="dark"] .document-template-picker-modal .regab-template-tile-meta,
body.theme-dark .document-template-picker-modal .regab-template-tile-meta,
body.force-dark .document-template-picker-modal .regab-template-tile-meta {
  color: #8aa0b6 !important;
}

html.theme-dark .regab-template-tile:hover .regab-template-tile-body,
html[data-theme="dark"] .regab-template-tile:hover .regab-template-tile-body,
body.theme-dark .regab-template-tile:hover .regab-template-tile-body,
body.force-dark .regab-template-tile:hover .regab-template-tile-body,
html.theme-dark .regab-template-tile:focus-visible .regab-template-tile-body,
html[data-theme="dark"] .regab-template-tile:focus-visible .regab-template-tile-body,
body.theme-dark .regab-template-tile:focus-visible .regab-template-tile-body,
body.force-dark .regab-template-tile:focus-visible .regab-template-tile-body,
html.theme-dark .regab-template-tile.is-preview-open .regab-template-tile-body,
html[data-theme="dark"] .regab-template-tile.is-preview-open .regab-template-tile-body,
body.theme-dark .regab-template-tile.is-preview-open .regab-template-tile-body,
body.force-dark .regab-template-tile.is-preview-open .regab-template-tile-body {
  background: rgba(16, 40, 61, .94) !important;
}

html.theme-dark .regab-template-preview-frame,
html[data-theme="dark"] .regab-template-preview-frame,
body.theme-dark .regab-template-preview-frame,
body.force-dark .regab-template-preview-frame {
  border-color: #244b70 !important;
  background: #10283d !important;
}

html.theme-dark .regab-template-preview-frame img,
html[data-theme="dark"] .regab-template-preview-frame img,
body.theme-dark .regab-template-preview-frame img,
body.force-dark .regab-template-preview-frame img {
  background: #10283d;
}

html.theme-dark .regab-template-preview-use,
html[data-theme="dark"] .regab-template-preview-use,
body.theme-dark .regab-template-preview-use,
body.force-dark .regab-template-preview-use {
  background: #edf6ff !important;
  color: #071522 !important;
}

html.theme-dark .regab-template-preview-use:hover,
html[data-theme="dark"] .regab-template-preview-use:hover,
body.theme-dark .regab-template-preview-use:hover,
body.force-dark .regab-template-preview-use:hover {
  background: #dceaff !important;
}

.regab-template-locations {
  display: grid;
  gap: 6px;
  grid-column: 1 / -1;
}

.regab-template-locations span {
  color: #4a5b6c;
  font-size: 11px;
  font-weight: 800;
}

.regab-template-locations small {
  color: #708092;
  font-size: 11px;
  font-weight: 600;
  line-height: 1.4;
}

.regab-template-locations textarea {
  width: 100%;
  min-height: 72px;
  padding: 10px 12px;
  color: #25384a;
  background: white;
  border: 1px solid #dbe3ea;
  border-radius: 8px;
  outline: 0;
  resize: vertical;
  font: 13px "DM Sans", sans-serif;
  line-height: 1.4;
}

.regab-template-locations textarea:focus {
  border-color: #3977ed;
  box-shadow: 0 0 0 3px rgba(57, 119, 237, .14);
}

body.theme-dark .regab-template-locations span {
  color: #c5d6e8;
}

body.theme-dark .regab-template-locations small {
  color: #8aa0b6;
}

body.theme-dark .regab-template-locations textarea {
  color: #eaf3ff;
  background: #071827;
  border-color: #244260;
}

@media (max-width: 1100px) {
  .regab-template-picker-shell {
    grid-template-columns: 1fr;
    grid-template-rows: minmax(0, 1fr) 300px;
  }

  .regab-template-picker-aside {
    border-left: 0;
    border-top: 1px solid #e5e7eb;
    padding: 16px 20px;
  }

  .document-template-picker-modal .regab-template-gallery {
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  }
}

@media (max-width: 700px) {
  .document-template-picker-modal,
  .pdf-template-picker-modal {
    width: min(100%, calc(100vw - 20px));
    height: min(88dvh, 760px);
  }

  .document-template-picker-modal .regab-template-gallery {
    grid-template-columns: 1fr;
  }

  .regab-template-picker-intro h2 {
    font-size: 26px;
  }
}
