.settings-modal {
  position: fixed;
  inset: 0;
  z-index: 2000;
  display: grid;
  place-items: center;
  padding: 18px;
  background: rgba(15, 23, 42, .45);
}

.settings-modal[hidden] {
  display: none;
}

.settings-modal__box {
  width: min(760px, 100%);
  max-height: min(780px, 92vh);
  overflow: auto;
  border-radius: 18px;
  background: #fff;
  color: #0f172a;
  box-shadow: 0 24px 70px rgba(15, 23, 42, .25);
}

.settings-modal__header {
  position: sticky;
  top: 0;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 18px 22px;
  border-bottom: 1px solid #e2e8f0;
  background: rgba(255,255,255,.96);
}

.settings-modal__header h2 {
  margin: 0;
  font-size: 1.35rem;
}

.settings-modal__close {
  min-width: 42px;
  min-height: 42px;
  border: 1px solid #cbd5e1;
  border-radius: 10px;
  background: #fff;
  cursor: pointer;
}

.settings-modal__body {
  display: grid;
  gap: 16px;
  padding: 20px 22px 24px;
}

.settings-section {
  display: grid;
  gap: 12px;
  padding: 16px;
  border: 1px solid #e2e8f0;
  border-radius: 14px;
  background: #f8fafc;
}

.settings-section h3 {
  margin: 0 0 4px;
  font-size: 1.05rem;
}

.settings-section label {
  display: grid;
  gap: 6px;
}

.settings-section select,
.settings-section input[type="number"] {
  min-height: 40px;
  max-width: 280px;
  padding: 6px 10px;
  border: 1px solid #cbd5e1;
  border-radius: 9px;
  background: #fff;
  font: inherit;
}

.settings-check {
  display: flex !important;
  align-items: center;
  gap: 10px !important;
}

.settings-check input {
  width: 18px;
  height: 18px;
}

@media (max-width: 620px) {
  .settings-modal {
    padding: 10px;
    place-items: stretch;
  }

  .settings-modal__box {
    max-height: calc(100vh - 20px);
  }
}