:root {
  --bg: #e8e5d4;
  --panel: #e3a923;
  --panel-border: #26377d;
  --azul: #26377d;
  --text: #e9e6df;
  --text-black: black;
  --text-blue: #26377d;
  --text-blue: #8b8f9b;
  --celeste: #588dc5;
  --celeste-dim: #6b5228;
  --green: #6fcf97;
  --danger: #e2645a;
  --radius: 10px;
  --mono: "JetBrains Mono", "SFMono-Regular", Consolas, monospace;
  --sans: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --opensans: "Open Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  background-image:
    radial-gradient(circle at 20% 0%, rgba(232,161,61,0.06), transparent 45%),
    radial-gradient(circle at 80% 100%, rgba(111,207,151,0.04), transparent 45%);
  color: var(--text-black);
  font-family: var(--opensans);
  display: flex;
  justify-content: center;
  padding: 48px 20px 80px;
}

.studio {
  width: 100%;
  max-width: 560px;
}

.studio__header {
  margin-bottom: 28px;
  color: var(--text-black);
}

.studio__brand {
  display: flex;
  align-items: center;
  gap: 10px;
}

.studio__dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--celeste);
  box-shadow: 0 0 10px 2px rgba(232,161,61,0.6);
  flex-shrink: 0;
}

.studio__header h1 {
  font-family: var(--mono);
  font-size: 20px;
  font-weight: 600;
  letter-spacing: 0.02em;
  margin: 0;
}

.studio__subtitle {
  color: var(--text-black);
  font-size: 13.5px;
  margin: 6px 0 0 20px;
}

.panel {
  background: var(--panel);
  border: 4px solid var(--panel-border);
  border-radius: var(--radius);
  padding: 22px;
  margin-bottom: 18px;
}

.panel__label {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--text);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 16px;
  display: flex;
  gap: 8px;
}

.panel__label span {
  color: var(--celeste);
}

/* --- Dropzone / signature waveform element --- */

.dropzone {
  border: 1.5px dashed var(--panel-border);
  border-radius: var(--radius);
  padding: 36px 20px;
  text-align: center;
  transition: border-color 0.2s ease, background 0.2s ease;
  cursor: pointer;
  background: var(--celeste);
}

.dropzone.dropzone--active {
  border-color: var(--celeste);
  /*background: rgba(232,161,61,0.05);*/
  background: var(--azul);
}

.dropzone__bars {
  display: flex;
  justify-content: center;
  align-items: flex-end;
  gap: 4px;
  height: 34px;
  margin-bottom: 14px;
}

.dropzone__bars span {
  width: 4px;
  background: var(--celeste-dim);
  border-radius: 2px;
  height: 30%;
  transition: background 0.2s ease;
}

.dropzone--active .dropzone__bars span,
.dropzone--filled .dropzone__bars span {
  background: var(--celeste);
}

.dropzone__bars span:nth-child(1) { height: 40%; }
.dropzone__bars span:nth-child(2) { height: 70%; }
.dropzone__bars span:nth-child(3) { height: 45%; }
.dropzone__bars span:nth-child(4) { height: 100%; }
.dropzone__bars span:nth-child(5) { height: 55%; }
.dropzone__bars span:nth-child(6) { height: 80%; }
.dropzone__bars span:nth-child(7) { height: 35%; }

.dropzone__text {
  margin: 0 0 4px;
  font-size: 15px;
}

.dropzone__or {
  color: var(--text-black);
  font-size: 12px;
  margin: 4px 0 12px;
}

.dropzone__hint {
  color: var(--text-black);
  font-size: 12px;
  margin: 12px 0 0;
}

/* --- Buttons --- */

.btn {
  font-family: var(--opensans);
  font-size: 14px;
  font-weight: 600;
  border: none;
  border-radius: 8px;
  padding: 11px 18px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  transition: transform 0.1s ease, opacity 0.15s ease;
}

.btn:active { transform: scale(0.97); }

.btn--primary {
  background: var(--celeste);
  color: #1a1406;
  width: 100%;
  padding: 13px;
  font-size: 15px;
}

.btn--primary:hover { opacity: 0.92; }

.btn--ghost {
  background: transparent;
  border: 1px solid var(--panel-border);
  color: var(--text-black);
}

.btn--ghost:hover { border-color: var(--celeste); }

.btn--small {
  padding: 8px 14px;
  font-size: 13px;
}

.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* --- Config panel --- */

.textpreview {
  width: 100%;
  background: #101216;
  border: 1px solid var(--panel-border);
  border-radius: 8px;
  color: var(--text);
  font-family: var(--opensans);
  font-size: 13.5px;
  line-height: 1.5;
  padding: 12px;
  resize: vertical;
}

.charcount {
  font-family: var(--mono);
  font-size: 11.5px;
  color: var(--text-black);
  margin: 6px 0 20px;
  text-align: right;
}

.controls {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-bottom: 20px;
}

.control label {
  display: block;
  font-size: 12.5px;
  color: var(--text);
  margin-bottom: 8px;
}

.control select,
.control input[type="range"] {
  width: 100%;
}

.control select {
  background: #101216;
  color: var(--text-black);
  border: 1px solid var(--panel-border);
  border-radius: 6px;
  padding: 9px 8px;
  font-size: 13.5px;
}

.control input[type="range"] {
  accent-color: var(--celeste);
}

/* --- Result --- */

#audioPlayer {
  width: 100%;
  margin-bottom: 8px;
}

.filesize {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--text-black);
  margin: 0 0 16px;
}

.result-actions {
  display: flex;
  gap: 10px;
}

.result-actions .btn { flex: 1; }

.telegram-form {
  display: flex;
  gap: 8px;
  margin-top: 14px;
}

.telegram-form input {
  flex: 1;
  background: #101216;
  border: 1px solid var(--panel-border);
  border-radius: 6px;
  color: var(--text-black);
  padding: 9px 10px;
  font-size: 13px;
}

/* --- Status messages --- */

.status {
  margin-top: 14px;
  font-size: 13px;
  padding: 10px 12px;
  border-radius: 6px;
}

.status--ok {
  background: rgba(111,207,151,0.1);
  color: var(--green);
}

.status--error {
  background: rgba(226,100,90,0.1);
  color: var(--danger);
}

/* --- Loading overlay --- */

.loading {
  position: fixed;
  inset: 0;
  background: rgba(20,22,26,0.85);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 18px;
  backdrop-filter: blur(2px);
}

.loading[hidden] {
  display: none !important; 
}

.loading__bars {
  display: flex;
  gap: 6px;
  align-items: flex-end;
  height: 40px;
}

.loading__bars span {
  width: 6px;
  background: var(--celeste);
  border-radius: 3px;
  animation: bounce 1s ease-in-out infinite;
}

.loading__bars span:nth-child(1) { animation-delay: 0s; }
.loading__bars span:nth-child(2) { animation-delay: 0.1s; }
.loading__bars span:nth-child(3) { animation-delay: 0.2s; }
.loading__bars span:nth-child(4) { animation-delay: 0.3s; }
.loading__bars span:nth-child(5) { animation-delay: 0.4s; }

@keyframes bounce {
  0%, 100% { height: 10px; }
  50% { height: 38px; }
}

.loading p {
  font-family: var(--mono);
  font-size: 13px;
  color: var(--text-black);
}

@media (prefers-reduced-motion: reduce) {
  .loading__bars span { animation: none; height: 24px; }
}

@media (max-width: 480px) {
  .controls { grid-template-columns: 1fr; }
}
