/* Test hlasu Emila – vzhľad podľa andromia.com: tmavé #02021a, fialová #6a48f6, Inter. Hlavne iPhone Safari. */
:root {
  --bg: #02021a;
  --panel: #0b0b2a;
  --line: #1d1d45;
  --text: #f2f2fa;
  --muted: #9a9ac0;
  --accent: #6a48f6;
  --accent-ink: #b9a8ff;
  --ok: #3ccf91;
  --bad: #ff6b6b;
  --r: 14px;
  color-scheme: dark;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 16px/1.45 Inter, system-ui, -apple-system, sans-serif;
  min-height: 100dvh;
  padding: max(16px, env(safe-area-inset-top)) max(16px, env(safe-area-inset-right)) max(24px, env(safe-area-inset-bottom)) max(16px, env(safe-area-inset-left));
}
main { max-width: 640px; margin: 0 auto; display: flex; flex-direction: column; gap: 16px; }
header { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
h1 { font-size: 20px; font-weight: 600; margin: 0; letter-spacing: -0.01em; }
h1 span { color: var(--muted); font-weight: 400; }
h2 { font-size: 15px; font-weight: 600; margin: 0 0 8px; }
a { color: var(--accent-ink); }
.muted { color: var(--muted); font-size: 14px; }
.hidden { display: none !important; }

.card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--r); padding: 16px; }

/* prepínače */
.seg { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; gap: 4px; background: var(--bg); border: 1px solid var(--line); border-radius: 12px; padding: 4px; }
.seg button { min-height: 44px; border: 0; border-radius: 9px; background: transparent; color: var(--muted); font: inherit; font-weight: 500; }
.seg button[aria-pressed="true"] { background: var(--accent); color: #fff; }
.seg button:disabled { opacity: 0.35; }
.row { display: flex; flex-direction: column; gap: 6px; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
label { font-size: 13px; color: var(--muted); }
input, select, textarea {
  width: 100%; min-height: 44px; padding: 10px 12px; font: inherit; font-size: 16px; /* 16px = Safari nezoomuje */
  color: var(--text); background: var(--bg); border: 1px solid var(--line); border-radius: 10px;
}
textarea { min-height: 88px; resize: vertical; }
input:focus, select:focus, textarea:focus, button:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }

/* hlavné tlačidlo */
.talk { display: flex; flex-direction: column; align-items: center; gap: 10px; }
#start {
  width: 168px; height: 168px; border-radius: 50%; border: 0; background: var(--accent); color: #fff;
  font: inherit; font-size: 18px; font-weight: 600; touch-action: manipulation; -webkit-tap-highlight-color: transparent;
  transition: transform 0.12s ease, background 0.2s ease;
}
#start:active { transform: scale(0.97); }
#start.live { background: #2a1d6b; box-shadow: inset 0 0 0 3px var(--accent); }
#start:disabled { opacity: 0.5; }
#status { min-height: 22px; text-align: center; }
.meters { display: grid; grid-template-columns: auto 1fr; gap: 6px 10px; align-items: center; width: 100%; font-size: 13px; color: var(--muted); }
.meter { height: 6px; background: var(--bg); border-radius: 3px; overflow: hidden; }
.meter i { display: block; height: 100%; width: 0; background: var(--accent); transition: width 60ms linear; }
.meter.user i { background: var(--ok); }

/* čísla */
.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; text-align: center; }
.stats div { background: var(--bg); border: 1px solid var(--line); border-radius: 10px; padding: 8px 4px; }
.stats b { display: block; font-size: 18px; font-variant-numeric: tabular-nums; }
.stats small { color: var(--muted); font-size: 12px; }

/* prepis */
#transcript { display: flex; flex-direction: column; gap: 8px; max-height: 46dvh; overflow-y: auto; -webkit-overflow-scrolling: touch; }
.msg { max-width: 88%; padding: 8px 12px; border-radius: 12px; font-size: 15px; white-space: pre-wrap; }
.msg.agent { align-self: flex-start; background: #17173d; }
.msg.user { align-self: flex-end; background: #2a1d6b; }
.msg.tentative { opacity: 0.6; }
.msg small { display: block; color: var(--muted); font-size: 11px; margin-bottom: 2px; }

/* hodnotenie */
.score { display: grid; grid-template-columns: 1fr repeat(5, 44px); gap: 4px; align-items: center; }
.score button { height: 44px; border-radius: 10px; border: 1px solid var(--line); background: var(--bg); color: var(--text); font: inherit; font-weight: 600; }
.score button[aria-pressed="true"] { background: var(--accent); border-color: var(--accent); }
.primary { min-height: 48px; width: 100%; border: 0; border-radius: 12px; background: var(--accent); color: #fff; font: inherit; font-weight: 600; }
.primary:disabled { opacity: 0.5; }
.ghost { min-height: 44px; padding: 0 14px; border: 1px solid var(--line); border-radius: 10px; background: transparent; color: var(--text); font: inherit; }
.err { color: var(--bad); font-size: 14px; }
.okmsg { color: var(--ok); font-size: 14px; }

/* výsledky */
table { width: 100%; border-collapse: collapse; font-size: 14px; font-variant-numeric: tabular-nums; }
th, td { text-align: left; padding: 8px 6px; white-space: nowrap; border-bottom: 1px solid var(--line); vertical-align: top; }
th { color: var(--muted); font-weight: 500; font-size: 12px; }
.scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.best { color: var(--ok); font-weight: 600; }
details summary { cursor: pointer; min-height: 44px; display: flex; align-items: center; }
