/* Additions for the local app: server status, audio, interview avatar, records. */
html, body { margin: 0; }

/* ===== Real-test look for the whole app (header, tabs, buttons, answers) ===== */
body { font-weight: 300; font-size: 16px; }
b, strong { font-weight: 600; }
h1, h2, h3 { font-weight: 600; color: var(--navy2); }
.eyebrow { color: var(--red); font-weight: 400; }
.wrap { max-width: 1100px; gap: 18px; padding-block: 0 56px; }
header.top { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; flex-wrap: wrap;
  padding: 18px 0 10px; border-bottom: 2px solid var(--red); }
.brand { display: flex; flex-direction: column; gap: 2px; }
.brand .mark { font-family: Georgia, "Times New Roman", serif; font-size: 1.7rem; font-weight: 700; color: var(--red); letter-spacing: .02em; line-height: 1.1; }
.brand .sub { font-size: .72rem; color: #605d5e; }
header.top .right { display: flex; flex-direction: column; align-items: flex-end; gap: 4px; text-align: right; }
header.top .title { color: var(--red); font-size: .95rem; }
nav.rail { gap: 0; border-bottom: 1px solid var(--line); padding-bottom: 0; flex-wrap: wrap; overflow-x: visible; }
nav.rail a { border: 0; border-radius: 0; background: none; padding: 10px 14px; font-family: var(--font-body); font-weight: 400; color: #555;
  border-bottom: 3px solid transparent; margin-bottom: -1px; }
nav.rail a:hover { color: var(--red); }
nav.rail a[aria-current="page"] { background: none; color: var(--red); border-bottom-color: var(--red); }
nav.rail .chip { color: var(--muted); font-size: .72rem; }
nav.rail a[aria-current="page"] .chip { color: var(--red); }
.panel { border-color: var(--line); border-radius: 8px; box-shadow: none; }
.btn { font-family: var(--font-body); font-weight: 400; border-radius: 10px; border: 1px solid var(--red2); background: #fff; color: var(--red2); padding: 10px 22px; }
.btn:hover:not(:disabled) { background: var(--red2); color: #fff; }
.btn.ghost { border-color: var(--accent); color: var(--accent); background: #fff; }
.btn.ghost:hover:not(:disabled) { background: var(--accent); color: #fff; }
.btn.quiet { border-color: #dcdfe6; color: #606266; background: #fff; border-radius: 4px; }
.btn.quiet:hover:not(:disabled) { background: #f4f4f5; color: #333; }
.btn:focus-visible, .opt:focus-visible, .navq:focus-visible, nav.rail a:focus-visible, textarea:focus-visible, .tab:focus-visible { outline: 3px solid #409eff; }
.timer { background: none; color: var(--red); font-family: var(--font-body); font-weight: 400; padding: 0; }
.timer.low { background: none; color: var(--wattle); }
.timer.over { background: none; color: var(--red2); }
.note { border-left-color: var(--red); background: #fbf5f5; }
table.plan th { font-family: var(--font-body); }
.topic.weak { background: #fdecec; }
/* answers: a list of square boxes "A. …", like the real test */
.opts { gap: 6px; }
.opt { border: 0; background: none; padding: 8px 6px; border-radius: 4px; font-weight: 300; font-size: 1.05rem; }
.opt:hover { background: #f6f6f8; }
.opt .letter { display: none; }
.opt .box { flex: 0 0 auto; width: 16px; height: 16px; border: 1px solid #dcdfe6; border-radius: 2px; background: #fff; position: relative; }
.opt[aria-pressed="true"] { background: none; color: #409eff; }
.opt[aria-pressed="true"] .box { background: #409eff; border-color: #409eff; }
.opt[aria-pressed="true"] .box::after { content: ""; position: absolute; left: 4px; top: 1px; width: 4px; height: 8px; border: solid #fff; border-width: 0 2px 2px 0; transform: rotate(45deg); }
.qcount { color: var(--navy2); line-height: 1; display: flex; align-items: flex-end; }
.qcount b { font-size: 50px; font-weight: 300; }
.qcount span { font-size: 20px; margin-bottom: 4px; }
.qhead { display: flex; gap: 14px; align-items: flex-start; flex-wrap: wrap; }
.qhead .qtext { flex: 1 1 300px; min-width: 0; font-weight: 600; padding-top: 14px; }
.navq.answered { background: #eef1f7; color: var(--accent); border-color: #eef1f7; }
.navq.current { border-color: var(--red); }
.exambar { border-bottom: 0; padding-bottom: 0; }

/* sign-in and accounts */
.panel.narrow { max-width: 460px; margin: 24px auto 0; width: 100%; }
.form { display: flex; flex-direction: column; gap: 8px; }
.form label { font-size: .9rem; color: #555; }
.form input:not([type="checkbox"]), .form select { font: inherit; font-weight: 400; border: 1px solid #c0c4cc; border-radius: 4px; padding: 9px 10px; background: #fff; color: #222; }
.form .btn { align-self: flex-start; margin-top: 6px; }
.form.inline { flex-direction: row; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 8px; }
.form.inline .btn { margin-top: 0; }
.grid-form { display: grid; grid-template-columns: max-content minmax(0, 320px); gap: 10px 14px; align-items: center; }
.grid-form .btn { grid-column: 2; }
@media (max-width: 560px) { .grid-form { grid-template-columns: 1fr; } .grid-form .btn { grid-column: 1; } }
label.check { display: inline-flex; gap: 6px; align-items: center; color: #222; }
.who { color: #605d5e; }
.who a, .linkbtn { color: var(--accent); }
.linkbtn { font: inherit; background: none; border: 0; padding: 0; cursor: pointer; text-decoration: underline; }
body.signed-out nav.rail { display: none; }
.guestbox { border-top: 1px solid var(--line); margin-top: 8px; padding-top: 14px; display: flex; flex-direction: column; gap: 8px; align-items: flex-start; }
.guestnote { background: #fbf5f5; border-color: #f0d5d8; }
#rec-who { font: inherit; border: 1px solid #c0c4cc; border-radius: 4px; padding: 6px 8px; background: #fff; }
img { max-width: 100%; }
[hidden] { display: none !important; }
header.top { align-items: center; }
.status-pill { font-size: 0.8rem; font-family: var(--font-display); padding: 5px 12px; border-radius: 999px; border: 1px solid var(--line); background: var(--surface); color: var(--muted); }
.status-pill.ok { color: var(--good); border-color: var(--good-soft); background: var(--good-soft); }
.status-pill.bad { color: var(--bad); border-color: var(--bad-soft); background: var(--bad-soft); }
.saved { font-size: 0.9rem; padding: 8px 12px; border-radius: 8px; }
.saved.ok { background: var(--good-soft); color: var(--good); }
.saved.bad { background: var(--bad-soft); color: var(--bad); }

/* listening player */
.listenbox { background: var(--bg); border: 1px solid var(--line); border-radius: 8px; padding: 16px 18px; display: flex; flex-direction: column; gap: 12px; min-width: 0; }
.listenbox .plays { font-size: 0.9rem; color: var(--muted); }
.wave { display: flex; gap: 4px; align-items: center; height: 28px; }
.wave span { width: 5px; height: 8px; border-radius: 3px; background: var(--accent); opacity: .5; }
.playing .wave span { animation: wave 0.9s ease-in-out infinite; opacity: 1; }
.playing .wave span:nth-child(2) { animation-delay: .1s } .playing .wave span:nth-child(3) { animation-delay: .2s }
.playing .wave span:nth-child(4) { animation-delay: .3s } .playing .wave span:nth-child(5) { animation-delay: .4s }
@keyframes wave { 0%,100% { height: 8px } 50% { height: 26px } }
.transcript { font-size: 0.95rem; background: var(--bg); border-radius: 8px; padding: 12px 14px; }

/* interview */
.stage { display: grid; grid-template-columns: minmax(0, 220px) minmax(0, 1fr); gap: 24px; align-items: center; }
@media (max-width: 640px) { .stage { grid-template-columns: 1fr; justify-items: center; text-align: center; } }
.avatar { width: 200px; max-width: 100%; }
.avatar svg { width: 100%; height: auto; display: block; }
.avatar .mouth { transform-origin: 100px 132px; transform: scaleY(0.35); transition: transform .15s; }
.speaking .avatar .mouth { animation: talk 0.32s ease-in-out infinite alternate; }
@keyframes talk { from { transform: scaleY(0.3) } to { transform: scaleY(1) } }
.speaking .avatar .ring { opacity: 1; }
.avatar .ring { opacity: 0; transition: opacity .2s; }
.iv-status { font-family: var(--font-display); font-size: 1.1rem; font-weight: 600; }
.recdot { display: inline-block; width: 12px; height: 12px; border-radius: 50%; background: var(--bad); margin-right: 8px; vertical-align: middle; }
@media (prefers-reduced-motion: no-preference) { .recdot { animation: blink 1s steps(2) infinite; } }
@keyframes blink { 50% { opacity: .2 } }
.qdots { display: flex; gap: 6px; flex-wrap: wrap; }
.qdots span { width: 26px; height: 26px; border-radius: 50%; border: 1px solid var(--line); display: grid; place-items: center; font-size: 0.75rem; font-variant-numeric: tabular-nums; color: var(--muted); }
.qdots span.done { background: var(--accent-soft); color: var(--accent); border-color: var(--accent-soft); }
.qdots span.now { border: 2px solid var(--accent); color: var(--ink); }
.meter { height: 10px; border-radius: 5px; background: var(--line); overflow: hidden; max-width: 320px; width: 100%; }
.meter i { display: block; height: 100%; width: 0; background: var(--accent); transition: width .08s; }

/* records */
.rec-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; }
.stat { border: 1px solid var(--line); border-radius: 8px; padding: 12px 14px; display: flex; flex-direction: column; gap: 2px; }
.stat b { font-family: var(--font-display); font-size: 1.5rem; font-variant-numeric: tabular-nums; }
.pct { display: inline-block; min-width: 3.2em; text-align: right; font-variant-numeric: tabular-nums; font-weight: 700; }
.pct.lo { color: var(--bad); } .pct.mid { color: var(--ink); } .pct.hi { color: var(--good); }
.bar { height: 8px; border-radius: 4px; background: var(--line); min-width: 60px; overflow: hidden; }
.bar i { display: block; height: 100%; background: var(--accent); }
details.rec { border: 1px solid var(--line); border-radius: 8px; padding: 10px 14px; }
details.rec > summary { cursor: pointer; font-family: var(--font-display); font-weight: 600; display: flex; flex-wrap: wrap; gap: 8px 16px; align-items: baseline; }
details.rec[open] > summary { margin-bottom: 12px; }
.story-text { white-space: pre-wrap; background: var(--bg); border-radius: 8px; padding: 12px 14px; font-size: 1rem; }
.ivans { display: flex; flex-direction: column; gap: 8px; padding: 10px 0; border-top: 1px solid var(--line); }
.ivans audio { width: 100%; max-width: 420px; }
select, input[type="number"], input[type="text"].note, textarea.note { font: inherit; border: 1px solid var(--line); border-radius: 6px; padding: 6px 8px; background: var(--surface); color: var(--ink); }
textarea.note { min-height: 70px; width: 100%; }
.danger { color: var(--bad) !important; border-color: var(--bad-soft) !important; }
.empty { color: var(--muted); padding: 8px 0; }
