.temporary-theme-modal.modal {
  overflow-x: hidden;
  overflow-y: hidden;
  overscroll-behavior: none;
}

.temporary-theme-modal .modal-dialog {
  --temporary-theme-modal-top-offset: calc(72px + env(safe-area-inset-top));
  margin-top: calc(var(--temporary-theme-modal-top-offset) + 0.5rem);
  margin-bottom: 0.5rem;
  max-width: 42rem;
}

.temporary-theme-modal .modal-dialog.modal-dialog-centered {
  align-items: flex-start;
  min-height: auto;
}

.temporary-theme-modal .modal-content {
  display: flex;
  flex-direction: column;
  max-height: calc(100dvh - var(--temporary-theme-modal-top-offset) - 1rem);
  min-height: 0;
  overflow: hidden;
}

.temporary-theme-modal .modal-content > form {
  display: flex;
  flex: 1 1 auto;
  flex-direction: column;
  min-height: 0;
  overflow: hidden;
}

.temporary-theme-modal .modal-header,
.temporary-theme-modal .modal-footer {
  flex: 0 0 auto;
}

.temporary-theme-modal .modal-body {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  padding: 0.75rem;
}

.temporary-theme-modal__copy,
.temporary-theme-modal__field-head span,
.temporary-theme-modal__date small {
  color: var(--text-tertiary);
  font-size: var(--font-xs);
}

.temporary-theme-modal__date {
  display: grid;
  gap: 0.2rem 0.5rem;
  grid-template-columns: auto minmax(0, 1fr);
  margin-bottom: 0.75rem;
}

.temporary-theme-modal__date .form-label {
  color: var(--text-secondary);
  font-size: var(--font-sm);
  font-weight: 700;
  margin: 0;
  place-self: center start;
}

.temporary-theme-modal__date .form-control {
  min-height: 2rem;
  padding: 0.25rem 0.45rem;
}

.temporary-theme-modal__date small {
  grid-column: 1 / -1;
}

.temporary-theme-modal__date .temporary-theme-modal__date-error {
  color: var(--danger, #ef4444);
}

.temporary-theme-modal__presets {
  border-bottom: 1px solid var(--border-primary);
  margin-bottom: 0.75rem;
  padding-bottom: 0.6rem;
}

.temporary-theme-modal__presets h6 {
  color: var(--text-secondary);
  font-size: var(--font-sm);
  display: flex;
  justify-content: space-between;
  margin-bottom: 0.35rem;
}

.temporary-theme-modal__presets h6 span {
  color: var(--text-tertiary);
  font-size: var(--font-xs);
  font-weight: 400;
}

.temporary-theme-modal__preset-list {
  display: flex;
  flex-wrap: nowrap;
  gap: 0.4rem;
  margin: 0 -0.75rem;
  overflow-x: auto;
  overflow-y: hidden;
  overscroll-behavior-inline: contain;
  padding: 0.1rem 0.75rem 0.45rem;
  scroll-snap-type: x proximity;
  scrollbar-width: thin;
  -webkit-overflow-scrolling: touch;
}

.temporary-theme-modal__preset {
  align-items: center;
  background: var(--bg-tertiary);
  border: 1px solid var(--border-primary);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  display: inline-flex;
  flex: 0 0 auto;
  font-size: var(--font-xs);
  gap: 0.4rem;
  padding: 0.35rem 0.5rem;
  scroll-snap-align: start;
  white-space: nowrap;
}

.temporary-theme-modal__preset:hover,
.temporary-theme-modal__preset:focus-visible {
  border-color: var(--accent-primary);
}

.temporary-theme-modal__preset-swatches {
  display: inline-flex;
}

.temporary-theme-modal__preset-swatches i {
  border: 1px solid rgba(255, 255, 255, 0.35);
  border-radius: 50%;
  height: 0.85rem;
  margin-left: -0.15rem;
  width: 0.85rem;
}

.temporary-theme-modal__grid {
  display: grid;
  gap: 0.5rem;
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.temporary-theme-modal__field-head {
  align-items: baseline;
  display: flex;
  justify-content: space-between;
}

.temporary-theme-modal__field-head .form-label {
  color: var(--text-secondary);
  font-size: var(--font-xs);
  font-weight: 700;
  margin-bottom: 0.1rem;
}

.temporary-theme-modal__input-row {
  align-items: center;
  display: grid;
  gap: 0.25rem;
  grid-template-columns: 1.25rem minmax(0, 1fr) 1.65rem;
}

.temporary-theme-modal__swatch {
  border: 1px solid var(--border-primary);
  border-radius: var(--radius-sm);
  height: 1.25rem;
  width: 1.25rem;
}

.temporary-theme-modal__input {
  font-family: var(--font-family-monospace, monospace);
  font-size: var(--font-sm);
  min-height: 1.85rem;
  min-width: 0;
  padding: 0.2rem 0.3rem;
  text-transform: uppercase;
}

.temporary-theme-modal__picker {
  cursor: pointer;
  height: 1.65rem;
  padding: 0;
  width: 1.65rem;
}

@media (max-width: 575.98px) {
  .temporary-theme-modal .modal-dialog {
    margin-left: 0.5rem;
    margin-right: 0.5rem;
    max-width: calc(100vw - 1rem);
  }

  .temporary-theme-modal__grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .temporary-theme-modal__field-head span {
    display: none;
  }
}
