* { box-sizing: border-box; }
:root {
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    color-scheme: dark;
}
body {
    margin: 0;
    min-height: 100vh;
    background: radial-gradient(circle at top, #25264f 0, #111225 42%, #090a12 100%);
    color: #f5f7fb;
}
.container {
    width: min(980px, calc(100% - 32px));
    margin: 0 auto;
    padding: 48px 0;
}
.card {
    background: rgba(18, 20, 38, .92);
    border: 1px solid rgba(255,255,255,.09);
    border-radius: 24px;
    padding: 32px;
    box-shadow: 0 24px 70px rgba(0,0,0,.36);
    backdrop-filter: blur(12px);
}
.heading {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 24px;
    margin-bottom: 28px;
}
.eyebrow {
    display: inline-block;
    margin-bottom: 8px;
    font-size: 13px;
    font-weight: 800;
    letter-spacing: .12em;
    text-transform: uppercase;
    color: #aeb6ff;
}
h1 { margin: 0 0 8px; font-size: clamp(30px, 5vw, 48px); line-height: 1.05; }
h2 { margin: 14px 0 18px; }
p { color: #b8bfd1; line-height: 1.6; }
.api-status, .success-badge {
    display: inline-flex;
    padding: 8px 12px;
    border-radius: 999px;
    font-size: 13px;
    font-weight: 800;
    white-space: nowrap;
}
.api-status.ok, .success-badge { background: rgba(43, 201, 126, .14); color: #73e6ad; }
.api-status.bad { background: rgba(255, 92, 92, .14); color: #ff9b9b; }
.notice {
    margin: 0 0 24px;
    padding: 14px 16px;
    border-radius: 14px;
    line-height: 1.5;
}
.notice.warning { background: rgba(255, 188, 65, .12); border: 1px solid rgba(255, 188, 65, .25); color: #ffd98d; }
.field { margin-bottom: 20px; }
label { display: block; margin-bottom: 8px; font-weight: 750; }
input, textarea, select {
    width: 100%;
    border: 1px solid #343851;
    border-radius: 13px;
    padding: 13px 14px;
    background: #0d0f1e;
    color: #f7f8fc;
    font: inherit;
    outline: none;
    transition: border-color .2s, box-shadow .2s;
}
textarea { resize: vertical; min-height: 230px; line-height: 1.5; }
input:focus, textarea:focus, select:focus { border-color: #7884ff; box-shadow: 0 0 0 3px rgba(120,132,255,.15); }
.grid { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 0 18px; }
.counter { margin-top: 6px; text-align: right; color: #747b91; font-size: 12px; }
button, .secondary {
    border: 0;
    border-radius: 13px;
    padding: 13px 18px;
    font: inherit;
    font-weight: 800;
    cursor: pointer;
    text-decoration: none;
}
.primary {
    width: 100%;
    padding: 15px 18px;
    background: linear-gradient(135deg, #727cff, #a861ff);
    color: white;
    box-shadow: 0 12px 28px rgba(111, 90, 255, .25);
}
button:disabled { opacity: .5; cursor: not-allowed; }
.secondary { display: inline-flex; align-items: center; justify-content: center; background: #24283d; color: #f3f5fb; }
.status-box, .result {
    margin-top: 24px;
    border: 1px solid #30344b;
    border-radius: 16px;
    padding: 18px;
    background: rgba(7,9,18,.55);
}
.status-box { display: flex; align-items: center; gap: 16px; }
.status-box strong { font-size: 17px; }
.status-box p { margin: 4px 0 0; }
.status-box.error { border-color: rgba(255, 84, 84, .45); background: rgba(90, 20, 27, .22); }
.spinner {
    width: 34px;
    height: 34px;
    border: 4px solid rgba(255,255,255,.16);
    border-top-color: #9099ff;
    border-radius: 50%;
    animation: spin .8s linear infinite;
    flex: 0 0 auto;
}
@keyframes spin { to { transform: rotate(360deg); } }
.hidden { display: none !important; }
.result audio { display: block; width: 100%; margin: 0 0 18px; }
.result-actions { display: flex; gap: 10px; flex-wrap: wrap; }
code { background: rgba(255,255,255,.08); padding: 2px 6px; border-radius: 5px; }
@media (max-width: 700px) {
    .container { width: min(100% - 20px, 980px); padding: 18px 0; }
    .card { padding: 20px; border-radius: 18px; }
    .heading { flex-direction: column; gap: 12px; }
    .grid { grid-template-columns: 1fr; }
    .api-status { white-space: normal; }
    textarea { min-height: 200px; }
    .result-actions > * { width: 100%; }
}
