.rsam-form-wrap {
  width: 100%;
  max-width: none;
  margin: 18px 0 22px;
  padding: 16px;
  box-sizing: border-box;
  border: 1px solid #d7e2f0;
  border-radius: 14px;
  background: linear-gradient(180deg, #ffffff 0%, #f7fbff 100%);
  box-shadow: 0 14px 34px rgba(13, 45, 78, .12);
  position: relative;
  overflow: hidden;
}

.rsam-form-wrap::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 5px;
  background: #0f2238;
}

.rsam-question {
  position: relative;
  margin: 0 0 12px;
  color: #111827;
  font-size: 15px;
  font-weight: 700;
  line-height: 1.4;
  padding-left: 4px;
}

.rsam-prompt,
.rsam-description {
  position: relative;
  margin: -4px 0 12px;
  padding-left: 4px;
  color: #334155;
  font-size: 14px;
  line-height: 1.45;
}

.rsam-description {
  color: #475569;
  font-size: 13px;
}

.rsam-actions {
  position: relative;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 9px;
}

.rsam-action-btn,
.rsam-submit-btn,
.rsam-rec-btn {
  min-height: 44px;
  border: 1px solid transparent;
  border-radius: 999px;
  padding: 11px 17px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .25em;
  font-size: 14px;
  font-weight: 700;
  line-height: 1.2;
  text-align: center;
  white-space: normal;
  overflow-wrap: anywhere;
  transition: transform .16s ease, box-shadow .16s ease, background-color .16s ease, filter .16s ease;
}

.rsam-action-btn--audio,
.rsam-action-btn--text {
  border-color: #244d75;
  background: #0f2238;
  box-shadow: 0 10px 22px rgba(15, 34, 56, .18);
  color: #e8f3ff;
}

.rsam-action-btn.is-active,
.rsam-action-btn[aria-expanded="true"] {
  border-color: #0d5ea7;
  background: #0d5ea7;
  box-shadow: 0 12px 26px rgba(13, 94, 167, .24);
}

.rsam-action-btn__line {
  display: inline;
}

.rsam-rec-btn {
  border-color: #ba0000;
  background: #d00000;
  color: #fff;
}

.rsam-submit-btn {
  border-color: #168044;
  background: #16a34a;
  color: #fff;
}

.rsam-action-btn:hover,
.rsam-submit-btn:hover,
.rsam-rec-btn:hover {
  filter: brightness(.97);
  transform: translateY(-1px);
}

.rsam-action-btn:focus-visible,
.rsam-submit-btn:focus-visible,
.rsam-rec-btn:focus-visible {
  outline: 3px solid rgba(49, 115, 190, .28);
  outline-offset: 3px;
}

.rsam-submit-btn:disabled,
.rsam-rec-btn:disabled {
  cursor: not-allowed;
  opacity: .6;
}

.rsam-rec-btn {
  min-width: 92px;
  letter-spacing: .06em;
  box-shadow: 0 10px 22px rgba(208, 0, 0, .18);
}

.rsam-rec-btn[data-state="recording"] {
  background: #4b5563;
}

.rsam-modal[hidden],
.rsam-panel[hidden],
.rsam-preview[hidden],
.rsam-submit-row[hidden] {
  display: none !important;
}

.rsam-modal {
  position: relative;
  z-index: auto;
  display: block;
  margin-top: 12px;
  padding: 0;
  box-sizing: border-box;
  height: auto;
  overflow: visible;
}

.rsam-modal-backdrop {
  display: none;
}

.rsam-dialog {
  position: relative;
  width: 100%;
  max-height: none;
  overflow: visible;
  box-sizing: border-box;
  border: 0;
  border-radius: 0;
  background: transparent;
  padding: 0;
  box-shadow: none;
}

.rsam-dialog::before {
  display: none;
}

.rsam-modal-title {
  display: none;
}

.rsam-modal-prompt,
.rsam-modal-description {
  margin: 0 40px 12px 0;
  color: #334155;
  font-size: 14px;
  line-height: 1.45;
}

.rsam-modal-description {
  color: #64748b;
  font-size: 13px;
}

.rsam-panel {
  border: 0;
  border-radius: 0;
  background: transparent;
  padding: 0;
  box-shadow: none;
}

.rsam-row {
  margin-bottom: 14px;
}

.rsam-label {
  display: block;
  margin-bottom: 5px;
  color: #1f2937;
  font-size: 13px;
  font-weight: 600;
  line-height: 1.35;
}

.rsam-input {
  width: 100%;
  box-sizing: border-box;
  border: 1px solid #cbd5e1;
  border-radius: 10px;
  padding: 11px 12px;
  color: #0f172a;
  background: #f8fafc;
  font-size: 15px;
  line-height: 1.35;
}

.rsam-input:focus {
  border-color: #244d75;
  background: #ffffff;
  outline: none;
  box-shadow: 0 0 0 3px rgba(36, 77, 117, .13);
}

.rsam-checkbox:focus-visible {
  outline: 3px solid rgba(49, 115, 190, .28);
  outline-offset: 3px;
}

.rsam-textarea {
  min-height: 132px;
  resize: vertical;
}

.rsam-consent {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  margin: 0 0 14px;
  color: #334155;
  font-size: 13px;
  line-height: 1.4;
}

.rsam-consent input {
  flex: 0 0 auto;
  margin-top: 2px;
}

.rsam-recorder-row {
  display: flex;
  align-items: center;
  gap: 12px;
}

.rsam-timer {
  color: #334155;
  font-size: 14px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.rsam-preview {
  width: 100%;
  margin: 2px 0 14px;
}

.rsam-status {
  min-height: 19px;
  margin: 8px 0 0;
  color: #334155;
  font-size: 13px;
  line-height: 1.45;
}

body.rsam-modal-open {
  overflow: hidden;
}

@media (max-width: 520px) {
  .rsam-form-wrap {
    padding: 16px;
    max-width: none;
  }

  .rsam-action-btn {
    width: 100%;
    min-height: 56px;
    padding: 10px 8px;
    font-size: 13px;
    flex-direction: column;
    gap: 2px;
  }

  .rsam-action-btn__line {
    display: block;
  }

  .rsam-dialog {
    width: 100%;
    max-height: none;
    padding: 0;
    border-radius: 0;
  }

  .rsam-modal {
    padding: 0;
  }
}
