/* Tavrida Sound — студийная тёмная тема */
* { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --bg: #0b0d14;
  --bg-2: #11141f;
  --card: #171b2a;
  --card-2: #1d2235;
  --line: #262c42;
  --text: #e8eaf2;
  --muted: #8b91a7;
  --accent: #7c6cff;
  --accent-2: #38d4c3;
  --grad: linear-gradient(135deg, #7c6cff 0%, #38d4c3 100%);
  --danger: #ff6b7a;
  --radius: 14px;
}

html, body { height: 100%; }
body {
  font-family: "Inter", -apple-system, "Segoe UI", Roboto, sans-serif;
  background:
    radial-gradient(1200px 600px at 80% -10%, rgba(124,108,255,.14), transparent 60%),
    radial-gradient(900px 500px at -10% 30%, rgba(56,212,195,.08), transparent 60%),
    var(--bg);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
}

.hidden { display: none !important; }

/* ---------- ворота ---------- */
.gate {
  position: fixed; inset: 0; z-index: 50;
  display: flex; align-items: center; justify-content: center;
  background: var(--bg);
}
.gate-card {
  width: min(400px, 92vw); text-align: center;
  background: var(--card); border: 1px solid var(--line);
  border-radius: 20px; padding: 44px 36px;
  box-shadow: 0 30px 80px rgba(0,0,0,.5);
}
.gate-card h1 { margin: 14px 0 6px; font-size: 26px; letter-spacing: .3px; }
.gate-card p { color: var(--muted); font-size: 14px; margin-bottom: 22px; }
.gate-card input {
  width: 100%; padding: 13px 16px; margin-bottom: 12px;
  background: var(--bg-2); border: 1px solid var(--line); border-radius: 10px;
  color: var(--text); font-size: 16px; text-align: center; letter-spacing: 2px;
}
.gate-card button {
  width: 100%; padding: 13px; border: 0; border-radius: 10px;
  background: var(--grad); color: #fff; font-size: 15px; font-weight: 600; cursor: pointer;
}
.gate-error { color: var(--danger); font-size: 13px; margin-top: 10px; min-height: 18px; }
.logo-mark { font-size: 34px; }

/* ---------- каркас ---------- */
.app { max-width: 1060px; margin: 0 auto; padding: 22px 20px 60px; }

header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 20px; }
.brand { display: flex; gap: 12px; align-items: center; }
.brand .logo-mark { font-size: 30px; }
.brand-title { font-size: 20px; font-weight: 700; letter-spacing: .3px; }
.brand-sub { font-size: 12px; color: var(--muted); }
.budget {
  font-size: 12.5px; color: var(--muted);
  background: var(--card); border: 1px solid var(--line);
  padding: 8px 14px; border-radius: 999px;
}
.budget b { color: var(--accent-2); }

/* ---------- вкладки ---------- */
.tabs { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 18px; }
.tabs button {
  padding: 10px 15px; border-radius: 999px; border: 1px solid var(--line);
  background: var(--card); color: var(--muted); font-size: 13.5px; cursor: pointer;
  transition: all .15s;
}
.tabs button:hover { color: var(--text); border-color: #3a415e; }
.tabs button.active {
  background: var(--grad); border-color: transparent; color: #fff; font-weight: 600;
  box-shadow: 0 6px 20px rgba(124,108,255,.35);
}

/* ---------- панели ---------- */
.panel {
  display: none;
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 26px;
}
.panel.active { display: block; animation: fade .2s ease; }
@keyframes fade { from { opacity: 0; transform: translateY(4px); } }

.hint { color: var(--muted); font-size: 13.5px; margin-bottom: 18px; line-height: 1.5; }
.hint b { color: var(--text); }

.lbl { display: block; font-size: 12px; text-transform: uppercase; letter-spacing: 1.2px; color: var(--muted); margin: 18px 0 8px; }
.lbl:first-child { margin-top: 0; }
.lbl small { text-transform: none; letter-spacing: 0; }

textarea, input[type="text"], input[type="password"], select {
  width: 100%; padding: 12px 14px;
  background: var(--bg-2); border: 1px solid var(--line); border-radius: 10px;
  color: var(--text); font-size: 14.5px; font-family: inherit; resize: vertical;
}
textarea:focus, input:focus, select:focus { outline: none; border-color: var(--accent); }
select { cursor: pointer; }

.row { display: flex; gap: 18px; align-items: flex-end; flex-wrap: wrap; margin-top: 6px; }
.row > div { min-width: 160px; }

/* pills */
.pills { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 6px; }
.pills button {
  display: flex; flex-direction: column; align-items: flex-start; gap: 1px;
  padding: 9px 14px; border-radius: 10px; border: 1px solid var(--line);
  background: var(--bg-2); color: var(--text); font-size: 13.5px; cursor: pointer;
}
.pills button small { color: var(--muted); font-size: 11px; }
.pills button.active { border-color: var(--accent); background: rgba(124,108,255,.12); }
.pills.small button { padding: 7px 12px; }

/* voice grid */
.voice-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(148px, 1fr));
  gap: 8px; margin-bottom: 4px;
}
.voice-card {
  padding: 10px 12px; border-radius: 10px; border: 1px solid var(--line);
  background: var(--bg-2); cursor: pointer; transition: all .12s;
}
.voice-card:hover { border-color: #3a415e; }
.voice-card.active { border-color: var(--accent); background: rgba(124,108,255,.13); }
.voice-card .vn { font-size: 13.5px; font-weight: 600; }
.voice-card .vd { font-size: 11px; color: var(--muted); margin-top: 2px; line-height: 1.35; }

/* sliders */
.sliders { display: flex; flex-direction: column; gap: 10px; margin-top: 14px; }
.sliders label { font-size: 13px; color: var(--muted); }
.sliders .val { color: var(--accent-2); font-weight: 600; margin-left: 4px; }
input[type="range"] {
  width: 100%; margin-top: 6px; accent-color: var(--accent); height: 4px;
}

.chk { display: flex; gap: 8px; align-items: center; font-size: 13.5px; color: var(--muted); cursor: pointer; margin-top: 12px; }
.chk input { accent-color: var(--accent); width: 16px; height: 16px; }

/* examples chips */
.examples { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 14px; }
.examples span {
  font-size: 12px; color: var(--muted); background: var(--bg-2);
  border: 1px dashed var(--line); padding: 6px 11px; border-radius: 999px; cursor: pointer;
}
.examples span:hover { color: var(--text); border-color: var(--accent); }

/* recorder */
.rec {
  display: flex; gap: 10px; align-items: center; flex-wrap: wrap;
  background: var(--bg-2); border: 1px solid var(--line); border-radius: 10px; padding: 12px 14px;
}
.rec button {
  padding: 9px 15px; border-radius: 8px; border: 1px solid var(--line);
  background: var(--card-2); color: var(--text); font-size: 13px; cursor: pointer;
}
.rec button.recording { background: var(--danger); border-color: transparent; color: #fff; animation: pulse 1.2s infinite; }
@keyframes pulse { 50% { opacity: .65; } }
.rec .rec-status { font-size: 12.5px; color: var(--muted); }
.rec audio { height: 34px; max-width: 260px; }
.rec input[type="file"] { display: none; }

/* limit badge */
.limit-badge {
  font-size: 11.5px; color: var(--accent-2);
  border: 1px solid rgba(56,212,195,.35); border-radius: 999px; padding: 2px 9px; white-space: nowrap;
}

/* go button */
.go {
  margin-top: 22px; padding: 13px 26px; border: 0; border-radius: 11px;
  background: var(--grad); color: #fff; font-size: 15px; font-weight: 600; cursor: pointer;
  box-shadow: 0 8px 24px rgba(124,108,255,.3); transition: transform .1s;
}
.go:hover { transform: translateY(-1px); }
.go:disabled { opacity: .55; cursor: wait; transform: none; }

/* ---------- история ---------- */
.history { margin-top: 26px; }
.history h2 { font-size: 15px; margin-bottom: 12px; display: flex; align-items: center; gap: 12px; }
.history h2 button {
  font-size: 11.5px; color: var(--muted); background: none; border: 1px solid var(--line);
  border-radius: 999px; padding: 3px 10px; cursor: pointer;
}
.h-item {
  display: flex; gap: 14px; align-items: center; flex-wrap: wrap;
  background: var(--card); border: 1px solid var(--line); border-radius: 12px;
  padding: 12px 16px; margin-bottom: 8px; animation: fade .25s ease;
}
.h-item .h-icon { font-size: 20px; }
.h-item .h-info { flex: 1; min-width: 180px; }
.h-item .h-title { font-size: 13.5px; font-weight: 600; }
.h-item .h-sub { font-size: 12px; color: var(--muted); margin-top: 2px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 480px; }
.h-item audio { height: 36px; max-width: 320px; }
.h-item .h-cost { font-size: 11.5px; color: var(--accent-2); white-space: nowrap; }
.h-item .h-dl { font-size: 12px; color: var(--accent); text-decoration: none; white-space: nowrap; }
.h-item.pending { border-style: dashed; }
.h-item .spinner {
  width: 18px; height: 18px; border-radius: 50%;
  border: 2px solid var(--line); border-top-color: var(--accent);
  animation: spin .8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.h-item.error { border-color: rgba(255,107,122,.4); }
.h-item .h-err { color: var(--danger); font-size: 12.5px; }
.h-text {
  width: 100%; font-size: 13.5px; line-height: 1.55; color: var(--text);
  background: var(--bg-2); border-radius: 8px; padding: 12px 14px; white-space: pre-wrap;
}

.stt-result { margin-top: 18px; }

footer { text-align: center; color: var(--muted); font-size: 11.5px; margin-top: 40px; }

/* toast */
.toast {
  position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%);
  background: var(--card-2); border: 1px solid var(--danger); color: var(--text);
  padding: 12px 20px; border-radius: 12px; font-size: 13.5px; z-index: 60;
  box-shadow: 0 10px 40px rgba(0,0,0,.5); animation: fade .2s ease;
}

@media (max-width: 640px) {
  .panel { padding: 18px; }
  header { flex-direction: column; gap: 10px; align-items: flex-start; }
}
