.sct-survey-layer[hidden],
.sct-survey-launcher[hidden],
.sct-survey-error[hidden] {
  display: none !important;
}

body.sct-survey-open {
  overflow: hidden;
}

.sct-survey-layer,
.sct-survey-launcher {
  font-family: inherit;
  color-scheme: dark;
}

.sct-survey-launcher {
  position: fixed;
  left: max(16px, env(safe-area-inset-left));
  bottom: max(18px, env(safe-area-inset-bottom));
  z-index: 1050;
  min-height: 42px;
  padding: 8px 16px;
  border: 1px solid #454545;
  border-radius: 22px;
  background: #1c1c1c;
  color: #f6f6f6;
  font-size: 13px;
  font-weight: 650;
  cursor: pointer;
  box-shadow: 0 4px 18px #0005;
}

.sct-survey-launcher:hover { background: #303030; }

.sct-survey-layer {
  position: fixed;
  inset: 0;
  z-index: 20500;
  display: grid;
  place-items: center;
  padding: 16px;
  background: rgba(0, 0, 0, .7);
  overscroll-behavior: contain;
}

.sct-survey-dialog {
  position: relative;
  width: min(100%, 550px);
  max-height: calc(100vh - 32px);
  max-height: calc(100dvh - 32px);
  box-sizing: border-box;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 24px;
  border: 1px solid #404040;
  border-radius: 16px;
  background: #181818;
  color: #f4f4f4;
  line-height: 1.55;
  box-shadow: 0 20px 72px #0008;
}

.sct-survey-dialog button,
.sct-survey-dialog input,
.sct-survey-dialog textarea {
  box-sizing: border-box;
  font: inherit;
}

.sct-survey-dialog button { cursor: pointer; }
.sct-survey-dialog button:disabled { opacity: .65; cursor: wait; }
.sct-survey-dialog button::after, .sct-survey-launcher::after { content: none; }

.sct-survey-dialog :is(button, input, textarea):focus-visible,
.sct-survey-launcher:focus-visible {
  outline: 2px solid #63d991;
  outline-offset: 2px;
}

.sct-survey-close {
  position: absolute;
  top: 11px;
  right: 11px;
  display: grid;
  width: 38px;
  height: 38px;
  place-items: center;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: #d3d3d3;
  font-size: 24px !important;
  line-height: 1;
}

.sct-survey-close:hover { background: #353535; }

.sct-survey-title {
  margin: 0 30px 6px 0;
  color: #f5f5f5;
  font-size: 25px;
  line-height: 1.25;
  font-weight: 700;
  overflow-wrap: anywhere;
  outline: none;
}

.sct-survey-reward {
  display: inline-flex;
  margin-bottom: 11px;
  padding: 4px 10px;
  border: 1px solid #2f6544;
  border-radius: 999px;
  background: #193426;
  color: #8ee6ab;
  font-size: 12px;
  line-height: 1.4;
  font-weight: 650;
}

.sct-survey-description {
  margin: 8px 0 0;
  color: #c7c7c7;
  font-size: 14px;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.sct-survey-form {
  display: grid;
  gap: 15px;
  margin: 20px 0 0;
}

.sct-survey-field {
  min-width: 0;
  margin: 0;
  padding: 0;
  border: 0;
}

.sct-survey-label {
  display: block;
  margin: 0 0 7px;
  padding: 0;
  font-size: 14px;
  font-weight: 650;
  overflow-wrap: anywhere;
}

.sct-survey-requirement {
  margin-inline-start: 7px;
  color: #aaa;
  font-size: 11px;
  font-weight: 400;
  white-space: nowrap;
}

.sct-survey-text {
  display: block;
  width: 100%;
  min-height: 43px;
  padding: 10px 11px;
  border: 1px solid #444;
  border-radius: 8px;
  background: #222;
  color: #f5f5f5;
  font-size: 16px !important;
  resize: vertical;
}

.sct-survey-text::placeholder { color: #999; }

.sct-survey-options {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.sct-survey-option {
  display: inline-flex;
  min-height: 40px;
  max-width: 100%;
  align-items: center;
  gap: 7px;
  box-sizing: border-box;
  padding: 7px 10px;
  border: 1px solid #484848;
  border-radius: 8px;
  background: #222;
  font-size: 13px;
  cursor: pointer;
  overflow-wrap: anywhere;
}

.sct-survey-option:hover { background: #2b2b2b; }
.sct-survey-option input { margin: 0; accent-color: #63d991; }
.sct-survey-option:has(input:checked) { border-color: #4fa775; background: #1e3528; }
.sct-survey-hint { margin: 6px 0 0; color: #aaa; font-size: 12px; }

.sct-survey-error {
  margin: 0;
  padding: 8px 10px;
  border-radius: 7px;
  background: #382422;
  color: #ffb6ae;
  font-size: 13px;
  overflow-wrap: anywhere;
}

.sct-survey-content > .sct-survey-error { margin: 14px 0 0; }

.sct-survey-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 18px;
}

.sct-survey-form .sct-survey-actions { margin-top: 0; }

.sct-survey-actions button {
  min-height: 42px;
  padding: 8px 15px;
  border: 1px solid transparent;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 650;
  line-height: 1.35;
}

.sct-survey-primary { background: #f2f2f2; color: #121212; }
.sct-survey-primary:hover:not(:disabled) { background: #fff; }
.sct-survey-actions .sct-survey-secondary { border-color: #494949; background: #242424; color: #ededed; }
.sct-survey-secondary:hover { background: #313131; }

.sct-survey-list { display: grid; gap: 8px; margin-top: 14px; }

.sct-survey-list-item {
  display: grid;
  gap: 4px;
  padding: 10px 12px;
  border: 1px solid #444;
  border-radius: 8px;
  background: #222;
  color: #f4f4f4;
  text-align: left;
  overflow-wrap: anywhere;
}

.sct-survey-list-item:hover { background: #2c2c2c; }
.sct-survey-list-item span { color: #b8b8b8; font-size: 12px; }

@media (max-width: 600px) {
  .sct-survey-layer { padding: 10px; }
  .sct-survey-dialog {
    max-height: calc(100vh - 20px);
    max-height: calc(100dvh - 20px);
    padding: 18px;
  }
  .sct-survey-title { font-size: 22px; }
  .sct-survey-launcher { left: max(10px, env(safe-area-inset-left)); bottom: max(10px, env(safe-area-inset-bottom)); }
}
