/* Voice Balloon: page layout. The balloon itself is drawn on canvas by app.js. */
.vb { max-width: 1180px; margin: 0 auto; padding: 18px 16px 8px; box-sizing: border-box; }
.vb *, .vb *::before, .vb *::after { box-sizing: border-box; }
.vb [hidden] { display: none !important; }
.vb-intro { margin: 0 0 18px; }
.vb-intro .caption { transform: rotate(-1deg); }
.vb-grid { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(320px, .85fr); gap: 26px; align-items: start; }

.vb-stage { --ht-size: 12px; --ht-dot: 1.4px; position: relative; padding: 0; overflow: hidden; aspect-ratio: 1000 / 760; }
.vb-stage canvas { display: block; width: 100%; height: 100%; cursor: pointer; }
.vb-live { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); margin: 0; }

.vb-controls { padding: 16px 18px 18px; display: grid; gap: 14px; }
.lbl { display: block; font: 600 13px/1 var(--font-label); letter-spacing: .1em; text-transform: uppercase; color: var(--ink-2); margin: 0 0 8px; padding: 0; }
.hint { margin: 4px 0 0; font: 12px/1.4 var(--font-type); color: var(--muted); }

/* ---------- the big hold-to-talk button */
.talk-row { display: flex; gap: 16px; align-items: center; }
.talk {
  --sz: 132px; position: relative; flex: none; width: var(--sz); height: var(--sz); border-radius: 50%; padding: 0; cursor: pointer;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; color: #141210; background: var(--yellow); border: 3.5px solid var(--panel-ink);
  box-shadow: 5px 6px 0 var(--panel-ink); touch-action: none; user-select: none; -webkit-user-select: none; -webkit-touch-callout: none;
  transition: transform .08s steps(2), box-shadow .08s steps(2);
}
.talk:hover { transform: translate(-1px, -1px); box-shadow: 6px 7px 0 var(--panel-ink); }
.talk:focus-visible { outline: 3px solid var(--blue); outline-offset: 4px; }
.talk[data-state="rec"] { background: var(--red); color: #fff; transform: translate(3px, 4px) scale(.97); box-shadow: 2px 2px 0 var(--panel-ink); }
.talk[data-state="busy"] { background: var(--paper-2); color: var(--ink); cursor: progress; }
.talk-ring { position: absolute; inset: -12px; width: calc(100% + 24px); height: calc(100% + 24px); transform: rotate(-90deg); pointer-events: none; overflow: visible; }
.talk-ring circle { fill: none; stroke-width: 6; }
.ring-bg { stroke: transparent; }
.ring-lvl { stroke: var(--cyan); stroke-width: 10; stroke-dasharray: 339.3; stroke-dashoffset: 339.3; opacity: .85; }
.ring-time { stroke: var(--panel-ink); stroke-dasharray: 339.3; stroke-dashoffset: 339.3; stroke-linecap: round; }
.talk-mic { width: 44px; height: 44px; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; margin-top: 8px; }
.talk-mic rect { fill: currentColor; fill-opacity: .18; }
.talk-lbl { font: 21px/1 "Bangers", Impact, sans-serif; letter-spacing: .05em; text-align: center; white-space: nowrap; }
:root[data-skin="clean"] .talk-lbl { font: 600 14px/1 var(--font-label); letter-spacing: .02em; }
.talk-count { position: absolute; top: 18px; left: 0; right: 0; text-align: center; font: 600 13px/1 var(--font-label); letter-spacing: .08em; }

.talk-side { flex: 1; min-width: 0; display: grid; gap: 6px; }
.meter { position: relative; height: 16px; border: 2.5px solid var(--panel-ink); border-radius: 3px; background: var(--paper-2); overflow: hidden; }
.meter span { position: absolute; inset: 0 auto 0 0; width: 0%; background: linear-gradient(90deg, var(--cyan) 0 30%, var(--yellow) 30% 70%, var(--red) 70%); background-size: var(--mw, 100%) 100%; }
.meter i { position: absolute; top: 0; bottom: 0; display: flex; align-items: center; font: 600 9px/1 var(--font-label); letter-spacing: .1em; text-transform: uppercase; font-style: normal; color: var(--ink-2); pointer-events: none; }
.meter .m-w { left: 6px; } .meter .m-t { left: 52%; } .meter .m-s { right: 5px; }
.meter::before, .meter::after { content: ""; position: absolute; top: 0; bottom: 0; width: 2px; background: var(--panel-ink); opacity: .35; z-index: 1; }
.meter::before { left: 38.6%; } .meter::after { left: 78.9%; }
.status { margin: 0; font: 500 15px/1.35 var(--font-label); letter-spacing: .02em; color: var(--ink); min-height: 2.7em; }
.status.err { color: var(--accent); }
.talk-opts { display: flex; flex-wrap: wrap; gap: 6px; }
.tog-btn { padding: 7px 10px; font-size: 13px; }
.tog-btn[aria-pressed="true"], .tog-btn[aria-expanded="true"] { background: var(--yellow); color: #141210; box-shadow: 3px 3px 0 var(--panel-ink); }

.privacy { display: flex; gap: 8px; align-items: flex-start; margin: 0; padding: 8px 10px; border: 2px dashed var(--line); border-radius: 4px; font: 13px/1.4 var(--font-type); color: var(--ink-2); }
.privacy svg { flex: none; width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; margin-top: 1px; }

.permit { padding: 12px; border: 3px solid var(--panel-ink); border-radius: 4px; background: var(--paper-2); box-shadow: 4px 4px 0 var(--accent); }
.permit p { margin: 0 0 10px; font: 14px/1.45 var(--font-type); color: var(--ink); }
.permit-row { display: flex; flex-wrap: wrap; gap: 8px; }

.typer-row { display: flex; gap: 8px; }
#typed {
  flex: 1; min-width: 0; font: 20px/1.2 var(--font-type); padding: 8px 10px; color: var(--ink); background: var(--paper-2);
  border: 3px solid var(--panel-ink); border-radius: 4px;
}
#typed:focus-visible { outline: 3px solid var(--blue); outline-offset: 2px; }

.styles { margin: 0; padding: 0; border: 0; min-width: 0; }
.auto-note { margin-left: 6px; color: var(--live); letter-spacing: .06em; }
.chips { display: flex; flex-wrap: wrap; gap: 7px; }
.chips label { position: relative; cursor: pointer; }
.chips input { position: absolute; opacity: 0; width: 1px; height: 1px; pointer-events: none; }
.chips span {
  display: inline-flex; align-items: center; gap: 6px; font: 600 13px/1 var(--font-label); letter-spacing: .07em; text-transform: uppercase;
  padding: 8px 9px; border: 2.5px solid var(--panel-ink); border-radius: 4px; background: var(--paper-2); color: var(--ink);
  transition: transform .08s steps(2);
}
.chips input:checked + span { background: var(--ink); color: var(--paper); box-shadow: 3px 3px 0 var(--accent); transform: translate(-1px, -1px); }
.chips input:focus-visible + span { outline: 3px solid var(--blue); outline-offset: 2px; }
.chips label.auto span::after { content: "auto"; margin-left: 1px; font: 600 9px/1 var(--font-label); letter-spacing: .1em; padding: 2px 4px; border-radius: 2px; background: var(--live); color: #fff; }
.ic { width: 18px; height: 13px; display: inline-block; border: 2px solid currentColor; border-radius: 50%; }
.ic-whisper { border-style: dashed; transform: scale(.85); }
.ic-shout { border-radius: 2px; transform: rotate(45deg) scale(.7); width: 14px; height: 14px; }
.ic-question { border-radius: 46% 54% 42% 58% / 58% 40% 60% 42%; }

.readout { margin: 0; }
.readout .lbl { margin-bottom: 6px; }
#strip { display: block; width: 100%; height: 64px; border: 2px solid var(--line); border-radius: 4px; background: var(--paper-2); margin-bottom: 8px; }
.stats { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 6px; }
.stats li { font: 500 12px/1 var(--font-label); letter-spacing: .06em; text-transform: uppercase; padding: 5px 7px; border: 1.5px solid var(--line); border-radius: 3px; color: var(--ink-2); background: var(--paper-2); }
.stats li b { color: var(--ink); font-weight: 600; }

.dl-row { display: flex; flex-wrap: wrap; gap: 8px 10px; align-items: center; }
.dl-row .btn[disabled] { opacity: .55; cursor: progress; }
.tog { display: inline-flex; align-items: center; gap: 6px; font: 500 13px/1 var(--font-label); letter-spacing: .05em; text-transform: uppercase; cursor: pointer; color: var(--ink); }
.tog input { width: 18px; height: 18px; accent-color: var(--accent); }
.prog { flex: 1 1 100%; }
.prog-bar { height: 12px; border: 2.5px solid var(--panel-ink); border-radius: 3px; background: var(--paper-2); overflow: hidden; }
.prog-bar span { display: block; height: 100%; width: 0%; background: var(--accent); }
.dl-status { flex: 1 1 100%; min-height: 1.4em; margin: 0; }

:root[data-theme="hud"] .talk { box-shadow: var(--glow); }
:root[data-skin="clean"] .talk { box-shadow: 0 6px 18px -8px rgba(0, 0, 0, .35); border-width: 2px; }
:root[data-skin="clean"] .permit { box-shadow: none; border-width: 1px; }
:root[data-skin="clean"] .privacy { border-style: solid; border-width: 1px; }

@media (max-width: 900px) {
  .vb-grid { grid-template-columns: minmax(0, 1fr); gap: 18px; }
}
@media (max-width: 440px) {
  .vb { padding: 12px 12px 4px; }
  .vb-controls { padding: 14px 12px; }
  .talk { --sz: 112px; }
  .talk-lbl { font-size: 18px; }
  .talk-mic { width: 36px; height: 36px; }
  .talk-row { gap: 14px; }
  .status { font-size: 14px; }
  .chips { gap: 6px; }
  .chips span { padding: 7px 8px; font-size: 13px; gap: 5px; }
}

/* embed mode (homepage iframe ~560x440 / 360x420): the balloon big, the talk button under it */
html.embed, html.embed body { height: 100%; overflow: hidden; }
html.embed .vb { height: 100vh; padding: 8px; display: flex; flex-direction: column; max-width: none; }
html.embed .vb-intro, html.embed .privacy, html.embed .styles, html.embed .readout, html.embed .dl-row,
html.embed .hint, html.embed #talk-hint, html.embed .meter { display: none; }
html.embed .vb-grid { display: flex; flex-direction: column; gap: 8px; flex: 1; min-height: 0; }
html.embed .vb-stage { flex: 1; min-height: 0; aspect-ratio: auto; width: 100%; display: grid; place-items: center; }
html.embed .vb-stage canvas { flex: none; }
html.embed .vb-controls { padding: 8px 10px; gap: 8px; width: 100%; }
html.embed .talk-row { gap: 12px; }
html.embed .talk { --sz: 70px; border-width: 3px; box-shadow: 3px 4px 0 var(--panel-ink); }
html.embed .talk-ring { inset: -7px; width: calc(100% + 14px); height: calc(100% + 14px); }
html.embed .talk { gap: 1px; }
html.embed .talk-mic { width: 26px; height: 26px; margin-top: 4px; }
html.embed .talk-lbl { font-size: 11px; letter-spacing: .02em; }
html.embed:root[data-skin="clean"] .talk-lbl { font-size: 9px; }
html.embed .talk-count { top: 6px; font-size: 10px; }
html.embed .status { font-size: 13px; min-height: 0; line-height: 1.3; }
html.embed .talk-side { gap: 5px; }
html.embed .tog-btn { padding: 5px 8px; font-size: 11px; }
html.embed #mode { display: none; }
html.embed .permit { padding: 8px; }
html.embed .permit p { font-size: 12px; margin-bottom: 6px; }
html.embed .typer .lbl { display: none; }
html.embed #typed { font-size: 15px; padding: 5px 8px; }
html.embed[data-theme="hud"] .talk { box-shadow: var(--glow); }
