:root {
    --bg: #0b0f19;
    --panel: #131a2b;
    --panel-2: #1a2340;
    --border: #263056;
    --text: #e6ebf5;
    --muted: #8a95b2;
    --primary: #5b8cff;
    --primary-hover: #7aa3ff;
    --accent: #22d3ee;
    --success: #10b981;
    --error: #ef4444;
    --provisional: #94a3b8;
    --final: #e6ebf5;
}
* { box-sizing: border-box; }
html, body {
    margin: 0;
    padding: 0;
    background: var(--bg);
    color: var(--text);
    font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
    min-height: 100vh;
}
a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }
.container {
    max-width: 960px;
    margin: 0 auto;
    padding: 24px 20px 80px;
}
.container--narrow { max-width: 440px; }

.topbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 14px 24px;
    border-bottom: 1px solid var(--border);
    background: var(--panel);
}
.topbar .brand { font-weight: 700; letter-spacing: 0.5px; }
.topbar .brand span { color: var(--accent); }
.topbar .nav { display: flex; gap: 16px; align-items: center; font-size: 14px; color: var(--muted); }
.topbar .nav a { color: var(--text); }

h1 { font-size: 28px; margin: 24px 0 8px; }
h2 { font-size: 20px; margin: 28px 0 12px; }
.sub { color: var(--muted); margin-bottom: 24px; }

.card {
    background: var(--panel);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 24px;
    margin-bottom: 20px;
}
.card--tight { padding: 20px; }

label { display: block; font-size: 13px; color: var(--muted); margin-bottom: 6px; }
input[type=text], input[type=email], input[type=password], select {
    width: 100%;
    padding: 10px 12px;
    background: var(--panel-2);
    border: 1px solid var(--border);
    color: var(--text);
    border-radius: 8px;
    font-size: 15px;
    outline: none;
}
input:focus, select:focus { border-color: var(--primary); }
.form-row { margin-bottom: 14px; }

button, .btn {
    display: inline-block;
    padding: 10px 18px;
    border-radius: 8px;
    border: 1px solid transparent;
    background: var(--primary);
    color: white;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.15s;
}
button:hover, .btn:hover { background: var(--primary-hover); text-decoration: none; }
button:disabled { opacity: 0.55; cursor: not-allowed; }
.btn--ghost {
    background: transparent;
    border-color: var(--border);
    color: var(--text);
}
.btn--ghost:hover { background: var(--panel-2); }
.btn--danger { background: var(--error); }
.btn--danger:hover { background: #f87171; }

.alert {
    padding: 10px 14px;
    border-radius: 8px;
    margin-bottom: 16px;
    font-size: 14px;
}
.alert--error { background: rgba(239, 68, 68, 0.15); color: #fca5a5; border: 1px solid rgba(239, 68, 68, 0.35); }
.alert--ok    { background: rgba(16, 185, 129, 0.15); color: #6ee7b7; border: 1px solid rgba(16, 185, 129, 0.35); }

.grid-2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}
@media (max-width: 640px) {
    .grid-2 { grid-template-columns: 1fr; }
}

.transcript {
    min-height: 200px;
    padding: 16px;
    background: var(--panel-2);
    border-radius: 8px;
    border: 1px solid var(--border);
    font-size: 17px;
    line-height: 1.55;
    white-space: pre-wrap;
    word-wrap: break-word;
}
.transcript .final { color: var(--final); }
.transcript .prov  { color: var(--provisional); font-style: italic; }
.transcript .lang-tag {
    display: inline-block;
    font-size: 10px;
    padding: 1px 6px;
    background: var(--panel);
    color: var(--accent);
    border-radius: 3px;
    margin: 0 4px 0 0;
    vertical-align: middle;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}
.transcript .tr {
    display: block;
    color: var(--accent);
    font-size: 15px;
    margin-top: 2px;
    padding-left: 8px;
    border-left: 2px solid var(--accent);
}

.status-row {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 16px 0;
    font-size: 14px;
    color: var(--muted);
}
.dot {
    display: inline-block;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: #555;
}
.dot.live { background: var(--error); box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.6); animation: pulse 1.5s infinite; }
.dot.ready { background: var(--success); }
@keyframes pulse {
    0%   { box-shadow: 0 0 0 0   rgba(239, 68, 68, 0.6); }
    70%  { box-shadow: 0 0 0 12px rgba(239, 68, 68, 0); }
    100% { box-shadow: 0 0 0 0   rgba(239, 68, 68, 0); }
}

.controls { display: flex; gap: 10px; flex-wrap: wrap; }
.small { font-size: 12px; color: var(--muted); }
.footer { text-align: center; color: var(--muted); font-size: 12px; margin-top: 40px; }

kbd {
    display: inline-block;
    padding: 1px 6px;
    background: var(--panel-2);
    border: 1px solid var(--border);
    border-radius: 4px;
    font-family: ui-monospace, monospace;
    font-size: 12px;
}

/* ---------------- Push-to-Talk ---------------- */
.ptt-header {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 24px;
    margin: 32px 0 24px;
    flex-wrap: wrap;
}
.ptt-lang-card {
    background: var(--panel);
    border: 2px solid var(--border);
    padding: 14px 24px;
    border-radius: 12px;
    min-width: 180px;
    text-align: center;
    transition: border-color 0.3s, background 0.3s, transform 0.2s;
}
.ptt-lang-card.is-source {
    border-color: var(--error);
    background: linear-gradient(180deg, rgba(239,68,68,0.12), rgba(239,68,68,0.02));
    transform: scale(1.04);
}
.ptt-lang-card.is-target {
    border-color: var(--accent);
    background: linear-gradient(180deg, rgba(34,211,238,0.12), rgba(34,211,238,0.02));
}
.ptt-badge-label {
    display: block;
    font-size: 11px;
    text-transform: uppercase;
    color: var(--muted);
    letter-spacing: 0.5px;
    margin-bottom: 6px;
}
.ptt-lang-card strong { font-size: 20px; }
.ptt-code {
    display: inline-block;
    margin-left: 6px;
    font-family: ui-monospace, monospace;
    font-size: 12px;
    color: var(--muted);
}
.ptt-arrow {
    font-size: 36px;
    color: var(--muted);
    font-weight: bold;
    transition: color 0.3s, transform 0.3s;
    user-select: none;
}
.ptt-arrow.is-a-to-b { color: var(--accent); transform: rotate(0deg); }
.ptt-arrow.is-b-to-a { color: var(--accent); transform: rotate(180deg); }

.ptt-context-row { text-align: center; min-height: 20px; margin: 6px 0 0; }
.ptt-target-picker {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: center;
    justify-content: center;
    margin: 12px 0 8px;
    padding: 12px 16px;
    background: var(--panel);
    border: 1px solid var(--border);
    border-radius: 10px;
}
.ptt-picker-label {
    font-size: 12px;
    color: var(--muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-right: 6px;
}
.ptt-chip {
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    padding: 8px 14px;
    border-radius: 8px;
    background: var(--panel-2);
    border: 2px solid var(--border);
    color: var(--text);
    cursor: pointer;
    font-family: inherit;
    font-size: 14px;
    line-height: 1.2;
    transition: border-color 0.15s, background 0.15s, transform 0.1s;
}
.ptt-chip:hover { border-color: var(--primary); }
.ptt-chip.is-active {
    border-color: var(--accent);
    background: linear-gradient(180deg, rgba(34,211,238,0.22), rgba(34,211,238,0.04));
    transform: scale(1.06);
    box-shadow: 0 0 0 3px rgba(34,211,238,0.2);
}
.ptt-chip:not(.is-active) { opacity: 0.55; }
.ptt-chip:not(.is-active):hover { opacity: 1; }
.ptt-chip.is-suggested {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(91,140,255,0.25);
    opacity: 1;
    animation: chipPulse 1.5s ease-in-out infinite;
}
@keyframes chipPulse {
    0%, 100% { box-shadow: 0 0 0 3px rgba(91,140,255,0.2); }
    50%      { box-shadow: 0 0 0 6px rgba(91,140,255,0.05); }
}
.ptt-chip-badge { font-size: 10px; color: var(--muted); text-transform: uppercase; letter-spacing: 0.3px; }
.ptt-chip-name  { font-weight: 600; }
.ptt-chip-code  { font-family: ui-monospace, monospace; font-size: 11px; color: var(--muted); }

.ptt-context {
    margin-left: 12px;
    font-size: 12px;
    color: var(--muted);
    padding: 6px 10px;
    background: var(--panel-2);
    border-radius: 6px;
    min-height: 20px;
    display: none;
}
.ptt-context.is-visible { display: inline-block; }

.ptt-stage {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin: 32px 0;
    user-select: none;
}
.ptt-button {
    -webkit-tap-highlight-color: transparent;
    width: 240px;
    height: 240px;
    border-radius: 50%;
    background: radial-gradient(circle at 30% 30%, #6ea3ff, #3b62c9);
    border: 6px solid #4a75d1;
    color: white;
    cursor: pointer;
    box-shadow: 0 10px 40px rgba(91, 140, 255, 0.25), inset 0 -6px 20px rgba(0,0,0,0.2);
    transition: transform 0.08s ease, box-shadow 0.15s ease, background 0.2s;
    padding: 0;
    touch-action: manipulation;
}
.ptt-button:hover { box-shadow: 0 12px 50px rgba(91, 140, 255, 0.4), inset 0 -6px 20px rgba(0,0,0,0.2); }
.ptt-button.is-holding {
    transform: scale(0.94);
    background: radial-gradient(circle at 30% 30%, #ff8383, #c93b3b);
    border-color: #d15252;
    box-shadow: 0 4px 20px rgba(239, 68, 68, 0.5), inset 0 -4px 15px rgba(0,0,0,0.3), 0 0 0 0 rgba(239, 68, 68, 0.6);
    animation: pttPulse 1.2s infinite;
}
.ptt-button.is-busy {
    background: radial-gradient(circle at 30% 30%, #f6bd60, #d97706);
    border-color: #d97706;
    cursor: wait;
}
@keyframes pttPulse {
    0%   { box-shadow: 0 4px 20px rgba(239, 68, 68, 0.5), inset 0 -4px 15px rgba(0,0,0,0.3), 0 0 0 0   rgba(239, 68, 68, 0.6); }
    70%  { box-shadow: 0 4px 20px rgba(239, 68, 68, 0.5), inset 0 -4px 15px rgba(0,0,0,0.3), 0 0 0 24px rgba(239, 68, 68, 0);  }
    100% { box-shadow: 0 4px 20px rgba(239, 68, 68, 0.5), inset 0 -4px 15px rgba(0,0,0,0.3), 0 0 0 0   rgba(239, 68, 68, 0);   }
}
.ptt-inner { display: flex; flex-direction: column; align-items: center; justify-content: center; height: 100%; }
.ptt-icon  { font-size: 56px; margin-bottom: 8px; line-height: 1; }
.ptt-label { font-size: 15px; font-weight: 700; letter-spacing: 0.5px; }
.ptt-hint  { font-size: 11px; opacity: 0.85; margin-top: 6px; padding: 0 20px; }

.ptt-status {
    margin-top: 20px;
    color: var(--muted);
    font-size: 14px;
    text-align: center;
    min-height: 20px;
}
.ptt-status--live  { color: var(--error); font-weight: 600; }
.ptt-status--ready { color: var(--success); }
.ptt-status--err   { color: var(--error); }

.ptt-panes { margin-top: 24px; }
.ptt-pane-title {
    font-size: 14px;
    font-weight: 600;
    color: var(--muted);
    margin: 0 0 8px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}
.ptt-lang-tag {
    display: inline-block;
    margin-left: 6px;
    font-size: 10px;
    padding: 2px 6px;
    background: var(--panel-2);
    color: var(--accent);
    border-radius: 3px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

