/* ---------- Tipos de letra acessíveis (SIL Open Font License, ver /fonts) ---------- */
@font-face { font-family: "Atkinson Hyperlegible"; font-weight: 400; font-display: swap; src: url(/fonts/atkinson-hyperlegible-latin-400-normal.woff2) format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Atkinson Hyperlegible"; font-weight: 400; font-display: swap; src: url(/fonts/atkinson-hyperlegible-latin-ext-400-normal.woff2) format("woff2"); unicode-range: U+0100-02AF, U+0304, U+0308, U+0329, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: "Atkinson Hyperlegible"; font-weight: 700; font-display: swap; src: url(/fonts/atkinson-hyperlegible-latin-700-normal.woff2) format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Atkinson Hyperlegible"; font-weight: 700; font-display: swap; src: url(/fonts/atkinson-hyperlegible-latin-ext-700-normal.woff2) format("woff2"); unicode-range: U+0100-02AF, U+0304, U+0308, U+0329, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: "OpenDyslexic"; font-weight: 400; font-display: swap; src: url(/fonts/opendyslexic-latin-400-normal.woff2) format("woff2"); }
@font-face { font-family: "OpenDyslexic"; font-weight: 700; font-display: swap; src: url(/fonts/opendyslexic-latin-700-normal.woff2) format("woff2"); }

/* ---------- Tipos de letra da interface (SIL Open Font License, ver /fonts) ---------- */
@font-face { font-family: "Bricolage Grotesque"; font-weight: 200 800; font-display: swap; src: url(/fonts/bricolage-grotesque-latin-wght-normal.woff2) format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Bricolage Grotesque"; font-weight: 200 800; font-display: swap; src: url(/fonts/bricolage-grotesque-latin-ext-wght-normal.woff2) format("woff2"); unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: "Instrument Sans"; font-weight: 400 700; font-display: swap; src: url(/fonts/instrument-sans-latin-wght-normal.woff2) format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Instrument Sans"; font-weight: 400 700; font-display: swap; src: url(/fonts/instrument-sans-latin-ext-wght-normal.woff2) format("woff2"); unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: "JetBrains Mono"; font-weight: 100 800; font-display: swap; src: url(/fonts/jetbrains-mono-latin-wght-normal.woff2) format("woff2"); }

/*
 * ---------- Tokens ----------
 * Escuro por defeito (sala às escuras, ecrã de régie). Neutros em azul-tinta,
 * acento amarelo-legenda, vermelho "tally" para o que está no ar.
 * --brand é a cor de cada organização (página do público, ecrã de palco).
 */
:root {
  --brand: #4f9cff;
  --bg: #0b0e13;
  --bg-2: #0f131a;
  --surface: #141922;
  --surface-2: #1b2230;
  --surface-3: #232c3d;
  --border: #263042;
  --border-strong: #35415a;
  --text: #eef1f6;
  --text-dim: #b3bccb;
  --muted: #8a95a8;
  --interim: #7c8799;
  --accent: #ffd23f;
  --accent-hover: #ffdd6b;
  --accent-ink: #ffd23f;
  --on-accent: #17130a;
  --accent-soft: rgba(255, 210, 63, .12);
  --tally: #ff4b4b;
  --live: #3ccf86;
  --paused: #f5a524;
  --danger: #ff5c5c;
  --good-bg: rgba(60, 207, 134, .14);
  --warn-bg: rgba(245, 165, 36, .14);
  --crit-bg: rgba(255, 92, 92, .15);
  --shadow: 0 1px 0 rgba(255, 255, 255, .03) inset, 0 12px 32px -12px rgba(0, 0, 0, .55);
  --grid-line: rgba(138, 149, 168, .07);
  --radius: 14px;
  --radius-sm: 10px;
  --font: "Instrument Sans", system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-display: "Bricolage Grotesque", "Instrument Sans", system-ui, sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  --series-1: #b88a00;
  --series-2: #3d7fe0;
  color-scheme: dark;
}

/* Tema claro: escolhido pelo sistema (se a pessoa não forçou o escuro) ou explicitamente. */
@media (prefers-color-scheme: light) {
  :root:not([data-theme="dark"]) {
    --bg: #f6f7f9;
    --series-1: #c99700;
    --series-2: #2f6fe0;
    --bg-2: #eef1f5;
    --surface: #ffffff;
    --surface-2: #f0f2f6;
    --surface-3: #e5e9f0;
    --border: #dde2ea;
    --border-strong: #c4ccd8;
    --text: #121722;
    --text-dim: #3e4757;
    --muted: #5d6779;
    --interim: #6b7587;
    --accent: #ffcc1a;
    --accent-hover: #ffd84d;
    --accent-ink: #8a5d00;
    --on-accent: #17130a;
    --accent-soft: rgba(255, 196, 0, .16);
    --tally: #e5252a;
    --live: #14834d;
    --paused: #a35f00;
    --danger: #c9252a;
    --good-bg: rgba(20, 131, 77, .1);
    --warn-bg: rgba(163, 95, 0, .1);
    --crit-bg: rgba(201, 37, 42, .1);
    --shadow: 0 1px 2px rgba(18, 23, 34, .05), 0 10px 28px -14px rgba(18, 23, 34, .18);
    --grid-line: rgba(18, 23, 34, .05);
    color-scheme: light;
  }
}
:root[data-theme="light"] {
  --bg: #f6f7f9;
  --series-1: #c99700;
  --series-2: #2f6fe0;
  --bg-2: #eef1f5;
  --surface: #ffffff;
  --surface-2: #f0f2f6;
  --surface-3: #e5e9f0;
  --border: #dde2ea;
  --border-strong: #c4ccd8;
  --text: #121722;
  --text-dim: #3e4757;
  --muted: #5d6779;
  --interim: #6b7587;
  --accent: #ffcc1a;
  --accent-hover: #ffd84d;
  --accent-ink: #8a5d00;
  --on-accent: #17130a;
  --accent-soft: rgba(255, 196, 0, .16);
  --tally: #e5252a;
  --live: #14834d;
  --paused: #a35f00;
  --danger: #c9252a;
  --good-bg: rgba(20, 131, 77, .1);
  --warn-bg: rgba(163, 95, 0, .1);
  --crit-bg: rgba(201, 37, 42, .1);
  --shadow: 0 1px 2px rgba(18, 23, 34, .05), 0 10px 28px -14px rgba(18, 23, 34, .18);
  --grid-line: rgba(18, 23, 34, .05);
  color-scheme: light;
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  line-height: 1.5;
  -webkit-text-size-adjust: 100%;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--accent-ink); text-underline-offset: 3px; }
[hidden] { display: none !important; }
h1, h2, h3 { text-wrap: balance; }
::selection { background: var(--accent); color: var(--on-accent); }

button, select, input, textarea {
  font: inherit;
  color: inherit;
}
button {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 10px 16px;
  cursor: pointer;
  min-height: 44px;
  font-weight: 550;
  transition: background-color .15s, border-color .15s, transform .1s;
}
button:hover:not(:disabled) { border-color: var(--border-strong); background: var(--surface-3); }
button:active:not(:disabled) { transform: translateY(1px); }
button:disabled { opacity: .45; cursor: not-allowed; }
button:focus-visible, select:focus-visible, input:focus-visible, textarea:focus-visible, a:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
button.primary { background: var(--accent); border-color: var(--accent); color: var(--on-accent); font-weight: 650; }
button.primary:hover:not(:disabled) { background: var(--accent-hover); border-color: var(--accent-hover); }
button.danger { background: transparent; border-color: var(--danger); color: var(--danger); }
button.danger:hover:not(:disabled) { background: var(--crit-bg); border-color: var(--danger); }
select, input[type="text"], input[type="password"], input[type="email"], textarea {
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  min-height: 44px;
  max-width: 100%;
  transition: border-color .15s, box-shadow .15s;
}
select:hover, input[type="text"]:hover, input[type="password"]:hover, input[type="email"]:hover, textarea:hover { border-color: var(--border-strong); }
input[type="text"]:focus, input[type="password"]:focus, input[type="email"]:focus, textarea:focus, select:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); outline: none; }
textarea { width: 100%; resize: vertical; font-family: var(--font-mono); font-size: .85rem; line-height: 1.6; }
input[type="color"] { width: 64px; height: 44px; padding: 3px; border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--bg-2); cursor: pointer; }
input[type="file"] { max-width: 100%; font-size: .85rem; color: var(--muted); }
input[type="file"]::file-selector-button { font: inherit; font-weight: 550; color: var(--text); background: var(--surface-2); border: 1px solid var(--border); border-radius: 8px; padding: 8px 12px; margin-right: 10px; cursor: pointer; }
input[type="checkbox"] { width: 18px; height: 18px; accent-color: var(--accent); }
label { display: block; color: var(--text-dim); font-size: .85rem; font-weight: 550; margin-bottom: 6px; }
.hint { color: var(--muted); font-size: .85rem; margin: 6px 0 10px; }

.pill {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 4px 12px; border-radius: 999px;
  font-size: .78rem; font-weight: 650; letter-spacing: .04em; text-transform: uppercase;
  background: var(--surface-2); color: var(--muted);
  border: 1px solid var(--border);
  white-space: nowrap;
}
.pill::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: currentColor; }
.pill.live { color: var(--tally); border-color: color-mix(in srgb, var(--tally) 40%, transparent); background: color-mix(in srgb, var(--tally) 12%, transparent); }
.pill.live::before { animation: pulse 1.6s infinite; box-shadow: 0 0 0 0 currentColor; }
.pill.paused { color: var(--paused); }
.pill.ended { color: var(--muted); }
.pill.offline { color: var(--danger); }
@keyframes pulse { 50% { opacity: .3; } }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }

/* Marca (logótipo SaySynq: duas linhas de legenda) */
.logo { display: inline-flex; align-items: center; gap: 10px; font-family: var(--font-display); font-weight: 750; font-size: 1.15rem; letter-spacing: .02em; color: var(--text); text-decoration: none; }
.logo-mark { width: 28px; height: 28px; flex-shrink: 0; display: block; }
.logo-mark rect.bg { fill: var(--accent); }
.logo-mark rect.line { fill: var(--on-accent); }

/* ---------- Público ---------- */
.viewer { display: flex; flex-direction: column; height: 100dvh; }
.viewer header {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 14px 6px; padding-top: max(10px, env(safe-area-inset-top));
  background: var(--surface);
  border-top: 3px solid var(--brand);
}
.event { display: flex; align-items: center; gap: 10px; min-width: 0; flex: 1; }
.event-logo { height: 36px; width: auto; max-width: 96px; object-fit: contain; border-radius: 6px; flex-shrink: 0; }
.event-text { min-width: 0; }
.event-title { font-family: var(--font-display); font-weight: 700; font-size: 1.05rem; line-height: 1.2; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.event-speaker { color: var(--muted); font-size: .85rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.viewer header .pill { flex-shrink: 0; }
.toolbar {
  display: flex; align-items: center; gap: 6px;
  padding: 6px 14px 10px;
  background: var(--surface); border-bottom: 1px solid var(--border);
}
.toolbar .spacer { flex: 1; }
.toolbar select { min-height: 40px; padding: 6px 8px; min-width: 0; flex: 0 1 auto; max-width: 60vw; font-weight: 600; }
.toolbar button { min-height: 40px; min-width: 40px; padding: 6px 8px; font-weight: 700; flex-shrink: 0; }
.toolbar .listen-btn { font-size: 1.15rem; }
.toolbar .listen-btn.on { background: var(--brand); border-color: var(--brand); color: #fff; }
.listen-bar {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
  padding: 8px 14px 10px;
  background: var(--surface); border-bottom: 1px solid var(--border);
  border-inline-start: 4px solid var(--brand);
}
.listen-bar .spacer { flex: 1; }
.listen-status { font-weight: 650; font-size: .95rem; }
.listen-rate { display: flex; align-items: center; gap: 6px; margin: 0; color: var(--muted); font-size: .85rem; }
.listen-rate select { min-height: 36px; padding: 4px 8px; }
.listen-bar button { min-height: 36px; padding: 4px 12px; }
.listen-hint { flex-basis: 100%; margin: 0; color: var(--muted); font-size: .8rem; }
.settings {
  display: grid; gap: 12px; padding: 12px 14px 14px;
  background: var(--surface); border-bottom: 1px solid var(--border);
}
.setting { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.setting-label { color: var(--muted); font-size: .875rem; margin: 0; min-width: 6.5em; }
.setting select { flex: 1; min-width: 0; }
.setting .checkbox { color: var(--text); margin: 0; }
.segmented { display: inline-flex; border: 1px solid var(--border); border-radius: var(--radius-sm); overflow: hidden; }
.segmented button { border: 0; border-radius: 0; min-height: 38px; padding: 6px 12px; background: transparent; }
.segmented button + button { border-left: 1px solid var(--border); }
.segmented button[aria-checked="true"] { background: var(--brand); color: #fff; font-weight: 650; }

.viewer main {
  flex: 1; overflow-y: auto; overscroll-behavior: contain;
  padding: 16px 16px 96px;
  font-size: var(--font-size, 26px);
  line-height: 1.4;
}
.viewer main[data-font="atkinson"] { font-family: "Atkinson Hyperlegible", var(--font); }
.viewer main[data-font="dyslexic"] { font-family: "OpenDyslexic", var(--font); line-height: 1.6; }
.viewer main[data-font="serif"] { font-family: Georgia, "Times New Roman", serif; }
.viewer main p { margin: 0 0 .6em; max-width: 46em; transition: color .3s; }
.viewer main.highlight-latest p:not(.latest):not(.interim):not(.typing) { color: var(--text-dim); }
.viewer main.highlight-latest p.latest {
  border-inline-start: 4px solid var(--brand);
  padding-inline-start: .45em;
  margin-inline-start: calc(-.45em - 4px);
}
/* Partes da mesma frase (modo rápido) ficam seguidas, no mesmo parágrafo. */
.viewer main p.open, .viewer main p.open + p { display: inline; }
.viewer main p.open::after { content: " "; }
.viewer main p.open + p:not(.open)::after { content: ""; display: block; margin-bottom: .6em; }
.viewer main.highlight-latest p.latest.open,
.viewer main.highlight-latest p.latest.cont { border: 0; padding: 0; margin: 0; }
.viewer main p.fallback { font-style: italic; color: var(--muted); }
.viewer main p.partial::after { content: "▍"; color: var(--brand); animation: pulse 1s infinite; margin-inline-start: .1em; }
.viewer main p.interim { color: var(--interim); }
.viewer main .typing { color: var(--interim); letter-spacing: .2em; }
.viewer main .typing span { animation: pulse 1.2s infinite; }
.viewer main .typing span:nth-child(2) { animation-delay: .2s; }
.viewer main .typing span:nth-child(3) { animation-delay: .4s; }
.viewer .empty { color: var(--muted); font-size: 1.1rem; text-align: center; margin-top: 30vh; }
.back-live {
  position: fixed; left: 50%; transform: translateX(-50%);
  bottom: max(20px, env(safe-area-inset-bottom));
  background: var(--brand); border-color: var(--brand); color: #fff;
  border-radius: 999px; padding: 10px 20px; font-weight: 650;
  box-shadow: 0 6px 24px rgba(0,0,0,.35);
}

/* ---------- Áreas de trabalho (painel, consola, administração) ---------- */
body.admin-body {
  background:
    radial-gradient(1200px 400px at 50% -200px, var(--accent-soft), transparent 70%),
    var(--bg);
  background-attachment: fixed;
}
.admin { max-width: 1240px; margin: 0 auto; padding: 16px; padding-bottom: 48px; }
.admin h1 { font-family: var(--font-display); font-size: 1.5rem; font-weight: 700; letter-spacing: -.01em; margin: 0; }
.admin h3 { font-size: .8rem; margin: 22px 0 10px; font-weight: 650; color: var(--text-dim); text-transform: uppercase; letter-spacing: .06em; }
.admin h3 .muted { text-transform: none; letter-spacing: 0; font-weight: 400; }
.admin > header { display: flex; align-items: center; gap: 12px; margin-bottom: 20px; flex-wrap: wrap; }
.admin header .spacer { flex: 1; }
.card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 20px; margin-bottom: 16px;
  box-shadow: var(--shadow);
}
.card h2 {
  display: flex; align-items: center; gap: 8px;
  font-size: .78rem; margin: 0 0 14px; color: var(--muted); font-weight: 650;
  text-transform: uppercase; letter-spacing: .08em;
}
.card h2::before { content: ""; width: 10px; height: 3px; border-radius: 2px; background: var(--accent); }
.notice { border-color: color-mix(in srgb, var(--paused) 50%, var(--border)); background: var(--warn-bg); box-shadow: none; }
.grid { display: grid; gap: 16px; grid-template-columns: 1fr; }
.grid > div { min-width: 0; }
@media (min-width: 900px) { .grid { grid-template-columns: 380px 1fr; } }
.row { display: flex; gap: 8px; flex-wrap: wrap; align-items: flex-end; }
.row > .field { flex: 1; min-width: 140px; }
.field { margin-bottom: 14px; }
.field select, .field input[type="text"], .field input[type="email"], .field input[type="password"] { width: 100%; }
.card .error:empty, .card .success:empty { min-height: 0; margin: 0; }
.checkbox { display: flex; align-items: center; gap: 8px; color: var(--text); font-size: .95rem; font-weight: 400; }

.session-code {
  font-family: var(--font-mono); font-size: 2.6rem; font-weight: 700; letter-spacing: .14em;
  font-variant-numeric: tabular-nums; line-height: 1.1;
  color: var(--accent-ink);
}
.session-link { word-break: break-all; font-size: .95rem; font-family: var(--font-mono); }
.qr { background: #fff; border-radius: 12px; padding: 10px; width: 100%; max-width: 260px; aspect-ratio: 1; box-shadow: var(--shadow); }
.qr img { width: 100%; height: 100%; display: block; }
.logo-preview { display: flex; align-items: center; gap: 12px; margin-bottom: 12px; }
.logo-preview img { max-height: 56px; max-width: 160px; object-fit: contain; background: var(--surface-2); border-radius: 8px; padding: 4px; }

.meter { height: 14px; border-radius: 7px; background: var(--bg-2); overflow: hidden; border: 1px solid var(--border); }
.meter > div { height: 100%; width: 0; background: linear-gradient(90deg, var(--live) 0%, var(--live) 70%, var(--paused) 85%, var(--danger) 100%); background-size: 100vw 100%; transition: width 80ms linear; }

/* Estado (bom / aviso / crítico): sempre com ícone e texto, nunca só cor. */
.badge { display: inline-block; margin-left: 8px; padding: 1px 8px; border-radius: 999px; font-size: .78rem; font-weight: 650; color: var(--text); }
.badge.good { background: var(--good-bg); }
.badge.warning { background: var(--warn-bg); }
.badge.critical { background: var(--crit-bg); }
.good-text { color: var(--text); }
.warn-text { color: var(--paused); font-weight: 650; }

.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 12px; }
.tile, .lat-tile { background: var(--bg-2); border: 1px solid var(--border); border-radius: 12px; padding: 14px 16px; }
.tile-label { color: var(--muted); font-size: .8rem; font-weight: 550; }
.tile-value { font-family: var(--font-display); font-size: 2.1rem; font-weight: 700; font-variant-numeric: tabular-nums; line-height: 1.15; letter-spacing: -.02em; }
.tile-sub { color: var(--muted); font-size: .8rem; margin-top: 2px; }
.spark { height: 48px; margin-top: 6px; }
.spark svg { width: 100%; height: 100%; display: block; overflow: visible; touch-action: none; }
.spark-line { fill: none; stroke: var(--accent); stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; vector-effect: non-scaling-stroke; }
.spark-base { stroke: var(--border); stroke-width: 1; vector-effect: non-scaling-stroke; }
.spark-dot { fill: var(--accent); stroke: var(--bg); stroke-width: 2; }
.spark-cross { stroke: var(--muted); stroke-width: 1; vector-effect: non-scaling-stroke; }
.tooltip {
  position: absolute; z-index: 20; transform: translate(-50%, -100%);
  background: var(--surface-3); color: var(--text); border: 1px solid var(--border);
  border-radius: 8px; padding: 4px 8px; font-size: .8rem; pointer-events: none; white-space: nowrap;
  box-shadow: 0 4px 16px rgba(0,0,0,.3);
}
.bars { display: grid; gap: 8px; }
.bar-row { display: grid; grid-template-columns: minmax(90px, 34%) 1fr 3ch; align-items: center; gap: 10px; font-size: .9rem; }
.bar-label { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bar-track { height: 12px; background: var(--bg-2); border-radius: 6px; overflow: hidden; }
.bar-fill { display: block; height: 100%; background: var(--accent); border-radius: 6px; transition: width .4s; }
.bar-value { text-align: right; font-variant-numeric: tabular-nums; font-weight: 650; }
.latency { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 10px; }
.lat-value { font-family: var(--font-display); font-size: 1.5rem; font-weight: 700; font-variant-numeric: tabular-nums; }

.preview {
  height: 50vh; min-height: 260px; overflow-y: auto;
  font-size: 1.15rem; background: var(--bg-2); border-radius: 12px; padding: 14px 16px;
  border: 1px solid var(--border);
}
.preview p { margin: 0 0 .5em; }
.preview p.open, .preview p.open + p { display: inline; }
.preview p.open::after { content: " "; }
.preview p.open + p:not(.open)::after { content: ""; display: block; margin-bottom: .5em; }
.preview .interim { color: var(--interim); }
.error { color: var(--danger); font-size: .95rem; min-height: 1.2em; }
.muted { color: var(--muted); }

.login { max-width: 360px; margin: 15vh auto; }

/* Ecrã para projetar o QR code */
.projector {
  position: fixed; inset: 0; z-index: 10; background: #07090d; color: #fff;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2.2vh;
  padding: 4vh; text-align: center; cursor: pointer;
  border-top: 1vh solid var(--brand);
}
.projector .qr { max-width: min(46vh, 80vw); padding: 2vh; }
.projector .title { font-family: var(--font-display); font-size: 4.6vh; font-weight: 700; letter-spacing: -.01em; }
.proj-logo { max-height: 10vh; max-width: 40vw; object-fit: contain; }
.proj-speaker { font-size: 3vh; color: #b8bec8; margin-top: -1vh; }
.projector .url { font-family: var(--font-mono); font-size: 4.2vh; font-weight: 700; word-break: break-all; color: var(--brand); }
.projector .code { font-size: 3.4vh; color: #b8bec8; }
.projector .code b { font-family: var(--font-mono); color: #fff; letter-spacing: .14em; }
.proj-hint { font-size: 2.6vh; color: #b8bec8; }

/* ---------- Ecrã de palco / OBS ---------- */
body.stage { --stage-size: min(6.2vw, 11vh); --stage-lines: 3; background: #000; color: #fff; overflow: hidden; }
body.stage[data-bg="transparent"] { background: transparent; }
body.stage[data-bg="green"] { background: #00b140; }
body.stage[data-bg="light"] { background: #fff; color: #111; }
/* Janela com a altura de N linhas, ancorada em baixo: o texto mais antigo sai por cima. */
.stage-window {
  position: fixed; left: 5vw; right: 5vw; bottom: 5vh;
  height: calc(var(--stage-lines) * 1.25 * var(--stage-size));
  overflow: hidden;
}
.stage-text {
  position: absolute; left: 0; right: 0; bottom: 0;
  font-family: "Atkinson Hyperlegible", var(--font);
  font-size: var(--stage-size); font-weight: 700; line-height: 1.25;
}
.stage-interim { opacity: .7; }
body.stage[data-bg="transparent"] .stage-text,
body.stage[data-bg="green"] .stage-text {
  text-shadow: 0 0 .08em #000, 0 0 .08em #000, .04em .04em .1em #000;
}
.stage-offline { position: fixed; top: 12px; right: 16px; font: 600 14px var(--font); color: #ef5350; background: rgba(0,0,0,.6); padding: 4px 10px; border-radius: 999px; }

/* ---------- Conta (entrar, registar, ...) ---------- */
.auth-page { display: grid; min-height: 100%; grid-template-columns: 1fr; }
@media (min-width: 960px) { .auth-page { grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr); } }
.auth-side {
  display: none; position: relative; overflow: hidden;
  padding: 40px 48px; flex-direction: column; justify-content: space-between; gap: 32px;
  background:
    linear-gradient(var(--grid-line) 1px, transparent 1px) 0 0 / 100% 32px,
    radial-gradient(800px 500px at 0% 100%, var(--accent-soft), transparent 70%),
    var(--bg-2);
  border-right: 1px solid var(--border);
}
@media (min-width: 960px) { .auth-side { display: flex; } }
.auth-side .logo { font-size: 1.25rem; }
.auth-quote { max-width: 30em; }
.auth-quote h2 { font-family: var(--font-display); font-size: clamp(1.8rem, 2.6vw, 2.6rem); font-weight: 700; letter-spacing: -.025em; line-height: 1.08; margin: 0 0 16px; }
.auth-quote p { color: var(--text-dim); margin: 0; font-size: 1.05rem; }
.auth-side .monitor { max-width: 520px; }
.auth { width: 100%; max-width: 440px; margin: 0 auto; padding: 48px 16px; align-self: center; }
.auth h1 { font-family: var(--font-display); font-size: 1.9rem; font-weight: 700; letter-spacing: -.02em; margin: 0 0 6px; }
.auth h1 + .muted, .auth h1 + p { margin-top: 0; }
.auth .card { padding: 28px; }
.auth-brand { display: flex; justify-content: center; margin-bottom: 28px; }
@media (min-width: 960px) { .auth-brand { display: none; } }
.auth input[type="email"], .auth input[type="password"], .auth input[type="text"] { width: 100%; }
.auth-links { text-align: center; color: var(--muted); font-size: .9rem; margin-top: 18px; }
.auth form .primary.wide, .auth .button.primary.wide { margin-top: 6px; }
.wide { width: 100%; }
.success { color: var(--live); font-size: .95rem; }
a.button, label.button {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--radius-sm);
  padding: 10px 16px; min-height: 44px; color: var(--text); text-decoration: none; font-size: .95rem; font-weight: 550;
  transition: background-color .15s, border-color .15s;
}
a.button:hover, label.button:hover { border-color: var(--border-strong); background: var(--surface-3); }
a.button.primary { background: var(--accent); border-color: var(--accent); color: var(--on-accent); font-weight: 650; }
a.button.primary:hover { background: var(--accent-hover); border-color: var(--accent-hover); }
a.button.ghost { background: transparent; border-color: transparent; }
a.button.ghost:hover { background: var(--surface-2); }

/* ---------- Painel ---------- */
.app-header {
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
  margin: -16px -16px 20px; padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  background: color-mix(in srgb, var(--bg) 80%, transparent);
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  position: sticky; top: 0; z-index: 5;
}
.app-header .spacer { flex: 1; }
.app-brand { font-family: var(--font-display); font-weight: 750; font-size: 1.15rem; color: var(--text); text-decoration: none; letter-spacing: .02em; display: inline-flex; align-items: center; gap: 10px; }
.app-org { font-weight: 650; padding-left: 12px; border-left: 1px solid var(--border); }
.app-header select { min-height: 38px; padding: 6px 10px; font-weight: 600; }
.app-header button, .app-header a.button { min-height: 38px; padding: 6px 14px; font-size: .9rem; }
.usage { display: flex; align-items: center; gap: 8px; font-size: .85rem; color: var(--muted); font-variant-numeric: tabular-nums; }
.usage .pill { color: var(--accent-ink); border-color: color-mix(in srgb, var(--accent) 35%, transparent); background: var(--accent-soft); }
.usage .pill::before { display: none; }
.usage-bar { width: 90px; height: 6px; border-radius: 3px; background: var(--surface-3); overflow: hidden; }
.usage-bar > span { display: block; height: 100%; width: 0; background: var(--accent); border-radius: 3px; }
.usage.warn .usage-bar > span { background: var(--paused); }
.usage.warn .usage-text { color: var(--paused); font-weight: 650; }
.tabs { display: flex; gap: 4px; padding: 4px; margin-bottom: 20px; overflow-x: auto; background: var(--surface); border: 1px solid var(--border); border-radius: 12px; width: fit-content; max-width: 100%; }
.tabs button { background: transparent; border: 0; border-radius: 8px; color: var(--muted); font-weight: 600; white-space: nowrap; min-height: 38px; padding: 6px 14px; }
.tabs button:hover:not(:disabled) { background: var(--surface-2); color: var(--text); }
.tabs button[aria-selected="true"] { color: var(--on-accent); background: var(--accent); }
.table-wrap { overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; font-size: .95rem; }
.table th { text-align: left; color: var(--muted); font-weight: 650; font-size: .72rem; text-transform: uppercase; letter-spacing: .08em; padding: 8px 10px; border-bottom: 1px solid var(--border); white-space: nowrap; }
.table td { padding: 12px 10px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.table tr:last-child td { border-bottom: 0; }
.table tbody tr { transition: background-color .15s; }
.table tbody tr:hover { background: var(--surface-2); }
.table select { min-height: 36px; padding: 4px 8px; }
.table td.actions { text-align: right; white-space: nowrap; }
.table td.num { text-align: right; font-variant-numeric: tabular-nums; }
.actions .button, .actions button { min-height: 36px; padding: 6px 12px; font-size: .85rem; margin: 2px 0 2px 6px; }
.mono { font-family: var(--font-mono); letter-spacing: .08em; font-weight: 600; }
.list-row { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 10px 0; border-bottom: 1px solid var(--border); }
.card h2 + .row { margin-top: 4px; }
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; margin-bottom: 16px; }
.stat { background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: 14px 16px; }
.stat .tile-value { font-size: 1.9rem; }
.stat.hot .tile-value { color: var(--tally); }
.tag { display: inline-block; padding: 1px 8px; border-radius: 6px; font-size: .75rem; font-weight: 650; background: var(--surface-3); color: var(--text-dim); }
.tag.accent { background: var(--accent-soft); color: var(--accent-ink); }

/* ---------- Monitor de legendas (landing e páginas de conta) ---------- */
.monitor {
  position: relative;
  background: var(--surface); border: 1px solid var(--border); border-radius: 18px;
  box-shadow: var(--shadow), 0 40px 80px -40px rgba(0, 0, 0, .5);
  overflow: hidden; max-width: 100%;
}
.monitor-bar {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  padding: 12px 16px; border-bottom: 1px solid var(--border); background: var(--bg-2);
  font-size: .8rem; color: var(--muted);
}
.monitor-bar .spacer { flex: 1; }
.tc { font-family: var(--font-mono); font-variant-numeric: tabular-nums; color: var(--text-dim); letter-spacing: .04em; }
.monitor-src { padding: 18px 18px 14px; border-bottom: 1px dashed var(--border); }
.monitor-label { display: flex; align-items: center; gap: 8px; font-size: .72rem; font-weight: 650; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); margin-bottom: 8px; }
.monitor-src p { margin: 0; font-size: 1.05rem; color: var(--text-dim); min-height: 3em; }
.monitor-src p .new { color: var(--text); }
.monitor-out { display: grid; gap: 0; }
.out-row { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 14px; align-items: baseline; padding: 14px 18px; }
.out-row + .out-row { border-top: 1px solid var(--border); }
.out-row .code { font-family: var(--font-mono); font-size: .75rem; font-weight: 700; color: var(--accent-ink); background: var(--accent-soft); border-radius: 6px; padding: 2px 7px; letter-spacing: .06em; }
.out-row p { margin: 0; font-family: "Atkinson Hyperlegible", var(--font); font-size: clamp(1.05rem, 1.6vw, 1.3rem); font-weight: 700; line-height: 1.35; min-height: 2.7em; }
.out-row p .caret { display: inline-block; width: .5em; height: 1em; margin-left: 2px; vertical-align: -.12em; background: var(--accent); animation: pulse 1s infinite; }
.monitor-foot { display: flex; align-items: center; gap: 8px; padding: 10px 16px; background: var(--bg-2); border-top: 1px solid var(--border); font-size: .78rem; color: var(--muted); }
.monitor-foot b { font-family: var(--font-mono); color: var(--text-dim); font-weight: 600; font-variant-numeric: tabular-nums; }

/* ---------- Landing ---------- */
.site { min-height: 100%; display: flex; flex-direction: column; }
.wrap { width: 100%; max-width: 1180px; margin: 0 auto; padding-inline: 20px; }
.site-nav { position: sticky; top: 0; z-index: 10; background: color-mix(in srgb, var(--bg) 82%, transparent); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); border-bottom: 1px solid transparent; transition: border-color .2s; }
.site-nav.scrolled { border-bottom-color: var(--border); }
.site-nav .wrap { display: flex; align-items: center; gap: 8px; min-height: 64px; }
.site-nav .spacer { flex: 1; }
.nav-links { display: flex; gap: 2px; margin-left: 24px; }
.nav-links a { color: var(--text-dim); text-decoration: none; font-size: .92rem; font-weight: 550; padding: 8px 12px; border-radius: 8px; }
.nav-links a:hover { color: var(--text); background: var(--surface-2); }
@media (max-width: 760px) { .nav-links { display: none; } }
@media (max-width: 420px) { .site-nav a.button.ghost { display: none; } }

.hero {
  position: relative;
  background:
    linear-gradient(var(--grid-line) 1px, transparent 1px) 0 0 / 100% 36px,
    radial-gradient(900px 480px at 85% 10%, var(--accent-soft), transparent 70%);
  border-bottom: 1px solid var(--border);
}
.hero .wrap { display: grid; gap: 48px; align-items: center; padding-block: 72px 88px; grid-template-columns: minmax(0, 1fr); }
@media (min-width: 980px) { .hero .wrap { grid-template-columns: minmax(0, 1fr) minmax(0, 1.02fr); padding-block: 96px 112px; } }
.eyebrow { display: inline-flex; align-items: center; gap: 10px; font-size: .78rem; font-weight: 650; text-transform: uppercase; letter-spacing: .1em; color: var(--text-dim); margin-bottom: 20px; }
.eyebrow .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--tally); animation: pulse 1.6s infinite; }
.hero h1 {
  font-family: var(--font-display); font-weight: 750; letter-spacing: -.035em; line-height: .98;
  font-size: clamp(2.6rem, 6.4vw, 4.7rem); margin: 0 0 22px;
}
.hero h1 mark { background: none; color: inherit; position: relative; white-space: nowrap; }
.hero h1 mark::after { content: ""; position: absolute; left: -.04em; right: -.04em; bottom: .02em; height: .2em; background: var(--accent); z-index: -1; border-radius: 3px; }
.hero h1 mark { z-index: 0; isolation: isolate; }
.lede { font-size: clamp(1.05rem, 1.5vw, 1.2rem); color: var(--text-dim); max-width: 34em; margin: 0 0 30px; }
.cta { display: flex; gap: 10px; flex-wrap: wrap; }
.cta a.button { min-height: 50px; padding: 12px 22px; font-size: 1rem; }
.join {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-top: 30px; padding-top: 24px;
  border-top: 1px solid var(--border); max-width: 34em;
}
.join label { margin: 0 6px 0 0; color: var(--muted); font-weight: 500; font-size: .92rem; }
.join input { width: 9.5em; text-transform: uppercase; letter-spacing: .2em; text-align: center; font-family: var(--font-mono); font-weight: 700; font-size: 1.05rem; }
.join button { min-height: 44px; }
.hero-visual { position: relative; min-width: 0; }
.hero-visual .monitor { transform: rotate(-.6deg); }
.hero-chip {
  position: absolute; z-index: 2; display: flex; align-items: center; gap: 10px;
  background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: 10px 14px;
  box-shadow: var(--shadow); font-size: .85rem;
}
.hero-chip b { font-family: var(--font-display); font-size: 1.15rem; }
.hero-chip.lat { right: -12px; bottom: -26px; }
.hero-chip.ear { left: -14px; top: -22px; }
@media (max-width: 600px) { .hero-chip { display: none; } }

.section { padding-block: 88px; border-bottom: 1px solid var(--border); }
.section-head { max-width: 40em; margin-bottom: 44px; }
.kicker { font-family: var(--font-mono); font-size: .78rem; font-weight: 600; color: var(--accent-ink); letter-spacing: .06em; margin-bottom: 12px; display: block; }
.section h2 { font-family: var(--font-display); font-size: clamp(1.9rem, 3.6vw, 2.8rem); font-weight: 720; letter-spacing: -.03em; line-height: 1.05; margin: 0 0 14px; }
.section-head p { color: var(--text-dim); font-size: 1.08rem; margin: 0; }

.steps { display: grid; gap: 16px; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); counter-reset: step; }
.step { position: relative; padding: 26px 24px 24px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); }
.step .n { font-family: var(--font-mono); font-size: .8rem; font-weight: 700; color: var(--muted); display: block; margin-bottom: 30px; }
.step h3 { font-family: var(--font-display); font-size: 1.3rem; font-weight: 700; letter-spacing: -.015em; margin: 0 0 8px; }
.step p { margin: 0; color: var(--text-dim); }
.step .art { height: 76px; margin-bottom: 18px; display: flex; align-items: flex-end; gap: 8px; }

.features { display: grid; gap: 1px; background: var(--border); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; grid-template-columns: 1fr; }
@media (min-width: 620px) { .features { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (min-width: 980px) { .features { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.feature { background: var(--surface); padding: 26px 24px; }
.feature .ico { width: 36px; height: 36px; border-radius: 10px; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent-ink); margin-bottom: 16px; }
.feature .ico svg { width: 20px; height: 20px; }
.feature h3 { font-size: 1.05rem; font-weight: 650; margin: 0 0 6px; }
.feature p { margin: 0; color: var(--text-dim); font-size: .95rem; }

.langs { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 28px; }
.lang-chip { display: inline-flex; align-items: center; gap: 8px; padding: 8px 14px 8px 8px; border: 1px solid var(--border); border-radius: 999px; background: var(--surface); font-weight: 550; font-size: .92rem; }
.lang-chip .code { font-family: var(--font-mono); font-size: .72rem; font-weight: 700; background: var(--surface-3); color: var(--text-dim); border-radius: 999px; padding: 3px 8px; }
.lang-chip.voice .code { background: var(--accent); color: var(--on-accent); }

.uses { display: grid; gap: 16px; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); }
.use { padding: 24px; border-radius: var(--radius); background: var(--surface); border: 1px solid var(--border); }
.use .where { font-family: var(--font-mono); font-size: .75rem; color: var(--muted); letter-spacing: .04em; }
.use h3 { font-family: var(--font-display); font-size: 1.25rem; font-weight: 700; margin: 10px 0 8px; letter-spacing: -.01em; }
.use p { color: var(--text-dim); margin: 0; font-size: .95rem; }

.pricing { display: grid; gap: 16px; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); align-items: stretch; }
.plan { display: flex; flex-direction: column; gap: 18px; padding: 28px; border-radius: var(--radius); background: var(--surface); border: 1px solid var(--border); }
.plan.featured { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent), var(--shadow); }
.plan-name { display: flex; align-items: center; gap: 8px; font-weight: 650; }
.plan-price { font-family: var(--font-display); font-size: 2.6rem; font-weight: 750; letter-spacing: -.03em; line-height: 1; }
.plan-price small { font-family: var(--font); font-size: .9rem; color: var(--muted); font-weight: 500; letter-spacing: 0; }
.plan ul { list-style: none; padding: 0; margin: 0; display: grid; gap: 10px; color: var(--text-dim); font-size: .95rem; }
.plan li { display: flex; gap: 10px; align-items: baseline; }
.plan li::before { content: ""; flex-shrink: 0; width: 12px; height: 3px; border-radius: 2px; background: var(--accent); transform: translateY(-.25em); }
.plan .button { margin-top: auto; }

.final { padding-block: 96px; text-align: center; background: radial-gradient(700px 300px at 50% 100%, var(--accent-soft), transparent 70%); }
.final h2 { font-family: var(--font-display); font-size: clamp(2rem, 4.4vw, 3.2rem); font-weight: 750; letter-spacing: -.03em; line-height: 1.04; margin: 0 auto 16px; max-width: 16em; }
.final p { color: var(--text-dim); margin: 0 auto 28px; max-width: 34em; font-size: 1.08rem; }
.final .cta { justify-content: center; }

.site-footer { padding-block: 32px; color: var(--muted); font-size: .88rem; margin-top: auto; }
.site-footer .wrap { display: flex; gap: 16px; flex-wrap: wrap; align-items: center; }
.site-footer .spacer { flex: 1; }
.site-footer a { color: var(--text-dim); text-decoration: none; }
.site-footer a:hover { color: var(--text); }

/* ---------- Plano e pagamentos ---------- */
.billing-now { display: flex; flex-wrap: wrap; align-items: center; gap: 16px 28px; }
.billing-now > div:first-child { flex: 1 1 220px; min-width: 0; }
.billing-plan { font-family: var(--font-display); font-size: 1.6rem; font-weight: 720; letter-spacing: -.02em; }
.billing-now .muted { margin: 4px 0 0; }
.billing-usage { flex: 1 1 220px; min-width: 0; display: grid; gap: 8px; font-size: .9rem; color: var(--muted); font-variant-numeric: tabular-nums; }
.usage-bar.wide-bar { display: block; width: 100%; height: 8px; border-radius: 4px; background: var(--surface-3); overflow: hidden; }
.usage-bar.wide-bar > span { display: block; height: 100%; width: 0; background: var(--accent); border-radius: 4px; }
#planCard .usage-bar.wide-bar { margin: -4px 0 12px; }
.billing-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin: 28px 0 14px; }
.billing-title { font-family: var(--font-display); font-size: 1.35rem; font-weight: 700; letter-spacing: -.02em; margin: 0; }
.billing-head .segmented button[aria-checked="true"] { background: var(--accent); color: var(--on-accent); }
.billing-head .segmented .tag { margin-left: 4px; }
.billing-head .segmented button[aria-checked="true"] .tag { background: rgba(23, 19, 10, .14); color: var(--on-accent); }
.plan-grid { display: grid; gap: 16px; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); align-items: stretch; }
.plan-grid .plan { box-shadow: var(--shadow); }
.plan-grid .plan-price { font-size: 2.2rem; }
.plan.current { border-color: var(--border-strong); }
.plan > button { margin-top: auto; width: 100%; }
.billing-note { font-size: .85rem; margin: 14px 0 20px; }
.feature-list { list-style: none; padding: 0; margin: 10px 0 12px; display: grid; gap: 6px; color: var(--text-dim); font-size: .92rem; }
.feature-list li { display: flex; gap: 10px; align-items: baseline; }
.feature-list li::before { content: ""; flex-shrink: 0; width: 10px; height: 3px; border-radius: 2px; background: var(--accent); transform: translateY(-.25em); }
.pass-info p { margin: 0 0 8px; }

/* Público: aviso temporário e marca nos planos sem marca própria */
.viewer-notice {
  position: fixed; left: 16px; right: 16px; top: max(110px, calc(env(safe-area-inset-top) + 100px)); z-index: 6;
  margin: 0 auto; max-width: 480px; padding: 12px 16px; border-radius: 12px;
  background: var(--surface-2); border: 1px solid var(--border); color: var(--text); font-size: .95rem;
  box-shadow: 0 10px 30px rgba(0, 0, 0, .35);
}
.powered {
  position: fixed; right: 12px; bottom: max(12px, env(safe-area-inset-bottom)); z-index: 4;
  font-size: .75rem; color: var(--muted); text-decoration: none;
  background: var(--surface); border: 1px solid var(--border); border-radius: 999px; padding: 4px 10px;
}
.powered b { color: var(--text); font-weight: 700; letter-spacing: .02em; }
@media (min-width: 1100px) { .pricing.pricing-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); } }

/* ---------- Páginas legais e FAQ ---------- */
.legal { max-width: 820px; padding-block: 48px 80px; }
.legal-head { margin-bottom: 32px; }
.legal-head h1 { font-family: var(--font-display); font-size: clamp(2rem, 5vw, 3rem); font-weight: 750; letter-spacing: -.03em; line-height: 1.05; margin: 0 0 8px; }
.legal-head .muted { margin: 0 0 20px; }
.legal-tabs { display: flex; flex-wrap: wrap; gap: 6px; }
.legal-tabs a { padding: 7px 14px; border-radius: 999px; border: 1px solid var(--border); color: var(--text-dim); text-decoration: none; font-size: .9rem; font-weight: 550; }
.legal-tabs a:hover { background: var(--surface-2); color: var(--text); }
.legal-tabs a[aria-current="page"] { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.legal section { margin-top: 36px; }
.legal h2 { font-family: var(--font-display); font-size: 1.35rem; font-weight: 700; letter-spacing: -.015em; margin: 0 0 12px; }
.legal h3 { font-size: 1rem; font-weight: 650; margin: 20px 0 6px; }
.legal p, .legal li { color: var(--text-dim); line-height: 1.7; max-width: 68ch; }
.legal p b, .legal li b { color: var(--text); }
.legal ul { padding-left: 1.2em; display: grid; gap: 6px; }
.legal .table-wrap { margin: 12px 0; border: 1px solid var(--border); border-radius: 12px; }
.legal .table td, .legal .table th { color: var(--text-dim); }
.legal .table td:first-child { color: var(--text); font-weight: 550; }
.legal-summary { background: var(--surface); border: 1px solid var(--border); border-left: 4px solid var(--accent); border-radius: 12px; padding: 18px 22px; }
.legal-summary h2 { font-size: 1.05rem; margin-bottom: 8px; }
.legal-summary ul { margin: 0; }
.callout { background: var(--warn-bg); border: 1px solid color-mix(in srgb, var(--paused) 40%, transparent); border-radius: 12px; padding: 14px 18px; }
mark.todo { background: var(--warn-bg); color: var(--paused); border-radius: 4px; padding: 0 4px; font-weight: 650; }
.faq details { border-bottom: 1px solid var(--border); padding: 4px 0; }
.faq details:first-of-type { border-top: 1px solid var(--border); }
.faq summary { cursor: pointer; list-style: none; padding: 14px 32px 14px 0; font-weight: 650; position: relative; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; position: absolute; right: 4px; top: 10px; font-size: 1.4rem; color: var(--accent-ink); font-weight: 400; transition: transform .2s; }
.faq details[open] summary::after { transform: rotate(45deg); }
.faq summary:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 6px; }
.faq details p { margin: 0 0 16px; }
.site-footer .wrap { row-gap: 8px; }
.legal-links { display: flex; gap: 14px; flex-wrap: wrap; justify-content: center; font-size: .85rem; }
.legal-links a { color: var(--muted); }
.consent { display: flex; gap: 10px; align-items: flex-start; font-size: .88rem; color: var(--text-dim); font-weight: 400; margin: 4px 0 14px; }
.consent input { margin-top: 2px; flex-shrink: 0; }
.setting-note { margin: 0; font-size: .8rem; color: var(--muted); line-height: 1.5; }
.setting-note a { color: var(--text-dim); }

/* ---------- Administração: receitas ---------- */
.admin-tabs { margin-bottom: 16px; }
.tab-badge { display: inline-grid; place-items: center; min-width: 20px; height: 20px; padding: 0 6px; margin-left: 6px; border-radius: 10px; background: var(--tally); color: #fff; font-size: .72rem; font-weight: 700; font-variant-numeric: tabular-nums; }
.stat .tile-sub { min-height: 1.2em; }
.rev-head { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 12px; }
.rev-head .spacer { flex: 1; }
.chart-legend { display: flex; gap: 16px; flex-wrap: wrap; font-size: .85rem; color: var(--text-dim); margin: 0 0 8px; }
.chart-legend span { display: inline-flex; align-items: center; gap: 6px; }
.chart-legend i { width: 12px; height: 12px; border-radius: 3px; display: inline-block; }
.rev-chart { position: relative; }
.rev-chart svg { display: block; width: 100%; height: 240px; overflow: visible; }
.rev-chart .grid line { stroke: var(--border); stroke-width: 1; }
.rev-chart .grid text, .rev-chart .xlab { fill: var(--muted); font-size: 11px; font-variant-numeric: tabular-nums; }
.rev-chart .hit { fill: transparent; cursor: default; }
.rev-chart .hit:hover, .rev-chart .hit.on { fill: var(--surface-2); }
.chart-tip { position: absolute; pointer-events: none; background: var(--surface-3); border: 1px solid var(--border-strong); border-radius: 10px; padding: 8px 10px; font-size: .82rem; box-shadow: var(--shadow); white-space: nowrap; z-index: 2; }
.chart-tip b { display: block; margin-bottom: 4px; }
.chart-tip div { display: flex; align-items: center; gap: 6px; font-variant-numeric: tabular-nums; }
.chart-tip i { width: 10px; height: 10px; border-radius: 2px; display: inline-block; }
.rev-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 16px; }
.rev-grid > .card { min-width: 0; margin: 0; }
details.chart-table { margin-top: 10px; font-size: .9rem; }
details.chart-table summary { cursor: pointer; color: var(--muted); }
.amount-neg { color: var(--danger); }
.table tfoot td { font-weight: 700; border-top: 1px solid var(--border-strong); }

/* ---------- Suporte (tickets) ---------- */
.support-layout { display: grid; grid-template-columns: minmax(260px, 360px) 1fr; gap: 16px; align-items: start; }
@media (max-width: 860px) { .support-layout { grid-template-columns: 1fr; } }
.support-layout > * { min-width: 0; }
.ticket-list { display: grid; gap: 6px; }
.ticket-item { display: grid; gap: 4px; text-align: left; width: 100%; background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: 12px 14px; min-height: 0; font-weight: 400; color: var(--text); }
.ticket-item:hover:not(:disabled) { background: var(--surface-2); }
.ticket-item[aria-current="true"] { border-color: var(--accent); box-shadow: 0 0 0 2px var(--accent-soft); }
.ticket-item .t-top { display: flex; gap: 8px; align-items: center; font-size: .78rem; color: var(--muted); font-variant-numeric: tabular-nums; }
.ticket-item .t-top .spacer { flex: 1; }
.ticket-item .t-subject { font-weight: 650; overflow-wrap: anywhere; }
.ticket-item .t-meta { font-size: .8rem; color: var(--muted); overflow-wrap: anywhere; }
.ticket-item.unread .t-subject::before { content: ""; display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--tally); margin-right: 6px; vertical-align: middle; }
.status-tag { display: inline-block; padding: 1px 8px; border-radius: 6px; font-size: .72rem; font-weight: 700; }
.status-tag.open { background: var(--warn-bg); color: var(--paused); }
.status-tag.answered { background: var(--good-bg); color: var(--live); }
.status-tag.closed { background: var(--surface-3); color: var(--muted); }
.prio-high { color: var(--danger); font-weight: 700; }
.thread { display: grid; gap: 12px; margin: 16px 0; }
.msg { border: 1px solid var(--border); border-radius: 12px; padding: 12px 14px; background: var(--bg-2); max-width: 760px; }
.msg.staff { border-color: color-mix(in srgb, var(--accent) 45%, var(--border)); background: var(--accent-soft); margin-left: auto; }
.msg-head { display: flex; gap: 8px; flex-wrap: wrap; font-size: .8rem; color: var(--muted); margin-bottom: 6px; }
.msg-head b { color: var(--text); }
.msg-body { white-space: pre-wrap; overflow-wrap: anywhere; line-height: 1.55; }
.msg-files { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 10px; }
.msg-files a { display: inline-flex; flex-direction: column; gap: 4px; font-size: .78rem; color: var(--text-dim); text-decoration: none; max-width: 160px; overflow-wrap: anywhere; }
.msg-files img { width: 160px; height: 100px; object-fit: cover; border-radius: 8px; border: 1px solid var(--border); background: var(--surface); }
.msg-files .file-chip { padding: 8px 10px; border: 1px solid var(--border); border-radius: 8px; background: var(--surface); }
.reply-box textarea, .new-ticket textarea { font-family: var(--font); font-size: .95rem; min-height: 120px; }
.attach-row { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin: 8px 0 12px; font-size: .85rem; }
.attach-row .chip { display: inline-flex; gap: 6px; align-items: center; padding: 2px 4px 2px 10px; border: 1px solid var(--border); border-radius: 8px; background: var(--surface-2); max-width: 100%; overflow-wrap: anywhere; }
.attach-row .chip button { min-height: 26px; padding: 0 8px; }
.ticket-detail-head { display: flex; gap: 10px; align-items: flex-start; flex-wrap: wrap; }
.ticket-detail-head h2 { flex: 1; min-width: 200px; overflow-wrap: anywhere; }
.ticket-facts { display: flex; gap: 6px 16px; flex-wrap: wrap; font-size: .85rem; color: var(--muted); }
.ticket-facts b { color: var(--text-dim); font-weight: 600; }
.empty-state { text-align: center; padding: 32px 16px; color: var(--muted); }
#supFilter button[aria-checked="true"] { background: var(--accent); color: var(--on-accent); }
label.button { cursor: pointer; font-weight: 550; }
label.button:has(+ input:focus-visible) { outline: 2px solid var(--accent); outline-offset: 2px; }
#supFilter { display: flex; width: 100%; }
#supFilter button { flex: 1 1 auto; padding: 6px 8px; font-size: .85rem; }
.visually-hidden { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
