:root {
  --bg: #142339; --panel: #1c2f4b; --line: #2b4468; --text: #f3f1ea; --muted: #9fb0c8;
  --accent: #f2b544; --rec: #e5484d;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; background: var(--bg); color: var(--text);
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; }
.app { max-width: 560px; margin: 0 auto; min-height: 100%; display: flex; flex-direction: column;
  gap: 12px; padding: max(16px, env(safe-area-inset-top)) 16px max(16px, env(safe-area-inset-bottom)); }
.top { font-size: 13px; letter-spacing: .12em; color: var(--muted); }
.top { display: flex; justify-content: space-between; align-items: center; }
.top b { color: var(--accent); font-weight: 700; }
.phr { color: var(--accent); text-decoration: none; letter-spacing: .04em; border: 1px solid var(--line); border-radius: 999px; padding: 6px 12px; }
.langs { display: flex; gap: 8px; }
.lang { flex: 1; font: inherit; font-size: 14px; padding: 10px 4px; white-space: nowrap; border-radius: 12px; cursor: pointer;
  border: 1px solid var(--line); background: transparent; color: var(--muted); }
.lang[aria-pressed="true"] { background: var(--panel); border-color: var(--accent); color: var(--text); }
.card[hidden], .phr-panel[hidden] { display: none; }
.phr { font: inherit; font-size: 13px; background: transparent; cursor: pointer; }
.phr[aria-expanded="true"] { background: var(--panel); border-color: var(--accent); }
.phr-panel { background: var(--panel); border: 1px solid var(--accent); border-radius: 16px; padding: 12px 14px; display: flex; flex-direction: column; gap: 8px; }
.phr-panel select { font: inherit; font-size: 14px; color: var(--text); background: var(--bg); border: 1px solid var(--line); border-radius: 10px; padding: 8px 10px; }
.phr-text { margin: 0; font-size: 22px; line-height: 1.35; font-weight: 600; }
.phr-nav { display: flex; align-items: center; justify-content: space-between; }
.phr-step { width: 48px; height: 40px; border-radius: 10px; border: 1px solid var(--line); background: transparent; color: var(--accent); font-size: 16px; cursor: pointer; }
.phr-pos { color: var(--muted); font-size: 14px; }
.phr-all { color: var(--muted); font-size: 13px; text-align: center; }
.phr-open .out { font-size: 22px; }
.label { margin: 0; font-size: 11px; letter-spacing: .12em; color: var(--muted); }
.ru-text { margin: 6px 0 0; font-size: 20px; line-height: 1.35; color: var(--text); opacity: .85; }
.card { background: var(--panel); border: 1px solid var(--line); border-radius: 16px; padding: 14px 16px 16px; }
.card-head { display: flex; align-items: center; justify-content: space-between; }
.out { margin: 8px 0 0; min-height: 1.3em; font-size: 26px; line-height: 1.3; font-weight: 600; }
.card.speaking { border-color: var(--accent); }
.play { width: 44px; height: 44px; border-radius: 50%; border: 1px solid var(--line); background: transparent;
  color: var(--accent); font-size: 18px; cursor: pointer; }
.play:disabled { opacity: .3; cursor: default; }
.bottom { position: sticky; bottom: 0; background: var(--bg); padding-bottom: 4px; margin-top: auto; display: flex; flex-direction: column; align-items: center; gap: 10px; padding-top: 8px; }
.status { margin: 0; min-height: 1.3em; color: var(--muted); font-size: 15px; text-align: center; }
.status.error { color: #ff9b9b; }
.mic { width: 100%; max-width: 360px; height: 72px; border: 0; border-radius: 36px; background: var(--accent);
  color: #1b1b1b; font-size: 20px; font-weight: 700; letter-spacing: .08em; display: flex; align-items: center;
  justify-content: center; gap: 12px; cursor: pointer; }
.mic:disabled { opacity: .5; cursor: default; }
.mic.live { background: var(--panel); color: var(--text); border: 1px solid var(--line); }
.mic.recording { background: var(--rec); color: #fff; animation: pulse 1.2s ease-in-out infinite; }
@keyframes pulse { 50% { box-shadow: 0 0 0 10px rgba(229, 72, 77, .25); } }
@media (prefers-reduced-motion: reduce) { .mic.recording { animation: none; } }

.meter { height: 6px; max-width: 320px; margin: 0 auto 8px; background: rgba(255,255,255,.08); border-radius: 3px; overflow: hidden; }
.meter i { display: block; height: 100%; width: 0; background: #3ecf8e; transition: width .06s; }

/* v7 */
.top-btns { display: flex; gap: 6px; }
.opts .lang { font-size: 13px; padding: 8px 4px; }
.trial { margin: 0; text-align: center; font-size: 13px; color: var(--accent); }
.trial button { font: inherit; color: var(--accent); background: none; border: 0; text-decoration: underline; cursor: pointer; padding: 0; }
.hist-list { margin: 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 8px; max-height: 46vh; overflow: auto; }
.hist-list li { border-bottom: 1px solid var(--line); padding-bottom: 8px; }
.hist-list .h-ru { color: var(--muted); font-size: 14px; }
.hist-list .h-row { display: flex; align-items: center; gap: 8px; margin-top: 4px; font-size: 16px; }
.hist-list .h-row button { flex: 0 0 auto; width: 34px; height: 34px; border-radius: 50%; border: 1px solid var(--line); background: transparent; color: var(--accent); cursor: pointer; }
.hist-empty { color: var(--muted); font-size: 14px; }
.linkbtn { background: none; border: 0; cursor: pointer; text-decoration: underline; font: inherit; font-size: 13px; }
.type-row { display: flex; gap: 8px; }
.type-row input { flex: 1; min-width: 0; font: inherit; font-size: 16px; color: var(--text); background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; }
.type-go { width: 48px; border-radius: 12px; border: 1px solid var(--line); background: var(--panel); color: var(--accent); font-size: 20px; cursor: pointer; }
.inapp { background: #3a2a05; color: #ffd27a; border: 1px solid #7a5a10; border-radius: 10px; padding: 8px 10px; font-size: 14px; text-align: center; }
.overlay { position: fixed; inset: 0; background: rgba(10,14,22,.92); display: flex; align-items: center; justify-content: center; z-index: 50; padding: 16px; }
.box { background: var(--panel); border: 1px solid var(--line); border-radius: 18px; padding: 22px; max-width: 400px; width: 100%; display: flex; flex-direction: column; gap: 12px; }
.box b.t { font-size: 20px; text-align: center; }
.box p { margin: 0; color: var(--text); line-height: 1.4; }
.box .muted { color: var(--muted); font-size: 14px; }
.box input { font-size: 22px; text-align: center; letter-spacing: 2px; padding: 12px; border-radius: 12px; border: 1px solid var(--line); background: var(--bg); color: var(--text); text-transform: uppercase; }
.box button { font: inherit; font-size: 18px; font-weight: 700; padding: 12px; border-radius: 12px; border: 0; background: var(--accent); color: #111; cursor: pointer; }
.box .err { color: #ff9b9b; min-height: 1.2em; font-size: 14px; text-align: center; }
