:root {
    --navy: #001f3f;
    --navy-soft: #00305f;
    --white: #ffffff;
    --bg: #eef1f6;
    --line: #d3dae4;
    --text-muted: #4b5a6e;
    --radius: 16px;
    --shadow: 0 10px 30px rgba(0, 31, 63, 0.12);
}

* { box-sizing: border-box; }

body {
    margin: 0;
    font-family: "Segoe UI", system-ui, -apple-system, Roboto, Arial, sans-serif;
    background: var(--bg);
    color: var(--navy);
    line-height: 1.5;
}

/* Header */
.topbar {
    background: var(--navy);
    color: var(--white);
    padding: 26px 20px 30px;
    text-align: center;
}

.brand {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    font-size: 28px;
    font-weight: 700;
    letter-spacing: 0.5px;
}

.tagline {
    margin: 8px 0 0;
    opacity: 0.8;
    font-size: 14px;
}

/* Layout */
.wrap {
    max-width: 760px;
    margin: -18px auto 40px;
    padding: 0 16px;
}

.card {
    background: var(--white);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 24px;
}

.field-label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.6px;
    margin-bottom: 6px;
    color: var(--navy);
}

.field-label .val {
    float: right;
    font-weight: 700;
    color: var(--navy-soft);
}

/* Textarea */
textarea {
    width: 100%;
    min-height: 170px;
    resize: vertical;
    padding: 14px;
    font-size: 16px;
    font-family: inherit;
    color: var(--navy);
    border: 1px solid var(--line);
    border-radius: 12px;
    outline: none;
    transition: border-color 0.15s, box-shadow 0.15s;
}

textarea:focus {
    border-color: var(--navy);
    box-shadow: 0 0 0 3px rgba(0, 31, 63, 0.12);
}

.text-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin: 8px 2px 18px;
    font-size: 13px;
    color: var(--text-muted);
}

.link-btn {
    background: none;
    border: none;
    color: var(--navy-soft);
    font: inherit;
    cursor: pointer;
    text-decoration: underline;
}

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

.control { min-width: 0; }

select {
    width: 100%;
    padding: 10px 12px;
    font-size: 15px;
    font-family: inherit;
    color: var(--navy);
    background: var(--white);
    border: 1px solid var(--line);
    border-radius: 10px;
    outline: none;
    cursor: pointer;
}

select:focus {
    border-color: var(--navy);
    box-shadow: 0 0 0 3px rgba(0, 31, 63, 0.12);
}

input[type="range"] {
    width: 100%;
    accent-color: var(--navy);
    margin-top: 10px;
    cursor: pointer;
}

/* Buttons */
.actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 22px;
    font-size: 15px;
    font-weight: 600;
    font-family: inherit;
    border-radius: 10px;
    border: 2px solid var(--navy);
    cursor: pointer;
    transition: background 0.15s, color 0.15s, transform 0.05s, opacity 0.15s;
}

.btn:active { transform: translateY(1px); }

.btn-primary {
    background: var(--navy);
    color: var(--white);
}

.btn-primary:hover { background: var(--navy-soft); border-color: var(--navy-soft); }

.btn-ghost {
    background: var(--white);
    color: var(--navy);
}

.btn-ghost:hover { background: rgba(0, 31, 63, 0.06); }

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

.divider {
    height: 1px;
    background: var(--line);
    margin: 24px 0;
}

.mp3-row {
    display: flex;
    align-items: flex-end;
    gap: 16px;
}

.mp3-row .control { flex: 1; }

.status {
    margin: 16px 0 0;
    font-size: 14px;
    min-height: 20px;
    color: var(--navy-soft);
}

.status.error { color: #b3261e; }

#player {
    width: 100%;
    margin-top: 14px;
}

.hint {
    margin: 18px 4px 0;
    font-size: 13px;
    color: var(--text-muted);
}

kbd {
    background: var(--white);
    border: 1px solid var(--line);
    border-bottom-width: 2px;
    border-radius: 6px;
    padding: 1px 6px;
    font-family: inherit;
    font-size: 12px;
}

@media (max-width: 620px) {
    .controls-grid { grid-template-columns: 1fr; }
    .mp3-row { flex-direction: column; align-items: stretch; }
}
