/* Inclui+ — sistema visual (cores do logótipo)
   Azul = confiança e saúde · ciano = comunicação · verde = inclusão e esperança · amarelo = otimismo
   Layout: ecrã único em altura total; o intérprete ocupa o espaço livre; comandos numa doca em baixo. */
:root {
  --ocean: #3b86d1; --ocean-2: #2b6cad; --deep: #1d3f6e; --sun: #3b86d1; --honey: #f5c842; --cyan: #5bbde8; --leaf: #46b07a;
  --brand: linear-gradient(90deg, #5bbde8 0%, #3cc85a 60%, #f2d10a 100%);
  --ink: #1b2b40; --mist: #f3f8fc; --card: #ffffff; --line: #dce7f1; --muted: #5b6b80; --soft: #e6f2fb; --rec: #e5484d;
  --display: "Fredoka", "Sora", "Segoe UI", system-ui, sans-serif; --body: "Manrope", "Segoe UI", system-ui, sans-serif;
  --r: 22px; color-scheme: light;
}
:root.hc { --mist: #000; --card: #0b0b0b; --line: #fff; --ink: #fff; --muted: #e6e6e6; --ocean: #5cc8ff; --soft: #06204a; color-scheme: dark; }
:root.big { font-size: 19px; }
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; overflow: hidden; }
body { background: var(--mist); color: var(--ink); font: 16px/1.5 var(--body); -webkit-tap-highlight-color: transparent; }
button, input { font: inherit; color: inherit; }
button { cursor: pointer; }
[hidden] { display: none !important; }
:focus-visible { outline: 3px solid var(--honey); outline-offset: 2px; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
svg { fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; }

/* ---------- botões ---------- */
.btn { border: 1px solid var(--line); background: var(--card); border-radius: 14px; padding: 11px 16px; font-weight: 700; white-space: nowrap; }
.btn.sun { background: linear-gradient(135deg, #3b86d1, #46b07a); border-color: transparent; color: #ffffff; text-shadow: 0 1px 2px rgba(0,0,0,.18); }
.btn.sea { background: var(--ocean); border-color: var(--ocean); color: #fff; }
.btn.ink { background: var(--ink); border-color: var(--ink); color: var(--card); }
.btn.ghost { background: rgba(255,255,255,.14); border-color: rgba(255,255,255,.3); color: #fff; }
.btn.xl { padding: 16px 34px; font-size: 1.08rem; border-radius: 999px; box-shadow: 0 12px 30px rgba(59,134,209,.35); }
.chip { border: 1px solid var(--line); background: var(--card); border-radius: 999px; padding: 7px 12px; font-weight: 700; font-size: .88rem; white-space: nowrap; }
.iconbtn { width: 40px; height: 40px; border-radius: 12px; border: 1px solid var(--line); background: var(--card); display: grid; place-items: center; flex: none; }
.iconbtn svg { width: 20px; height: 20px; }

/* ---------- abertura ---------- */
.intro { position: fixed; inset: 0; z-index: 20; display: flex; flex-direction: column; justify-content: space-between; color: #fff; text-align: center; overflow: hidden; background: #1d3f6e;
  padding: max(28px, env(safe-area-inset-top, 0px)) max(20px, env(safe-area-inset-right, 0px)) max(26px, env(safe-area-inset-bottom, 0px)) max(20px, env(safe-area-inset-left, 0px)); }
/* imagem de fundo (assets/brand/hero.jpg — pode ser trocada por uma fotografia vossa) com véu suave */
.intro-bg { position: absolute; inset: 0; z-index: -1;
  background: linear-gradient(180deg, rgba(22,58,96,.55) 0%, rgba(22,58,96,.08) 34%, rgba(22,58,96,0) 55%, rgba(18,46,78,.88) 100%),
    url("../assets/brand/hero.jpg") center bottom / cover no-repeat,
    linear-gradient(165deg, #1d3f6e 0%, #3b86d1 60%, #5bbde8 100%);
  animation: kenburns 24s ease-in-out infinite alternate; }
/* telemóvel (ecrã vertical): imagem própria, com as quatro pessoas visíveis */
@media (max-aspect-ratio: 4/5) {
  .intro-bg { background: linear-gradient(180deg, rgba(22,58,96,.55) 0%, rgba(22,58,96,.06) 34%, rgba(22,58,96,0) 52%, rgba(18,46,78,.9) 100%),
    url("../assets/brand/hero-m.jpg") center / cover no-repeat, linear-gradient(165deg, #1d3f6e 0%, #3b86d1 60%, #5bbde8 100%); }
}
@keyframes kenburns { to { transform: scale(1.06); } }
.intro-top { display: flex; flex-direction: column; align-items: center; gap: 4px; align-self: center; width: min(100%, 440px);
  padding: clamp(10px, 2vh, 18px) 18px clamp(10px, 2vh, 16px); border-radius: 28px; background: rgba(20,52,88,.34); border: 1px solid rgba(255,255,255,.28);
  -webkit-backdrop-filter: blur(16px) saturate(1.3); backdrop-filter: blur(16px) saturate(1.3); box-shadow: 0 20px 50px rgba(0,0,0,.22), inset 0 1px 0 rgba(255,255,255,.25); }
.intro-logo { width: clamp(110px, min(36vw, 18vh), 230px); height: auto; display: block; filter: drop-shadow(0 8px 22px rgba(0,0,0,.35)); }
.bar-name span { background: var(--brand); -webkit-background-clip: text; background-clip: text; color: transparent; }
.lead { margin: 6px 0 0; font-size: clamp(.86rem, min(3.4vw, 2vh), 1.1rem); line-height: 1.4; opacity: .95; max-width: 32ch; text-shadow: 0 2px 12px rgba(0,0,0,.35); }
.intro-bottom { display: flex; flex-direction: column; align-items: center; gap: 12px; }
.intro-actions { display: flex; gap: 10px; flex-wrap: wrap; justify-content: center; width: min(100%, 460px); }
.intro-actions .btn { flex: 1 1 180px; }
.by { margin: 0; font-size: .8rem; opacity: .8; }

/* como funciona */
.tour { position: fixed; inset: 0; z-index: 25; background: linear-gradient(165deg, #1d3f6e, #3b86d1 70%, #5bbde8); color: #fff; display: flex; flex-direction: column;
  padding: max(18px, env(safe-area-inset-top, 0px)) 0 max(22px, env(safe-area-inset-bottom, 0px)); }
.tour-skip { align-self: flex-end; margin-right: max(18px, env(safe-area-inset-right, 0px)); background: rgba(255,255,255,.14); color: #fff; border: 0; border-radius: 999px; padding: 8px 16px; font-weight: 700; }
.tour-track { flex: 1; min-height: 0; display: flex; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none; overscroll-behavior-x: contain; }
.tour-track::-webkit-scrollbar { display: none; }
.tour-slide { flex: 0 0 100%; scroll-snap-align: center; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; gap: 16px; padding: 0 max(28px, env(safe-area-inset-left, 0px)); }
.tour-art { font-size: clamp(3.4rem, 15vw, 5.5rem); width: min(72vw, 320px); aspect-ratio: 1; border-radius: 40px; background: rgba(255,255,255,.1); display: grid; place-content: center; grid-auto-flow: column; gap: 8px; line-height: 1; }
.tour-art span { font-size: .45em; color: var(--honey); align-self: center; }
.tour-slide h2 { font: 800 clamp(1.5rem, 5.4vw, 2.2rem)/1.15 var(--display); margin: 0; text-wrap: balance; }
.tour-slide p { margin: 0; max-width: 36ch; opacity: .9; font-size: 1.05rem; }
.tour-foot { display: flex; flex-direction: column; align-items: center; gap: 16px; padding: 0 20px; }
.tour-dots { display: flex; gap: 8px; }
.tour-dots i { width: 8px; height: 8px; border-radius: 9px; background: rgba(255,255,255,.35); transition: width .25s, background .25s; }
.tour-dots i.on { width: 28px; background: var(--honey); }
.tour-foot .btn { width: min(100%, 360px); }

/* ---------- aplicação ---------- */
.app { height: 100%; display: flex; flex-direction: column; padding-top: env(safe-area-inset-top, 0px); padding-bottom: env(safe-area-inset-bottom, 0px); }
.bar { flex: none; display: flex; align-items: center; gap: 8px; padding: 10px max(12px, env(safe-area-inset-right, 0px)) 8px max(12px, env(safe-area-inset-left, 0px)); }
.bar-logo { width: 40px; height: 40px; border-radius: 50%; box-shadow: 0 2px 10px rgba(13,27,51,.22); }
.bar-name { font: 700 1.4rem/1 var(--display); letter-spacing: -.02em; margin-right: auto; color: var(--deep); }
.stagewrap { flex: 1; min-height: 0; display: flex; flex-direction: column; padding: 0 max(12px, env(safe-area-inset-right, 0px)) 0 max(12px, env(safe-area-inset-left, 0px)); }
.stage { position: relative; flex: 1; min-height: 0; border-radius: var(--r); overflow: hidden; background: linear-gradient(#f4f7f8, #e3eaee); border: 1px solid var(--line); }
#avatarCanvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; touch-action: none; }
.has-pip { --camera-column: clamp(150px, 34%, 300px); }
.has-pip #avatarCanvas { width: calc(100% - var(--camera-column)); }
.loading { position: absolute; inset: 0; display: grid; place-content: center; justify-items: center; gap: 8px; color: var(--muted); text-align: center; padding: 20px; }
.loading b { color: var(--ink); font: 700 1rem var(--display); }
.spin { width: 34px; height: 34px; border-radius: 50%; border: 4px solid var(--soft); border-top-color: var(--ocean); animation: rot 1s linear infinite; }
@keyframes rot { to { transform: rotate(1turn); } }
.who { position: absolute; left: 12px; top: 12px; display: flex; align-items: center; gap: 9px; background: rgba(255,255,255,.92); backdrop-filter: blur(8px); border-radius: 999px; padding: 5px 14px 5px 5px; box-shadow: 0 4px 14px rgba(13,27,51,.08); color: #0d1b33; }
.who-ico { width: 30px; height: 30px; border-radius: 50%; background: var(--soft); display: grid; place-items: center; }
.who b { display: block; font-size: .9rem; line-height: 1.1; }
.who small { display: block; font-size: .74rem; color: #5c6c7a; line-height: 1.1; }
.pill-btn { position: absolute; right: 12px; top: 12px; border: 0; background: rgba(255,255,255,.92); border-radius: 999px; padding: 8px 13px; font-weight: 700; font-size: .82rem; box-shadow: 0 4px 14px rgba(13,27,51,.08); color: #0d1b33; }
.speech-output { flex: none; display: flex; flex-direction: column; align-items: center; gap: 6px; max-height: 20vh; overflow-y: auto; padding: 10px 4px 12px; }
.listening { max-width: 100%; background: var(--rec); color: #fff; border-radius: 999px; padding: 6px 14px; font-weight: 800; font-size: .85rem; display: flex; gap: 8px; align-items: center; }
.listening[hidden] { display: none; }
.listening i { width: 8px; height: 8px; border-radius: 50%; background: #fff; animation: blink 1s infinite; }
@keyframes blink { 50% { opacity: .2; } }
.letter { display: none; }
.sub { width: 100%; text-align: center; pointer-events: none; }
.sub div { display: inline-block; background: rgba(13,27,51,.92); color: #fff; border-radius: 16px; padding: 9px 16px; font: 700 clamp(1.05rem, 3.4vw, 1.45rem)/1.3 var(--display); max-width: 100%; }
.sub div:empty { display: none; }
.sub span { opacity: .5; transition: opacity .2s, color .2s; }
.sub span.now { opacity: 1; color: var(--honey); }
.sub span.done { opacity: .92; }
.pip { position: absolute; right: 12px; bottom: 12px; width: clamp(130px, 30%, 300px); aspect-ratio: 3 / 4; border-radius: 18px; overflow: hidden; background: #0d1b33; box-shadow: 0 10px 30px rgba(13,27,51,.3); border: 3px solid #fff; }
@media (min-aspect-ratio: 1/1) { .pip { aspect-ratio: 4 / 3; width: clamp(180px, 26%, 340px); } }
.has-pip .pip:not(.rec) { top: 50%; right: 10px; bottom: auto; width: calc(var(--camera-column) - 18px); aspect-ratio: 3 / 4; transform: translateY(-50%); border-radius: 14px; }
.has-pip .who { max-width: calc(100% - var(--camera-column) - 20px); }
.has-pip .pill-btn { right: calc(var(--camera-column) + 12px); }
.pip video, .pip canvas { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; transform: scaleX(-1); }
.pip-state { position: absolute; left: 6px; right: 6px; top: 6px; background: rgba(13,27,51,.75); color: #fff; border-radius: 10px; padding: 4px 8px; font-size: .74rem; font-weight: 700; text-align: center; }
.pip-hold { position: absolute; left: 0; right: 0; bottom: 0; height: 6px; background: rgba(255,255,255,.25); }
.pip-hold i { display: block; height: 100%; width: 0; background: var(--sun); transition: width .08s; }

.dock { flex: none; width: 100%; max-width: 820px; margin: 0 auto; padding: 10px max(12px, env(safe-area-inset-right, 0px)) 12px max(12px, env(safe-area-inset-left, 0px)); display: flex; flex-direction: column; gap: 10px; }
.modes { display: flex; gap: 4px; background: var(--card); border: 1px solid var(--line); border-radius: 16px; padding: 4px; }
.modes button { flex: 1; border: 0; background: transparent; border-radius: 12px; padding: 10px; font-weight: 800; color: var(--muted); }
.modes button[aria-selected="true"] { background: var(--ocean); color: #fff; }
.panel { display: flex; flex-direction: column; gap: 8px; }
.say { display: flex; gap: 8px; align-items: center; }
.say input { flex: 1; min-width: 0; border: 1px solid var(--line); background: var(--card); border-radius: 14px; padding: 13px 14px; font-size: 1rem; }
.mic { width: 54px; height: 54px; border-radius: 50%; border: 0; background: var(--leaf); color: #ffffff; flex: none; display: grid; place-items: center; box-shadow: 0 6px 16px rgba(70,176,122,.4); }
.mic svg { width: 24px; height: 24px; }
.mic.on { background: var(--rec); color: #fff; box-shadow: 0 0 0 7px rgba(229,72,77,.2); }
.chips { display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; }
.chips::-webkit-scrollbar { display: none; }
.chips button { flex: none; border: 0; background: var(--soft); color: var(--ocean-2); border-radius: 999px; padding: 7px 13px; font-weight: 700; font-size: .88rem; }
.heard { margin: 0; background: var(--card); border: 1px solid var(--line); border-radius: 16px; padding: 12px 14px; font: 700 clamp(1.1rem, 3.6vw, 1.4rem)/1.3 var(--display); min-height: 3.2em; }
.heard .ph { color: var(--muted); font: 500 .95rem var(--body); }
.heard .pend { color: var(--ocean); opacity: .6; }
.answer { margin: 0; background: var(--card); border: 1px solid var(--line); border-radius: 16px; padding: 12px 14px; font-size: 1.02rem; line-height: 1.45; max-height: 7.5em; overflow: auto; }
.answer .ph { color: var(--muted); font-size: .95rem; }
.answer small { display: block; color: var(--muted); font-size: .76rem; margin-top: 4px; }
.answer .thinking { color: var(--ocean); font-weight: 700; }
.modes button { font-size: .92rem; }
@media (max-width: 420px) { .modes button { padding: 9px 4px; font-size: .84rem; } }
.row { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.seg { display: flex; border: 1px solid var(--line); border-radius: 14px; overflow: hidden; background: var(--card); }
.seg button { border: 0; background: transparent; padding: 10px 13px; font-weight: 700; color: var(--muted); }
.seg button[aria-pressed="true"] { background: var(--ink); color: var(--card); }
@media (max-width: 420px) { .row .btn { padding: 9px 11px; } .seg button { padding: 9px 10px; } }

/* ---------- folhas ---------- */
dialog.sheet { position: fixed; inset: auto 0 0 0; margin: 0; width: 100%; max-width: 100%; max-height: 88dvh; border: 0; border-radius: 24px 24px 0 0; padding: 0; background: var(--card); color: var(--ink); box-shadow: 0 -10px 40px rgba(13,27,51,.2); overflow: auto; }
@media (min-width: 900px) { dialog.sheet { inset: 0 0 0 auto; height: 100dvh; max-height: none; width: 440px; border-radius: 24px 0 0 24px; } }
dialog.sheet::backdrop { background: rgba(22,58,96,.45); }
.sh-head { position: sticky; top: 0; background: var(--card); display: flex; align-items: center; gap: 10px; padding: 18px 20px 10px; z-index: 1; }
.sh-head h2 { font: 800 1.25rem var(--display); margin: 0 auto 0 0; }
.sh-body { padding: 4px 20px max(22px, env(safe-area-inset-bottom, 0px)); display: flex; flex-direction: column; gap: 16px; }
.x { border: 0; background: var(--mist); width: 38px; height: 38px; border-radius: 50%; font-size: 1.05rem; }
.tiles { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.tile { border: 1px solid var(--line); background: var(--card); border-radius: 18px; padding: 14px; text-align: left; display: flex; flex-direction: column; gap: 3px; }
.tile span { font-size: 1.6rem; }
.tile b { font-size: .98rem; }
.tile small { color: var(--muted); font-size: .8rem; line-height: 1.3; }
.places { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.place { border: 2px solid var(--line); background: var(--card); border-radius: 20px; padding: 16px; text-align: left; display: flex; flex-direction: column; gap: 4px; }
.place[aria-pressed="true"] { border-color: var(--ocean); background: var(--soft); }
.place span { font-size: 2rem; }
.place b { font: 700 1.08rem var(--display); }
.place small { color: var(--muted); font-size: .84rem; }
.note { background: var(--mist); border-radius: 14px; padding: 12px 14px; font-size: .88rem; color: var(--muted); }
.note b { color: var(--ink); }
.field { display: flex; flex-direction: column; gap: 8px; }
.field > label, .field > span { font-weight: 800; font-size: .86rem; letter-spacing: .02em; }
.field input[type="text"], .search { border: 1px solid var(--line); background: var(--mist); border-radius: 12px; padding: 11px 13px; width: 100%; }
.opts { display: flex; flex-wrap: wrap; gap: 6px; }
.opts button { border: 1px solid var(--line); background: var(--card); border-radius: 999px; padding: 8px 13px; font-weight: 700; font-size: .88rem; }
.opts button[aria-pressed="true"] { background: var(--ink); border-color: var(--ink); color: var(--card); }
.swatches { display: flex; gap: 10px; flex-wrap: wrap; }
.swatches button { width: 38px; height: 38px; border-radius: 50%; border: 3px solid #fff; box-shadow: 0 0 0 1px var(--line); }
.swatches button[aria-pressed="true"] { box-shadow: 0 0 0 3px var(--ocean); }
.toggle { display: flex; justify-content: space-between; align-items: center; gap: 12px; font-weight: 600; }
.toggle input { width: 22px; height: 22px; accent-color: var(--ocean); }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); gap: 8px; }
.word { border: 1px solid var(--line); background: var(--card); border-radius: 14px; padding: 11px 12px; text-align: left; font-weight: 700; }
.letters { display: grid; grid-template-columns: repeat(auto-fill, minmax(48px, 1fr)); gap: 6px; }
.letters button { border: 1px solid var(--line); background: var(--card); border-radius: 12px; padding: 10px 0; font: 800 1.1rem var(--display); }
.cat { font: 800 .78rem var(--body); letter-spacing: .08em; text-transform: uppercase; color: var(--muted); margin: 6px 0 -6px; }
.tabs { display: flex; gap: 6px; }
.tabs button { flex: 1; border: 1px solid var(--line); background: var(--card); border-radius: 12px; padding: 9px; font-weight: 800; }
.tabs button[aria-selected="true"] { background: var(--ocean); border-color: var(--ocean); color: #fff; }
.langs { display: flex; flex-direction: column; gap: 8px; }
.lang { border: 2px solid var(--line); background: var(--card); border-radius: 16px; padding: 12px 14px; display: flex; gap: 12px; align-items: center; text-align: left; }
.lang[aria-pressed="true"] { border-color: var(--ocean); background: var(--soft); }
.lang span { font-size: 1.7rem; }
.lang small { display: block; color: var(--muted); }
.logrow { display: flex; gap: 10px; align-items: baseline; padding: 9px 0; border-bottom: 1px solid var(--line); }
.logrow time { color: var(--muted); font-size: .76rem; font-variant-numeric: tabular-nums; flex: none; }
.logrow b { font-size: .7rem; letter-spacing: .06em; text-transform: uppercase; padding: 2px 8px; border-radius: 6px; flex: none; }
.logrow.d b { background: #ffe9da; color: #8a3a00; }
.logrow.h b { background: var(--soft); color: var(--ocean-2); }
ul.list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
ul.list li { display: flex; justify-content: space-between; gap: 10px; padding: 10px 12px; background: var(--mist); border-radius: 12px; }
ul.list li button { border: 0; background: none; color: var(--rec); font-weight: 800; }
.empty { color: var(--muted); margin: 0; }
.toast { position: fixed; left: 50%; bottom: calc(24px + env(safe-area-inset-bottom, 0px)); transform: translateX(-50%); background: var(--ink); color: var(--card); padding: 11px 18px; border-radius: 14px; font-weight: 700; opacity: 0; transition: opacity .25s; pointer-events: none; z-index: 60; max-width: 90vw; text-align: center; }
.toast.show { opacity: 1; }
@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; } }
.logrow.t b { background: #e9e4ff; color: #3b2b8f; }

/* ---------- quem vai usar ---------- */
.profiles { display: grid; gap: 10px; }
.profile { border: 2px solid var(--line); background: var(--card); border-radius: 20px; padding: 14px 16px; text-align: left; display: grid; grid-template-columns: 48px 1fr; column-gap: 12px; align-items: center; }
.profile span { grid-row: span 2; font-size: 2rem; text-align: center; }
.profile b { font: 700 1.05rem var(--display); }
.profile small { color: var(--muted); font-size: .84rem; line-height: 1.35; }
.profile:hover, .profile:focus-visible { border-color: var(--ocean); background: var(--soft); }
@media (min-width: 720px) { .profiles { grid-template-columns: 1fr 1fr; } }

/* ---------- orientação para pessoas cegas: alto contraste, botões enormes ---------- */
.blind { position: fixed; inset: 0; z-index: 40; background: #000; color: #fff; display: flex; flex-direction: column; gap: 10px;
  padding: max(12px, env(safe-area-inset-top, 0px)) 12px max(12px, env(safe-area-inset-bottom, 0px)); }
.b-head { display: flex; justify-content: space-between; align-items: center; font: 800 1.1rem var(--display); }
.b-head span { color: var(--honey); }
.b-head button { background: #fff; color: #000; border: 0; border-radius: 14px; padding: 12px 20px; font: 800 1.05rem var(--body); }
.b-status { margin: 0; min-height: 3.4em; font: 700 clamp(1.15rem, 4.6vw, 1.6rem)/1.3 var(--body); color: #ffe36e; }
.b-cam { height: 22vh; border-radius: 16px; overflow: hidden; border: 3px solid #ffe36e; }
.b-cam video { width: 100%; height: 100%; object-fit: cover; }
.b-grid { flex: 1; min-height: 0; display: grid; grid-template-columns: 1fr 1fr; grid-auto-rows: 1fr; gap: 10px; }
.b-grid button { border: 3px solid #ffe36e; background: #111; color: #fff; border-radius: 22px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; padding: 8px; }
.b-grid button:first-child, .b-grid button:nth-child(2) { grid-column: span 2; }
.b-grid span { font-size: clamp(2rem, 9vw, 3.4rem); }
.b-grid b { font: 800 clamp(1.2rem, 5vw, 1.8rem)/1.15 var(--display); text-align: center; }
.b-grid button:active { background: #ffe36e; color: #000; }
.b-grid .b-help { border-color: #ff4d4f; background: #3a0000; }
.help-screen { position: fixed; inset: 0; z-index: 41; background: #e5484d; color: #fff; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 18px; text-align: center; padding: 24px; animation: pulse 1s ease-in-out infinite alternate; }
.help-screen b { font: 800 clamp(2.4rem, 12vw, 5rem)/1 var(--display); }
.help-screen span { font: 700 clamp(1.3rem, 5vw, 2rem)/1.3 var(--body); max-width: 22ch; }
.help-screen small { opacity: .85; }
@keyframes pulse { to { background: #b4161b; } }

/* ---------- cartões que falam ---------- */
.panel.aac { max-height: 38vh; overflow-y: auto; }
.aac-strip { background: var(--card); border: 1px solid var(--line); border-radius: 16px; padding: 10px 12px; min-height: 2.8em; display: flex; flex-wrap: wrap; gap: 6px; align-items: center; font-weight: 700; }
.aac-strip b { background: var(--soft); color: var(--ocean-2); border-radius: 10px; padding: 4px 9px; }
.aac-strip .ph { color: var(--muted); font-weight: 500; }
.aac .cat { margin: 6px 0 0; font: 700 .82rem var(--body); text-transform: uppercase; letter-spacing: .08em; color: var(--muted); }
.aac-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 8px; }
.aac-card { border: 1px solid var(--line); background: var(--card); border-radius: 16px; padding: 10px 6px; display: flex; flex-direction: column; align-items: center; gap: 4px; font-weight: 700; font-size: .84rem; line-height: 1.2; text-align: center; }
.aac-card span { font-size: 2rem; }
.aac-card:active { background: var(--soft); border-color: var(--ocean); }
.modes button { white-space: nowrap; font-size: clamp(.74rem, 2.9vw, .95rem); padding: 10px 4px; }
.b-grid .b-help { grid-column: span 2; }
@media (max-width: 520px) { .modes { display: grid; grid-template-columns: 1fr 1fr; } .modes button { font-size: .86rem; padding: 9px 4px; } }

/* ---------- legendas ao vivo e alerta de sons ---------- */
.captions, .sounds { position: fixed; inset: 0; z-index: 40; background: #071a3d; color: #fff; display: flex; flex-direction: column; gap: 12px;
  padding: max(12px, env(safe-area-inset-top, 0px)) 14px max(14px, env(safe-area-inset-bottom, 0px)); --cap: 1; }
.cap-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; font: 700 1.15rem var(--display); }
.cap-live { color: #ff5d62; font: 700 .8rem var(--body); margin-left: 6px; animation: blink 1.2s infinite; }
.cap-tools { display: flex; gap: 6px; }
.cap-tools button { background: rgba(255,255,255,.12); color: #fff; border: 1px solid rgba(255,255,255,.25); border-radius: 12px; padding: 9px 13px; font-weight: 800; }
.cap-text { flex: 1; min-height: 0; overflow-y: auto; display: flex; flex-direction: column; gap: 10px; }
.cap-text p { margin: 0; font: 700 calc(clamp(1.5rem, 6.5vw, 2.6rem) * var(--cap))/1.25 var(--body); }
.cap-text p:not(:last-child):not(.interim) { opacity: .62; }
.cap-text .interim { color: #9fd8ff; }
.cap-text .me { color: var(--honey); text-align: right; }
.cap-text .cap-ph { color: rgba(255,255,255,.6); font-size: 1.15rem; font-weight: 500; }
.cap-reply input { background: rgba(255,255,255,.95); color: #0d1b33; }
.captions .row .btn, .sounds .btn:not(.sun) { background: rgba(255,255,255,.12); color: #fff; border-color: rgba(255,255,255,.25); }
.sounds { align-items: center; text-align: center; overflow-y: auto; }
.sounds .cap-head { align-self: stretch; }
.snd-big { font-size: clamp(4rem, 22vw, 7rem); margin-top: 2vh; }
.snd-state { margin: 0; font: 700 1.2rem var(--body); }
.snd-meter { width: min(100%, 420px); height: 14px; border-radius: 999px; background: rgba(255,255,255,.15); overflow: hidden; }
.snd-meter i { display: block; height: 100%; width: 0; background: var(--brand); transition: width .1s; }
.sounds .field { width: min(100%, 420px); color: #fff; display: flex; flex-direction: column; gap: 6px; font-weight: 700; }
.sounds .note { color: rgba(255,255,255,.75); max-width: 40ch; }
.snd-log { list-style: none; padding: 0; margin: 0; font-weight: 700; display: grid; gap: 6px; }
.sounds.flash { animation: flash 1.6s ease-out; }
@keyframes flash { 0%, 30%, 60% { background: #f2d10a; color: #000; } 15%, 45% { background: #ff5d62; } 100% { background: #071a3d; } }
.install-link { background: rgba(255,255,255,.12); color: #fff; border: 1px solid rgba(255,255,255,.3); border-radius: 999px; padding: 9px 18px; font-weight: 700; }
.sounds .note { background: transparent; border: 0; padding: 0; }
.cloud { display: flex; flex-direction: column; gap: 8px; border: 1px solid var(--line); border-radius: 18px; padding: 14px; background: var(--card); }
.cloud h3 { margin: 0; font: 600 1.05rem var(--display); }
.cloud-state { margin: 0; color: var(--muted); font-weight: 600; }
.cloud-state::before { content: "● "; color: #9aa6b8; }
.cloud[data-state="on"] .cloud-state::before { color: var(--leaf); }
.cloud[data-state="error"] .cloud-state::before { color: var(--rec); }
.studio-pane { display: flex; flex-direction: column; gap: 12px; margin-top: 12px; }
#studio .tabs { position: sticky; top: 0; z-index: 2; background: var(--card); padding-bottom: 6px; }
.field input[type=range] { width: 100%; accent-color: var(--ocean); }

/* ---------- gravador de sinais ---------- */
.pip.rec { width: clamp(150px, 44%, 420px); border-color: var(--leaf); }
.pip.rec.on { border-color: var(--rec); box-shadow: 0 0 0 5px rgba(229,72,77,.25); }
.teach-head { display: flex; justify-content: space-between; align-items: center; font: 600 1.05rem var(--display); }
.teach-head span { font: 700 .82rem var(--body); color: var(--muted); }
.teach-head .x, .sh-head .x { flex: none; }
.rec-words { border: 1px solid var(--line); background: var(--card); border-radius: 14px; padding: 12px 14px; font-size: 1rem; width: 100%; }
.rec-state { margin: 0; font-weight: 700; color: var(--ocean-2); }
.rec-state.rec { color: var(--rec); }
.takes { display: flex; flex-direction: column; gap: 6px; max-height: 24vh; overflow-y: auto; }
.take, .sign-row { display: flex; align-items: center; gap: 8px; background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 8px 10px; }
.take b, .sign-row b { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.take small, .sign-row small { color: var(--muted); font-weight: 600; }
.take button, .sign-row button { border: 1px solid var(--line); background: var(--mist); border-radius: 10px; padding: 7px 10px; font-weight: 700; }
.take button.ok, .sign-row button.ok { background: var(--leaf); border-color: var(--leaf); color: #fff; }
.chip-st { font: 700 .7rem var(--body); text-transform: uppercase; letter-spacing: .04em; border-radius: 999px; padding: 2px 8px; background: var(--soft); color: var(--ocean-2); }
.chip-st.aprovado { background: #e3f5ea; color: #2a8a55; } .chip-st.rejeitado { background: #fde8e8; color: #b4161b; }

/* ---------- conta ---------- */
.acc { display: flex; flex-direction: column; gap: 12px; }
.acc input { border: 1px solid var(--line); background: var(--mist); border-radius: 12px; padding: 12px 13px; width: 100%; font-size: 1rem; }
.acc .err { color: var(--rec); font-weight: 700; margin: 0; min-height: 1.2em; }
.acc .link { background: none; border: 0; color: var(--ocean-2); font-weight: 700; padding: 0; align-self: flex-start; text-decoration: underline; }
.acc .or { display: flex; align-items: center; gap: 10px; color: var(--muted); font-size: .85rem; }
.acc .or::before, .acc .or::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.acc .google { display: flex; align-items: center; justify-content: center; gap: 10px; }
.who-card { display: flex; align-items: center; gap: 12px; background: var(--soft); border-radius: 16px; padding: 14px; }
.who-card .ava { width: 48px; height: 48px; border-radius: 50%; background: var(--ocean); color: #fff; display: grid; place-items: center; font: 700 1.3rem var(--display); flex: none; }
.who-card div { display: flex; flex-direction: column; min-width: 0; }
.who-card small { color: var(--muted); overflow: hidden; text-overflow: ellipsis; }
.intro-links { display: flex; gap: 8px; flex-wrap: wrap; justify-content: center; }
.take input { flex: 1; min-width: 0; border: 1px solid var(--line); border-radius: 10px; padding: 7px 9px; background: var(--mist); }

/* camarim: grelha de pessoas com o rosto de cada uma */
.cam-h { font-size: .95rem; margin: 16px 0 8px; color: var(--deep); }
.cam-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(104px, 1fr)); gap: 10px; }
.cam-card { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 6px 6px 8px; border: 2px solid var(--line); border-radius: 16px; background: var(--card); text-align: center; }
.cam-card img { width: 100%; height: auto; aspect-ratio: 1; object-fit: cover; border-radius: 12px; background: #d6e4f0; }
.cam-card b { font-size: .9rem; } .cam-card small { font-size: .72rem; color: var(--muted); line-height: 1.2; }
.cam-card[aria-pressed="true"] { border-color: var(--leaf); box-shadow: 0 0 0 3px rgba(70,176,122,.25); }
#camarim .tabs { position: sticky; top: 0; z-index: 2; background: var(--card); padding-bottom: 6px; }
#camWear { width: 100%; margin-top: 16px; }
.cam-pick { display: flex; align-items: center; gap: 12px; width: 100%; padding: 8px; border: 1px solid var(--line); border-radius: 16px; background: var(--card); text-align: left; }
.cam-pick img { border-radius: 12px; flex: none; }
.cam-pick > span:first-of-type { flex: 1; display: flex; flex-direction: column; } .cam-pick small { color: var(--muted); }
.cam-pick .btn { flex: none; padding: 8px 12px; font-size: .85rem; }
#who { cursor: pointer; }

/* baixar a aplicação */
.install-link.strong { background: var(--leaf); border-color: var(--leaf); font-size: 1rem; padding: 11px 22px; box-shadow: 0 6px 18px rgba(0,0,0,.25); }
.install-bar { position: fixed; left: 12px; right: 12px; bottom: max(12px, env(safe-area-inset-bottom)); z-index: 30; display: flex; align-items: center; gap: 10px; max-width: 560px; margin: 0 auto;
  background: #fff; color: var(--ink); border-radius: 18px; padding: 10px 10px 10px 14px; box-shadow: 0 12px 34px rgba(13,30,55,.35); text-align: left; font-size: .9rem; animation: barIn .35s ease-out; }
.install-bar span { flex: 1; } .install-bar .btn { padding: 9px 16px; } .install-bar .x { flex: none; }
@keyframes barIn { from { transform: translateY(30px); opacity: 0; } }
.steps { margin: 0 0 12px; padding-left: 22px; display: flex; flex-direction: column; gap: 10px; line-height: 1.4; }
.site { font-size: 1.05rem; word-break: break-all; text-align: center; margin: 8px 0 12px; }
#installHelp .btn { width: 100%; }
#accGuest { width: 100%; margin-top: 4px; }

/* bandeiras (imagem) */
.flag { display: inline-block; width: 1.4em; height: auto; aspect-ratio: 4 / 3; border-radius: 3px; vertical-align: -0.2em; box-shadow: 0 0 0 1px rgba(0,0,0,.12); object-fit: cover; }
.lang > span .flag { width: 34px; }

@media (max-aspect-ratio: 4/5) {
  .stagewrap { position: relative; }
  #avatarCanvas { inset: 0 0 auto; height: calc(100% - clamp(56px, 8vh, 74px)); }
  .speech-output {
    position: absolute;
    inset: auto 12px 8px;
    z-index: 3;
    width: auto;
    max-height: clamp(56px, 8vh, 74px);
    overflow-y: auto;
    padding: 0 4px;
  }
  .sub { max-height: 100%; overflow-y: auto; }
  .dock { gap: 6px; padding-top: 6px; padding-bottom: max(8px, env(safe-area-inset-bottom, 0px)); }
  .modes { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 2px; padding: 3px; }
  .modes button { min-width: 0; padding: 7px 1px; font-size: clamp(.65rem, 2.6vw, .76rem); line-height: 1.15; white-space: normal; }
  .answer { max-height: 5.2em; padding: 8px 10px; font-size: .94rem; line-height: 1.35; }
  .stage.has-pip ~ .speech-output { right: calc(var(--camera-column) + 14px); }
}

@media (max-height: 560px) and (min-aspect-ratio: 6/5) {
  .app { display: grid; grid-template-columns: minmax(0, 1fr) minmax(280px, 36vw); grid-template-rows: auto minmax(0, 1fr); }
  .bar { grid-column: 1 / -1; padding-top: 4px; padding-bottom: 4px; }
  .stagewrap { grid-column: 1; grid-row: 2; min-width: 0; padding-bottom: 8px; }
  .speech-output { max-height: clamp(50px, 14vh, 68px); overflow-y: auto; padding: 4px; }
  .dock { grid-column: 2; grid-row: 2; width: auto; max-width: none; min-width: 0; min-height: 0; margin: 0; padding: 4px max(8px, env(safe-area-inset-right, 0px)) 8px 4px; gap: 6px; overflow-y: auto; }
  .modes { display: grid; grid-template-columns: 1fr 1fr; gap: 2px; padding: 3px; }
  .modes button { min-width: 0; padding: 7px 3px; font-size: clamp(.72rem, 1.5vw, .9rem); line-height: 1.15; white-space: normal; }
  .panel { gap: 5px; }
  .say input { padding: 9px 10px; font-size: .9rem; }
  .mic { width: 44px; height: 44px; }
  .answer { max-height: min(24vh, 8em); padding: 8px 10px; font-size: .9rem; line-height: 1.35; }
}
