.dsk-voice-form-launcher,
.dsk-voice-form-overlay,
.dsk-voice-form-overlay * {
  box-sizing: border-box;
}

.dsk-voice-form-launcher {
  display: flex;
  grid-column: 1 / -1;
  align-items: center;
  gap: 14px;
  width: 100%;
  margin: 0 0 22px;
  padding: 16px;
  border: 1px solid rgba(5, 150, 105, 0.2);
  border-radius: 16px;
  background: linear-gradient(135deg, rgba(236, 253, 245, 0.92), rgba(240, 249, 255, 0.92));
  color: #0f172a;
}

.dsk-voice-form-launcher__button,
.dsk-voice-form-button {
  min-height: 46px;
  border: 1px solid transparent;
  border-radius: 999px;
  font: inherit;
  font-size: 0.95rem;
  font-weight: 800;
  line-height: 1.2;
  cursor: pointer;
}

.dsk-voice-form-launcher__button {
  flex: 0 0 auto;
  padding: 12px 20px;
  background: #047857;
  color: #fff;
  box-shadow: 0 10px 24px rgba(4, 120, 87, 0.2);
}

.dsk-voice-form-launcher__button:hover,
.dsk-voice-form-button--primary:hover {
  background: #065f46;
}

.dsk-voice-form-launcher__hint {
  max-width: 60ch;
  margin: 0;
  color: #475569;
  font-size: 0.88rem;
  line-height: 1.5;
}

html.dsk-voice-form-open,
html body.dsk-voice-form-open {
  overflow: hidden;
  overflow-y: hidden;
}

.dsk-voice-form-overlay {
  position: fixed;
  z-index: 2147483500;
  inset: 0;
  display: grid;
  place-items: center;
  padding: clamp(12px, 3vw, 32px);
  overflow: auto;
  background: rgba(8, 15, 25, 0.68);
  color: #0f172a;
  font-family: "DSK Inter", Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

.dsk-voice-form-overlay[hidden] {
  display: none;
}

.dsk-voice-form-dialog {
  width: min(760px, 100%);
  max-height: min(88dvh, 820px);
  overflow: auto;
  border: 1px solid rgba(15, 23, 42, 0.1);
  border-radius: 24px;
  background: #fff;
  box-shadow: 0 30px 80px rgba(2, 8, 23, 0.36);
}

.dsk-voice-form-dialog__header {
  position: sticky;
  z-index: 2;
  top: 0;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  padding: 24px 26px 14px;
  border-bottom: 1px solid #e7edf2;
  background: #fff;
}

.dsk-voice-form-dialog__title {
  margin: 0;
  color: #0f172a;
  font-size: clamp(1.25rem, 2vw, 1.65rem);
  line-height: 1.2;
  letter-spacing: -0.025em;
}

.dsk-voice-form-dialog__close {
  display: grid;
  flex: 0 0 44px;
  width: 44px;
  height: 44px;
  place-items: center;
  padding: 0;
  border: 1px solid #cbd5e1;
  border-radius: 50%;
  background: #f8fafc;
  color: #0f172a;
  font: inherit;
  font-size: 1.65rem;
  line-height: 1;
  cursor: pointer;
}

.dsk-voice-form-dialog__body {
  padding: 24px 26px 10px;
}

.dsk-voice-form-dialog__intro,
.dsk-voice-form-state__hint {
  max-width: 66ch;
  margin: 0 0 18px;
  color: #475569;
  font-size: 0.95rem;
  line-height: 1.58;
}

.dsk-voice-form-state__title {
  margin: 0 0 9px;
  color: #0f172a;
  font-size: 1.2rem;
  line-height: 1.3;
}

.dsk-voice-form-consent {
  display: grid;
  grid-template-columns: 24px minmax(0, 1fr);
  gap: 12px;
  align-items: start;
  padding: 16px;
  border: 1px solid #b8c7d4;
  border-radius: 16px;
  background: #f8fafc;
  cursor: pointer;
}

.dsk-voice-form-consent input,
.dsk-voice-form-review__check input {
  width: 20px;
  height: 20px;
  margin: 1px 0 0;
  accent-color: #047857;
}

.dsk-voice-form-consent__text {
  color: #334155;
  font-size: 0.9rem;
  line-height: 1.55;
}

.dsk-voice-form-timer {
  display: inline-grid;
  min-width: 76px;
  min-height: 40px;
  place-items: center;
  margin: 0 0 16px;
  padding: 8px 14px;
  border-radius: 999px;
  background: #fee2e2;
  color: #991b1b;
  font-size: 0.95rem;
  font-weight: 900;
}

.dsk-voice-form-transcript,
.dsk-voice-form-error {
  padding: 16px;
  border-radius: 16px;
}

.dsk-voice-form-transcript {
  border: 1px solid #bae6fd;
  background: #f0f9ff;
}

.dsk-voice-form-transcript__label {
  display: block;
  margin: 0 0 7px;
  color: #075985;
  font-size: 0.8rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.dsk-voice-form-transcript__value {
  margin: 0;
  color: #334155;
  line-height: 1.55;
}

.dsk-voice-form-review {
  display: grid;
  gap: 14px;
}

.dsk-voice-form-review__row {
  min-width: 0;
  padding: 16px;
  border: 1px solid #dbe4ea;
  border-radius: 16px;
  background: #f8fafc;
}

.dsk-voice-form-review__header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 10px;
}

.dsk-voice-form-review__label {
  color: #0f172a;
  font-size: 0.95rem;
  line-height: 1.4;
}

.dsk-voice-form-review__source-label {
  display: block;
  margin: 10px 0 6px;
  color: #334155;
  font-size: 0.78rem;
  font-weight: 800;
  line-height: 1.4;
}

.dsk-voice-form-review__check {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 44px;
  padding: 5px 0;
  box-sizing: border-box;
  color: #334155;
  font-size: 0.82rem;
  font-weight: 700;
  line-height: 1.35;
  cursor: pointer;
}

.dsk-voice-form-review__editor {
  display: block;
  width: 100%;
  inline-size: 100%;
  min-width: 0;
  min-inline-size: 0;
  max-width: 100%;
  box-sizing: border-box;
  min-height: 46px;
  padding: 11px 13px;
  border: 1px solid #94a3b8;
  border-radius: 11px;
  background: #fff;
  color: #0f172a;
  font: inherit;
  font-size: 0.95rem;
  line-height: 1.45;
}

textarea.dsk-voice-form-review__editor {
  min-height: 116px;
  resize: vertical;
}

.dsk-voice-form-review__current {
  margin: 0;
  color: #64748b;
  font-size: 0.78rem;
  line-height: 1.45;
  overflow-wrap: anywhere;
}

.dsk-voice-form-review__error {
  margin: 14px 0 0;
  padding: 12px 14px;
  border: 1px solid #fecaca;
  border-radius: 12px;
  background: #fef2f2;
  color: #991b1b;
  font-size: 0.88rem;
  font-weight: 700;
  line-height: 1.45;
}

.dsk-voice-form-error {
  border: 1px solid #fecaca;
  background: #fef2f2;
  color: #991b1b;
  font-size: 0.95rem;
  line-height: 1.55;
}

.dsk-voice-form-dialog__live {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

.dsk-voice-form-field-applied {
  outline: 3px solid rgba(5, 150, 105, 0.36);
  outline-offset: 3px;
  box-shadow: 0 0 0 5px rgba(5, 150, 105, 0.09);
  transition: outline-color 180ms ease, box-shadow 180ms ease;
}

.dsk-voice-form-dialog__actions {
  position: sticky;
  bottom: 0;
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  padding: 16px 26px calc(18px + env(safe-area-inset-bottom, 0px));
  border-top: 1px solid #e7edf2;
  background: #fff;
}

.dsk-voice-form-button {
  padding: 12px 20px;
}

.dsk-voice-form-button--primary {
  background: #047857;
  color: #fff;
}

.dsk-voice-form-button--secondary {
  border-color: #b8c7d4;
  background: #fff;
  color: #0f172a;
}

.dsk-voice-form-button:disabled {
  cursor: not-allowed;
  opacity: 0.5;
}

.dsk-voice-form-launcher__button:focus-visible,
.dsk-voice-form-button:focus-visible,
.dsk-voice-form-dialog__close:focus-visible,
.dsk-voice-form-consent:focus-within,
.dsk-voice-form-review__check:focus-within,
.dsk-voice-form-review__editor:focus-visible {
  outline: 3px solid rgba(14, 165, 233, 0.42);
  outline-offset: 3px;
}

@media (max-width: 640px) {
  .dsk-voice-form-launcher {
    align-items: stretch;
    flex-direction: column;
    padding: 14px;
  }

  .dsk-voice-form-launcher__button {
    width: 100%;
  }

  .dsk-voice-form-overlay {
    align-items: end;
    padding: 8px;
  }

  .dsk-voice-form-dialog {
    width: 100%;
    max-height: calc(100dvh - 16px);
    border-radius: 20px;
  }

  .dsk-voice-form-dialog__header {
    padding: 18px 18px 12px;
  }

  .dsk-voice-form-dialog__body {
    padding: 18px 18px 8px;
  }

  .dsk-voice-form-dialog__actions {
    display: grid;
    grid-template-columns: 1fr;
    padding: 14px 18px calc(14px + env(safe-area-inset-bottom, 0px));
  }

  .dsk-voice-form-button {
    width: 100%;
  }

  .dsk-voice-form-review__header {
    align-items: stretch;
    flex-direction: column;
  }
}

@media (prefers-reduced-motion: reduce) {
  .dsk-voice-form-overlay *,
  .dsk-voice-form-field-applied {
    scroll-behavior: auto;
    transition: none;
  }
}
