.flowspeech-wrap {
  margin-top: 20px;
  width: 100%;
  display: flex;
  justify-content: center;
}

.flowspeech-shell {
  max-width: 780px;
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.flowspeech-card {
  background:
    radial-gradient(circle at top right, rgba(249, 129, 95, 0.11), transparent 32%),
    linear-gradient(180deg, rgba(249, 129, 95, 0.03), rgba(255, 255, 255, 0.92)),
    rgba(255, 255, 255, 0.86);
  border: 1px solid #e5e7eb;
  border-radius: 20px;
  padding: 16px;
  box-shadow: none;
  backdrop-filter: blur(10px);
}

.flowspeech-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px;
  background: linear-gradient(135deg, rgba(249, 129, 95, 0.14), rgba(255, 255, 255, 0.88));
}

.flowspeech-brand-title {
  font-size: 16px;
  font-weight: 700;
  color: #1f2937;
}

.flowspeech-brand-subtitle {
  margin-top: 3px;
  font-size: 11px;
  color: #6b7280;
}

.flowspeech-chip {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 12px;
  border: 1px solid #e5e7eb;
  border-radius: 999px;
  padding: 8px 12px;
  background: rgba(255, 255, 255, 0.92);
  cursor: pointer;
}

.flowspeech-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: #111827;
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 700;
  overflow: hidden;
}

.flowspeech-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.flowspeech-chip-title {
  font-size: 12px;
  font-weight: 700;
  color: #1f2937;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 132px;
}

.flowspeech-chip-subtitle {
  margin-top: 2px;
  font-size: 11px;
  color: #6b7280;
  font-family: "JetBrains Mono", Consolas, monospace;
}

.flowspeech-section-label,
.flowspeech-field-title {
  font-size: 11px;
  font-family: "JetBrains Mono", Consolas, monospace;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #6b7280;
}

.flowspeech-section-label {
  display: inline-block;
  margin-bottom: 10px;
}

.flowspeech-field {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 14px;
}

.flowspeech-input,
.flowspeech-select,
.flowspeech-textarea {
  width: 100%;
  border: 1px solid #d1d5db;
  border-radius: 14px;
  background: #ffffff;
  color: #1f2937;
  padding: 14px;
  font-size: 14px;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.flowspeech-input:focus,
.flowspeech-select:focus,
.flowspeech-textarea:focus {
  border-color: #f9815f;
  box-shadow: 0 0 0 3px rgba(249, 129, 95, 0.15);
  outline: none;
}

.flowspeech-textarea {
  min-height: 160px;
  resize: vertical;
  line-height: 1.55;
  padding-bottom: 34px;
}

.flowspeech-textarea-wrap {
  position: relative;
}

.flowspeech-char-count {
  position: absolute;
  right: 14px;
  bottom: 10px;
  font-size: 11px;
  color: #9ca3af;
  font-family: "JetBrains Mono", Consolas, monospace;
}

.flowspeech-button-row {
  display: flex;
  gap: 10px;
  flex-direction: column;
}

.flowspeech-button-row .button {
  min-height: 48px;
  width: 100%;
  border-radius: 14px;
  border: none;
  padding: 13px 14px;
  font-weight: 700;
  transition: transform 0.12s ease, background 0.2s ease, opacity 0.2s ease;
  box-shadow: none;
}

.flowspeech-button-row .button:hover:not(:disabled) {
  transform: translateY(-1px);
}

.flowspeech-button-row .button:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.flowspeech-button-row .button.button-primary {
  background: #f9815f;
  border-color: #f9815f;
  color: #ffffff;
}

.flowspeech-button-row .button.button-primary:hover:not(:disabled) {
  background: #ef6c47;
}

.flowspeech-button-row .button.button-secondary {
  background: rgba(249, 129, 95, 0.1);
  border-color: transparent;
  color: #f9815f;
}

.flowspeech-main-card {
  padding: 16px;
}

.flowspeech-generator-panel {
  margin-top: 0;
}

.flowspeech-status {
  min-height: 22px;
  margin-top: 6px;
  font-size: 12px;
  color: #6b7280;
}

.flowspeech-status.is-error {
  color: #dc2626;
}

.flowspeech-audio-card audio {
  width: 100%;
  margin-top: 6px;
}

.flowspeech-audio-actions {
  margin-top: 14px;
}

.flowspeech-shortcode-box {
  margin-top: 16px;
  padding: 14px;
  border-radius: 14px;
  background: #fff7ed;
  border: 1px solid #fed7aa;
}

.flowspeech-shortcode-box code,
.flowspeech-card > code {
  display: block;
  padding: 12px 14px;
  margin-top: 8px;
  border-radius: 12px;
  background: #111827;
  color: #f9fafb;
  overflow-wrap: anywhere;
}

.flowspeech-overlay {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: rgba(15, 23, 42, 0.56);
  z-index: 100000;
}

.flowspeech-overlay[hidden] {
  display: none !important;
}

.flowspeech-dialog-card {
  width: 100%;
  max-width: 320px;
  border-radius: 18px;
  background: #ffffff;
  border: 1px solid #e5e7eb;
  box-shadow: 0 20px 50px rgba(15, 23, 42, 0.24);
  padding: 22px;
}

.flowspeech-dialog-title {
  font-size: 18px;
  font-weight: 700;
  color: #111827;
  margin-bottom: 8px;
}

.flowspeech-dialog-text {
  font-size: 13px;
  line-height: 1.6;
  color: #6b7280;
  margin-bottom: 18px;
}

.flowspeech-dialog-actions {
  display: flex;
  gap: 10px;
  flex-direction: row;
}

.flowspeech-dialog-actions .button {
  flex: 1;
  min-height: 44px;
  border-radius: 12px;
}

.flowspeech-user-profile {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 18px;
}

.flowspeech-avatar-large {
  width: 48px;
  height: 48px;
  flex-shrink: 0;
}

.flowspeech-profile-email {
  margin-bottom: 0;
}

.flowspeech-credits-box {
  margin-bottom: 18px;
}

.flowspeech-credits-box .flowspeech-field-title {
  margin-bottom: 10px;
}

.flowspeech-credits-value {
  font-size: 40px;
  font-weight: 700;
  color: #111827;
  line-height: 1;
  margin: 0 0 10px;
}

.flowspeech-player {
  border: 1px solid #e5e7eb;
  border-radius: 18px;
  padding: 16px;
  margin-bottom: 18px;
}

@media (max-width: 782px) {
  .flowspeech-topbar {
    flex-direction: column;
    align-items: stretch;
  }

  .flowspeech-chip {
    min-width: 0;
  }
}
