/* =====================================================================
   Cronos — estilos baseados nas Human Interface Guidelines (Apple)
   Clareza · Deferência · Profundidade
   - cores semânticas do sistema, claro/escuro automáticos
   - tipografia do sistema com escala (Dynamic Type via rem)
   - alvos de toque >= 44 px, grade de 8 px, áreas seguras (notch)
   - foco visível, contraste AA, prefers-reduced-motion / contrast
   ===================================================================== */

:root {
  /* tema: "light dark" segue o sistema; o atributo data-tema (claro | escuro), definido por js/tema.js a partir da
     escolha do usuário, força um dos dois. Cada token usa light-dark(claro, escuro). */
  color-scheme: light dark;

  /* superfícies */
  --bg: light-dark(#ffffff, #282a36);                       /* escuro = tema Dracula (draculatheme.com) */
  --bg-grouped: light-dark(#f2f2f7, #21222c);
  --surface: light-dark(#ffffff, #343746);
  --surface-2: light-dark(#f2f2f7, #44475a);                 /* Dracula "current line" */
  --material: light-dark(rgba(255, 255, 255, 0.78), rgba(52, 55, 70, 0.82));

  /* texto */
  --label: light-dark(#000000, #f8f8f2);                     /* Dracula "foreground" */
  --label-2: light-dark(rgba(60, 60, 67, 0.72), rgba(248, 248, 242, 0.72));
  --label-3: light-dark(rgba(60, 60, 67, 0.45), rgba(248, 248, 242, 0.45));
  --separator: light-dark(rgba(60, 60, 67, 0.22), rgba(98, 114, 164, 0.5));   /* Dracula "comment" */
  --fill: light-dark(rgba(120, 120, 128, 0.12), rgba(98, 114, 164, 0.24));
  --fill-2: light-dark(rgba(120, 120, 128, 0.2), rgba(98, 114, 164, 0.38));

  /* cores de ação (accent = fundo de botão; accent-ink = texto sobre ele; accent-text = cor de texto sobre a superfície).
     A tela de cronômetro de cada congregação sobrescreve estas quatro com a cor escolhida no cadastro. */
  --accent: light-dark(#0071e3, #bd93f9);                    /* Dracula "purple" */
  --accent-ink: light-dark(#ffffff, #282a36);
  --accent-text: light-dark(#0066cc, #bd93f9);
  --accent-tint: light-dark(rgba(0, 113, 227, 0.12), rgba(189, 147, 249, 0.2));
  --green: light-dark(#248a3d, #50fa7b);
  --green-tint: light-dark(rgba(52, 199, 89, 0.2), rgba(80, 250, 123, 0.2));
  --orange: light-dark(#b25000, #ffb86c);
  --orange-tint: light-dark(rgba(255, 149, 0, 0.2), rgba(255, 184, 108, 0.2));
  --red: light-dark(#d70015, #ff5555);
  --red-tint: light-dark(rgba(255, 59, 48, 0.14), rgba(255, 85, 85, 0.2));
  --red-fill: #d70015;

  --radius: 12px;
  --radius-sm: 10px;
  --tap: 44px;
  --shadow: 0 1px 2px light-dark(rgba(0, 0, 0, 0.06), transparent), 0 8px 28px light-dark(rgba(0, 0, 0, 0.1), rgba(0, 0, 0, 0.6));

  --font: -apple-system, BlinkMacSystemFont, "SF Pro Text", "SF Pro Display", "Segoe UI Variable Text", "Segoe UI", system-ui, Roboto, "Helvetica Neue", sans-serif;
  --font-rounded: ui-rounded, "SF Pro Rounded", -apple-system, BlinkMacSystemFont, "Segoe UI Variable Display", "Segoe UI", system-ui, sans-serif;

  --safe-t: env(safe-area-inset-top, 0px);
  --safe-r: env(safe-area-inset-right, 0px);
  --safe-b: env(safe-area-inset-bottom, 0px);
  --safe-l: env(safe-area-inset-left, 0px);
}
:root[data-tema="claro"]  { color-scheme: light; }
:root[data-tema="escuro"] { color-scheme: dark; }

@media (prefers-contrast: more) {
  :root { --separator: currentColor; --label-2: var(--label); }
}

/* ---------- base ---------- */
*, *::before, *::after { box-sizing: border-box; }

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  -webkit-tap-highlight-color: transparent;
}

body {
  margin: 0;
  min-height: 100vh;
  min-height: 100dvh;
  background: var(--bg-grouped);
  color: var(--label);
  font-family: var(--font);
  font-size: 1.0625rem;          /* 17 pt: tamanho de corpo da HIG */
  line-height: 1.4;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

h1, h2, h3, p { margin: 0; }
[hidden] { display: none !important; }
a { color: var(--accent-text); text-decoration: none; }
a:hover { text-decoration: underline; }
button, input, textarea { font: inherit; color: inherit; }
button { touch-action: manipulation; }
code { font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace; font-size: .9em; background: var(--fill); padding: .1rem .35rem; border-radius: 6px; }

/* foco visível para teclado (nunca remover sem substituto) */
:focus-visible { outline: 3px solid var(--accent-text); outline-offset: 2px; border-radius: 6px; }
input:focus-visible, textarea:focus-visible { outline-offset: 0; }
/* o Blazor move o foco para o h1 ao navegar (leitores de tela); não é um controle, então sem anel */
h1:focus, [tabindex="-1"]:focus { outline: none; }

.sr-only {
  position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
.skip-link {
  position: absolute; left: .5rem; top: -4rem; z-index: 100;
  background: var(--surface); color: var(--accent-text);
  padding: .6rem 1rem; border-radius: var(--radius-sm); box-shadow: var(--shadow);
}
.skip-link:focus { top: calc(.5rem + var(--safe-t)); text-decoration: none; }

/* ---------- escala tipográfica ---------- */
.large-title { font-size: 2.125rem; line-height: 1.2; font-weight: 700; letter-spacing: .01em; }
.title { font-size: 1.75rem; line-height: 1.2; font-weight: 700; }
.headline { font-size: 1.0625rem; font-weight: 600; }
.subhead { font-size: .9375rem; }
.footnote { font-size: .8125rem; line-height: 1.35; }
.secondary { color: var(--label-2); }
.center { text-align: center; }

/* Página /tutorial (pública) */
.tutorial-video {
    display: block;
    width: 100%;
    max-height: 70vh;
    margin-block: 1rem;
    border-radius: 12px;
    background: #000;
}
.spacer { flex: 1; }

/* ---------- estrutura ---------- */
.container {
  width: 100%;
  max-width: 640px;
  margin: 0 auto;
  padding: 1rem max(1rem, var(--safe-r)) calc(3rem + var(--safe-b)) max(1rem, var(--safe-l));
}
.container.wide { max-width: 960px; }
.page-head { margin: .5rem 0 1.25rem; }
.page-head p { margin-top: .25rem; }

.center-screen {
  min-height: 100dvh;
  display: flex; flex-direction: column; justify-content: center;
}

/* barra de navegação translúcida (profundidade) */
.navbar {
  position: sticky; top: 0; z-index: 20;
  background: var(--material);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  backdrop-filter: saturate(180%) blur(20px);
  border-bottom: .5px solid var(--separator);
  padding-top: var(--safe-t);
}
.navbar-inner {
  display: flex; align-items: center; gap: .5rem;
  min-height: 52px;
  max-width: 960px; margin: 0 auto;
  padding: 0 max(1rem, var(--safe-r)) 0 max(1rem, var(--safe-l));
}
.brand { display: inline-flex; align-items: center; gap: .5rem; font-weight: 600; }
.brand .icon { color: var(--accent-text); }

/* ---------- ícones ---------- */
.icon { flex: none; vertical-align: -0.2em; }
.icon-badge {
  display: inline-grid; place-items: center; flex: none;
  width: 2rem; height: 2rem; border-radius: 8px; color: var(--accent-ink); background: var(--accent);
}
.icon-badge.green, .icon-badge.orange, .icon-badge.gray { color: #fff; }   /* fundos fixos escuros: texto branco nos dois temas */
.icon-badge.green { background: #248a3d; }
.icon-badge.orange { background: #b25000; }
.icon-badge.gray { background: #636366; }
.app-icon {
  display: grid; place-items: center; width: 5rem; height: 5rem; margin: 0 auto 1rem;
  border-radius: 22%; color: #fff;
  background: linear-gradient(160deg, #3a96ff, #0058c2);
  box-shadow: 0 6px 18px rgba(0, 88, 194, .35);
}

/* ---------- grupos inset (listas e formulários) ---------- */
.group-header {
  margin: 1.5rem 1rem .4rem;
  font-size: .8125rem; font-weight: 400; letter-spacing: .02em;
  text-transform: uppercase; color: var(--label-2);
}
.group-footer { margin: .5rem 1rem 0; font-size: .8125rem; color: var(--label-2); }

.group {
  list-style: none; margin: 0; padding: 0;
  background: var(--surface);
  border-radius: var(--radius);
  overflow: hidden;
}
.cell {
  position: relative;
  display: flex; align-items: center; flex-wrap: wrap; gap: .25rem .75rem;
  min-height: var(--tap);
  padding: .65rem 1rem;
  width: 100%;
  background: none; border: 0; text-align: left;
}
.cell + .cell::before {          /* separador inset, como em UITableView */
  content: ""; position: absolute; top: 0; left: 1rem; right: 0;
  border-top: .5px solid var(--separator);
}
.cell-main { flex: 1 1 11rem; min-width: 0; }
label.cell-main > .cell-title, label.cell-main > .cell-sub { display: block; }   /* título e subtítulo em linhas separadas dentro de <label> */
.cell-main.wide { flex-basis: 16rem; }
.cell-actions { display: flex; align-items: center; gap: .25rem; margin-left: auto; }
.cell-title { font-weight: 500; overflow-wrap: anywhere; }
.cell-sub { font-size: .9375rem; color: var(--label-2); }
.cell-button { cursor: pointer; flex-wrap: nowrap; }
.cell-button:hover { background: var(--fill); }
.cell-button:active { background: var(--fill-2); }
.cell .chevron { color: var(--label-3); }
.cell.off .cell-title { color: var(--label-2); }

.cell.field { flex-wrap: nowrap; flex-direction: column; align-items: stretch; gap: .1rem; padding-top: .55rem; padding-bottom: .55rem; }
.cell.field label { font-size: .8125rem; color: var(--label-2); }
.cell.field input, .cell.field textarea {
  border: 0; background: transparent; padding: .25rem 0; min-height: 28px; width: 100%;
}
.cell.field input:focus-visible, .cell.field textarea:focus-visible { outline: none; }
.cell.field:focus-within { background: var(--fill); }
.cell.field textarea { resize: vertical; min-height: 4.5rem; }
.cell.row-between { justify-content: space-between; }

::placeholder { color: var(--label-3); opacity: 1; }

/* campo avulso (login) */
.input {
  width: 100%; min-height: 50px;
  padding: .75rem 1rem;
  background: var(--surface); color: var(--label);
  border: 1px solid transparent; border-radius: var(--radius);
}
.input:focus-visible { outline: 3px solid var(--accent-text); outline-offset: 0; }
.input.big { font-size: 1.5rem; text-align: center; letter-spacing: .12em; font-variant-numeric: tabular-nums; }
.stack { display: grid; gap: .75rem; }
.field-label { display: block; margin: 0 1rem .4rem; font-size: .8125rem; text-transform: uppercase; letter-spacing: .02em; color: var(--label-2); }

/* ---------- botões ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .4rem;
  min-height: var(--tap); padding: .5rem 1.1rem;
  font-weight: 600; line-height: 1.2; text-align: center; text-decoration: none;
  color: var(--accent-text); background: transparent;
  border: 0; border-radius: var(--radius);
  cursor: pointer;
  transition: opacity .15s ease, background-color .15s ease;
}
.btn:hover:not(:disabled) { text-decoration: none; background: var(--fill); }
.btn:active:not(:disabled) { opacity: .6; }
.btn:disabled { opacity: .35; cursor: not-allowed; }
.btn.primary { background: var(--accent); color: var(--accent-ink); }
.btn.primary:hover:not(:disabled) { filter: brightness(1.1); }
.btn.tinted { background: var(--accent-tint); color: var(--accent-text); }
.btn.tinted:hover:not(:disabled) { background: var(--accent-tint); filter: brightness(.95); }
.btn.destructive { background: var(--red-fill); color: #fff; }
.btn.destructive:hover:not(:disabled) { background: #bf0013; }
.btn.plain-destructive { color: var(--red); }
.btn.large { min-height: 50px; font-size: 1.0625rem; width: 100%; }
.btn.small { min-height: var(--tap); padding: .25rem .75rem; font-size: .9375rem; }
.btn-row { display: flex; gap: .5rem; flex-wrap: wrap; margin-top: 1rem; }
.btn-row .btn.grow { flex: 1; }

/* ---------- switch (UISwitch) ---------- */
input.switch {
  appearance: none; -webkit-appearance: none; flex: none;
  position: relative; width: 51px; height: 31px; margin: 0;
  background: var(--fill-2); border-radius: 999px;
  cursor: pointer; transition: background-color .2s ease;
}
input.switch::after {
  content: ""; position: absolute; top: 2px; left: 2px;
  width: 27px; height: 27px; border-radius: 50%; background: #fff;
  box-shadow: 0 2px 4px rgba(0, 0, 0, .3);
  transition: transform .2s ease;
}
input.switch:checked { background: #34c759; }
input.switch:checked::after { transform: translateX(20px); }
input.switch:focus-visible { outline: 3px solid var(--accent-text); outline-offset: 2px; border-radius: 999px; }
/* área de toque de 44 px sem aumentar o desenho */
.switch-wrap { position: relative; display: inline-flex; align-items: center; min-height: var(--tap); min-width: var(--tap); justify-content: center; }

/* ---------- controle segmentado ---------- */
.segmented {
  display: flex; gap: 2px; padding: 2px;
  background: var(--fill); border-radius: 9px;
}
.segmented a, .segmented button {
  flex: 1; display: flex; align-items: center; justify-content: center;
  min-height: 40px; padding: .35rem .75rem;
  font-size: .9375rem; font-weight: 500; text-align: center;
  color: var(--label); border: 0; border-radius: 7px; background: transparent; text-decoration: none;
}
.segmented a:hover { text-decoration: none; }
.segmented a.active, .segmented a[aria-current="true"], .segmented button.active {
  background: light-dark(#ffffff, #44475a); font-weight: 600;
  box-shadow: 0 1px 3px rgba(0, 0, 0, .15), 0 0 0 .5px rgba(0, 0, 0, .04);
}
.segmented-wrap { margin: 0 0 1rem; }

/* ---------- avisos ---------- */
.banner {
  display: flex; align-items: flex-start; gap: .6rem;
  margin: .75rem 0; padding: .75rem 1rem;
  border-radius: var(--radius); font-size: .9375rem; line-height: 1.35;
}
.banner .icon { margin-top: .1rem; }
.banner.error { background: var(--red-tint); color: var(--red); }
.banner.info { background: var(--accent-tint); color: var(--accent-text); }
.banner.success { background: var(--green-tint); color: var(--green); }
.banner.error span, .banner.info span, .banner.success span { color: var(--label); }

.pill {
  display: inline-flex; align-items: center; gap: .35rem;
  padding: .2rem .65rem; border-radius: 999px;
  background: var(--fill); font-size: .8125rem; font-weight: 500; color: var(--label-2);
  white-space: nowrap;
}
.tag { padding: .1rem .5rem; border-radius: 6px; background: var(--accent-tint); color: var(--accent-text); font-size: .75rem; font-weight: 600; }

.empty { text-align: center; padding: 2rem 1rem; color: var(--label-2); }
.empty .icon { color: var(--label-3); margin-bottom: .5rem; }
.empty .btn { margin-top: 1rem; }

.loading { padding: 1rem; color: var(--label-2); }

/* ---------- alerta / sheet de confirmação ---------- */
.sheet-backdrop {
  position: fixed; inset: 0; z-index: 100;
  display: grid; place-items: center;
  padding: 1rem;
  background: rgba(0, 0, 0, .4);
  animation: fade .2s ease;
}
.sheet {
  width: min(100%, 320px);
  padding: 1.25rem 1rem 1rem;
  background: var(--surface); border-radius: 14px;
  box-shadow: var(--shadow); text-align: center;
  animation: pop .22s ease;
}
.sheet h2 { font-size: 1.0625rem; font-weight: 600; margin-bottom: .35rem; }
.sheet p { font-size: .9375rem; color: var(--label-2); }
.sheet-actions { display: grid; gap: .5rem; margin-top: 1rem; }
dialog.sheet {
  border: 0; color: var(--label); margin: auto;
}
dialog.sheet::backdrop { background: rgba(0, 0, 0, .4); }

/* ---------- telas cheias (menu e aviso): <dialog> modal que ocupa toda a janela ----------
   Cabeçalho no padrão iOS; conteúdo centralizado com largura confortável; áreas seguras respeitadas. */
dialog.sheet.full {
  position: fixed; inset: 0; margin: 0;
  width: 100%; max-width: none; height: 100%; max-height: none;
  padding: 0; border-radius: 0; box-shadow: none; text-align: left;
  background: var(--bg-grouped);
  animation: sheet-up .25s ease;
}
dialog.sheet.full[open] { display: flex; flex-direction: column; }
dialog.sheet.full::backdrop { background: transparent; }
.full-form { display: flex; flex-direction: column; flex: 1; min-height: 0; }
.full-head {
  flex: none; display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: .5rem;
  min-height: 56px;
  padding: calc(.25rem + var(--safe-t)) max(.75rem, var(--safe-r)) .25rem max(.75rem, var(--safe-l));
  background: var(--material);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  backdrop-filter: saturate(180%) blur(20px);
  border-bottom: .5px solid var(--separator);
}
.full-head h2 { margin: 0; text-align: center; font-size: 1.0625rem; font-weight: 600; }
.full-head .full-left { justify-self: start; }
.full-head .full-right, .full-head .full-close { justify-self: end; }
.full-close {
  display: grid; place-items: center; width: var(--tap); height: var(--tap);
  color: var(--label-2); background: var(--fill); border: 0; border-radius: 50%; cursor: pointer;
}
.full-close:hover { background: var(--fill-2); color: var(--label); }
.full-body {
  flex: 1; min-height: 0; overflow: auto;
  width: 100%; max-width: 960px; margin: 0 auto;
  padding: 1rem max(1rem, var(--safe-r)) calc(1rem + var(--safe-b)) max(1rem, var(--safe-l));
  display: flex; flex-direction: column; gap: .75rem;
}
/* o corpo ROLA; os blocos não podem encolher. Sem isto, um .group (overflow: hidden) encolhia até sumir quando o conteúdo
   passava da altura da tela (ex.: o bloco dos interruptores da reunião com 9 partes, ao ligar "Nossa vida cristã com 2 partes"). */
.full-body > * { flex-shrink: 0; }
.aviso-ajuda { margin: 0; font-size: .9375rem; color: var(--label-2); }
/* Assistente da sala vazia: "1 de 2" ao lado do título e a lista dos tipos de reunião */
.full-head .passo { display: block; font-size: .75rem; font-weight: 400; color: var(--label-2); }
.tipo-lista .menu-item { min-height: 4rem; }
.tipo-texto { display: flex; flex-direction: column; gap: .1rem; }
/* campo do aviso com altura moderada (cerca de 3 linhas), sem tomar a tela inteira */
.aviso-campo {
  flex: none; height: 7.5rem; min-height: 5rem; max-height: 30vh; resize: vertical;
  font-size: clamp(1.125rem, 2.6vw, 1.5rem); line-height: 1.3;
  background: var(--surface);
}
/* mensagens prontas: botões que enviam com um toque */
.aviso-prontas { display: flex; flex-wrap: wrap; gap: .5rem; }
.aviso-pronta { flex: 1 1 12rem; min-height: var(--tap); }
.full-body .right { text-align: right; margin: 0; }
/* dentro das telas cheias a lista usa a superfície padrão (a regra do cronômetro pintaria o cartão com a cor do fundo) */
.timer-screen dialog.full .group { background: var(--surface); }
@keyframes sheet-up { from { opacity: 0; transform: translateY(2rem); } to { opacity: 1; transform: translateY(0); } }
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes pop { from { opacity: 0; transform: scale(.94); } to { opacity: 1; transform: scale(1); } }

/* ---------- cor de destaque (accent color) da congregação ----------
   A página define em #crono as variáveis --cong-cor / --cong-ink / --cong-texto-claro / --cong-texto-escuro (valores
   calculados no servidor a partir de uma cor #RRGGBB validada, com contraste AA). Elas substituem os tokens de destaque
   só nesta tela (e nos <dialog> dela, que herdam do #crono). */
.timer-screen[data-cor] {
  --accent: var(--cong-cor);
  --accent-ink: var(--cong-ink);
  --accent-text: light-dark(var(--cong-texto-claro), var(--cong-texto-escuro));
  --accent-tint: color-mix(in srgb, var(--cong-cor) 16%, transparent);
}

/* ---------- cronômetro ---------- */
.timer-screen {
  min-height: 100dvh;
  display: flex; flex-direction: column;
  background: var(--bg);
}
.timer-main {
  flex: 1; width: 100%; max-width: 1400px; margin: 0 auto;
  /* topo: 8 px + área segura (grade de 8 px da HIG); laterais continuam com 16 px */
  padding: calc(.5rem + var(--safe-t)) max(1rem, var(--safe-r)) calc(2rem + var(--safe-b)) max(1rem, var(--safe-l));
  display: flex; flex-direction: column; align-items: stretch; gap: .25rem;
}
/* ---------- menu popup do cronômetro ---------- */
/* itens do menu (lista agrupada, linhas grandes para a tela cheia) */
.menu-item {
  position: relative;
  display: flex; align-items: center; gap: 1rem;
  min-height: 64px; padding: .75rem 1.25rem;
  font-size: 1.25rem;
  color: var(--label); text-decoration: none;
}
.menu-item + .menu-item::before {
  content: ""; position: absolute; top: 0; left: 1.25rem; right: 0; border-top: .5px solid var(--separator);
}
.menu-item .icon { color: var(--label-2); }
.menu-item:hover, .menu-item:focus-visible { background: var(--fill); text-decoration: none; outline: none; }
.menu-item:focus-visible { box-shadow: inset 0 0 0 3px var(--accent-text); }
.menu-item:active { background: var(--fill-2); }
button.menu-item { width: 100%; background: transparent; border: 0; text-align: left; cursor: pointer; font: inherit; }

/* identificação: na coluna de 7 da faixa do topo, em 3 CHIPS divididos como início · previsto · término:
   nome da congregação (à esquerda; negrito na cor da congregação) · perfil (centro) · conectados (direita). */
.ident { container-type: inline-size; container-name: ident; min-width: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); align-items: center; gap: .5rem; }
.ident > * { justify-self: center; min-width: 0; max-width: 100%; margin: 0; }
.ident > :first-child { justify-self: start; }
.ident > :last-child { justify-self: end; }
/* mesmos chips da linha início · previsto · término (.pt-item): mesma fonte, altura e espaçamento interno */
.ident .pill, .cong {
  display: inline-flex; align-items: center; gap: .35rem;
  font-size: clamp(.875rem, 4.2cqw, 1.5rem); padding: .2rem .7rem;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.ident .pill .icon { flex: none; width: 1em; height: 1em; }
.cong {   /* chip do nome: negrito na cor da congregação (--accent-text, com contraste AA), fundo no tom da cor */
  display: block; border-radius: 999px; background: var(--accent-tint);
  font-weight: 700; color: var(--accent-text);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.pill.destaque { background: var(--accent-tint); color: var(--accent-text); }
/* coluna estreita: só o número (o texto "conectados" continua disponível para leitores de tela) */
@container ident (max-width: 26rem) {
  .online-label { position: absolute; width: 1px; height: 1px; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
}
/* na tela do cronômetro o fundo é a cor base; grupos usam a superfície secundária para continuarem visíveis */
.timer-screen .group { background: var(--surface-2); }
.display { text-align: center; padding: 0; width: 100%; container-type: inline-size; }
/* O tempo é em NEGRITO. --tempo-alvo é o tamanho desejado (+30% sobre o anterior, que era 38cqw); o tamanho final é
   o MENOR entre o alvo e o que cabe na coluna (ajustarTempo() em cronometro.js mede o texto real, inclusive HH:MM:SS
   depois de 1 h). Sem JS, o min() com 39cqw ainda garante que MM:SS em negrito caiba. */
.display { --tempo-alvo: clamp(4.55rem, 49.4cqw, 20.8rem); }
.tempo {
  font-family: var(--font-rounded);
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  font-feature-settings: "tnum" 1;
  font-size: min(var(--tempo-alvo), 39cqw);
  line-height: 1;
  /* a caixa do texto vai só da altura dos dígitos até a linha de base: sem a "folga" da fonte acima e abaixo
     (com fonte de 260 px eram ~45 px vazios em cima). Navegadores sem suporte ignoram e ficam como antes. */
  text-box: trim-both cap alphabetic;
  padding-block: .04em;
  letter-spacing: -0.01em;
  /* claro: sombra preta em 2 camadas (contato + difusa). Escuro: sombra preta não aparece no fundo escuro, então vira um halo na cor de destaque */
  text-shadow:
    0 4px 4px light-dark(rgba(0, 0, 0, .22), color-mix(in srgb, var(--accent) 55%, transparent)),
    0 14px 28px light-dark(rgba(0, 0, 0, .2), color-mix(in srgb, var(--accent) 45%, transparent));
  white-space: nowrap;
}
/* ---------- parte da reunião e tempo previsto (abaixo do tempo) ----------
   Altura fixa de 2 linhas (nome / previsto), cada uma com reticências: a linha 1 não muda de altura ao trocar de parte.
   Na janela baixa vira 1 linha (ver o bloco max-height: 420px). Passou do previsto: tempo vermelho + "+m:ss". */
.previsto { position: relative; z-index: 1; display: flex; align-items: center; justify-content: center; gap: .25rem; min-width: 0; container-type: inline-size; }
/* previsão de duração da parte, embaixo do tempo (centralizada como o tempo) */
/* embaixo do tempo, 3 colunas: [Flag] início · [Clock] previsto da parte · [Flag Fill] término previsto da reunião */
.previsto-tempo { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); align-items: center; gap: .5rem; min-width: 0; min-height: var(--tap); container-type: inline-size; }
/* cada informação é um CHIP (pílula com fundo), alinhado à esquerda, ao centro e à direita */
.pt-item {
  display: inline-flex; align-items: center; justify-content: center; gap: .35rem; min-width: 0; max-width: 100%;
  justify-self: center; padding: .2rem .7rem; border-radius: 999px; background: var(--fill);
  font-size: clamp(.875rem, 4.2cqw, 1.5rem); color: var(--label-2); font-variant-numeric: tabular-nums; white-space: nowrap;
}
.pt-item .icon { flex: none; }
.pt-ini { justify-self: start; }
.pt-fim { justify-self: end; }
.pt-fim .icon { color: var(--accent-text); }
/* coluna estreita (celular): "01:00:00 +05:12" não cabe num terço da linha e invadia os chips vizinhos.
   Ao passar do previsto o chip do meio mostra só o excedente; o previsto continua no mostrador. */
@container (max-width: 32rem) {
  .previsto-tempo.excedido .parte-prev { display: none; }
}
.pt-item { overflow: hidden; text-overflow: ellipsis; }   /* último recurso: nunca invadir o chip vizinho */
.previsto-tempo .parte-info { font-size: clamp(.875rem, 4.2cqw, 1.5rem); gap: .35rem; align-items: center; }
/* celular: 3 terços iguais deixam ~68 px por chip e o "01:00:00" do meio não cabe. Início e término ("09:00")
   ficam do tamanho do conteúdo e o chip do meio fica com o resto; chips mais justos. (Depois da regra acima.) */
@media (max-width: 575.98px) {
  .previsto-tempo { grid-template-columns: auto minmax(0, 1fr) auto; gap: .25rem; }
  .previsto-tempo .pt-item { padding-inline: .4rem; gap: .2rem; font-size: .8125rem; }
}
@media (max-width: 379.98px) {   /* 360 px ou menos: a coluna tem ~200 px para os 3 chips */
  .previsto-tempo .pt-item { padding-inline: .3rem; font-size: .75rem; }
  .previsto-tempo .pt-item .icon { width: 12px; height: 12px; }
}
[data-perfil="operador"] .previsto { min-height: var(--tap); }   /* altura igual com ou sem setas (a linha 1 não pula ao trocar de parte) */
.previsto-txt { flex: 0 1 auto; min-width: 0; display: flex; flex-direction: column; align-items: center; line-height: 1.3; }
.parte-nome { max-width: 100%; min-width: 0; font-size: clamp(.875rem, 5.5cqw, 1.25rem); font-weight: 600; color: var(--label); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
button.parte-nome { position: relative; padding: 0 .25rem; background: transparent; border: 0; font-family: inherit; color: var(--accent-text); cursor: pointer; }
button.parte-nome::after { content: ""; position: absolute; inset: -10px 0; }   /* área de toque maior sem aumentar a linha */
.parte-info { display: flex; align-items: baseline; justify-content: center; gap: .5rem; max-width: 100%; font-size: clamp(.8125rem, 4.5cqw, 1.0625rem); color: var(--label-2); font-variant-numeric: tabular-nums; white-space: nowrap; }
.parte-info { min-height: 1.3em; }
.parte-exc { color: var(--red); font-weight: 700; }
.parte-seta {
  flex: none; display: grid; place-items: center; width: var(--tap); height: var(--tap);
  background: var(--fill); color: var(--label); border: 0; border-radius: 50%; cursor: pointer;
}
.parte-seta:active { background: var(--fill-2); }
.parte-seta.ant { display: none; }                                   /* "anterior" só cabe em coluna larga (no resto, use a tela da reunião) */
@container (min-width: 15rem) { .parte-seta.ant { display: grid; } }
/* último minuto do previsto: tempo (e o "Previsto") em laranja; depois de passar vira vermelho (.excedido) */
.display.ultimo-minuto .tempo {
  color: var(--orange);
  text-shadow: 0 4px 4px color-mix(in srgb, var(--orange) 28%, transparent), 0 14px 28px color-mix(in srgb, var(--orange) 24%, transparent);
}
.previsto-tempo.ultimo-minuto .parte-prev { color: var(--orange); font-weight: 700; }
.display.excedido .tempo {
  color: var(--red);
  text-shadow: 0 4px 4px color-mix(in srgb, var(--red) 28%, transparent), 0 14px 28px color-mix(in srgb, var(--red) 24%, transparent);
}

/* terceiro anel: trecho real de cada parte e o nome abreviado */
.g-tempo { fill: none; stroke-width: 5; }
.g-tempo.azul { stroke: #0a64c8; }
.g-tempo.laranja { stroke: #b25000; }
.g-tempo.vinho { stroke: #8e1b3a; }
.g-tempo.neutro { stroke: var(--fill-2); }
.g-tempo-txt { fill: var(--label); font-size: 8.5px; font-weight: 700; dominant-baseline: central; }   /* text-anchor vem do JS (texto no raio) */
.ctrl.hora { position: relative; }
.ctrl.hora.tem::after {   /* ponto: a hora de início já foi definida */
  content: ""; position: absolute; top: .55rem; right: .55rem; width: .65rem; height: .65rem;
  border-radius: 50%; background: var(--green); box-shadow: 0 0 0 2px var(--bg);
}
/* operador tem 7 botões: encolhem um pouco mais com a largura (em celular, mín. 44 px) para a barra continuar numa linha só */
[data-perfil="operador"] .ctrl { width: clamp(2.75rem, 10vw, 5.5rem); height: clamp(2.75rem, 10vw, 5.5rem); }
@media (max-width: 440px) {
  /* celular: os botões da barra ficam só com o ícone (o nome continua para o leitor de tela) */
  .ctrl > span { position: absolute; width: 1px; height: 1px; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
  /* botões numa linha só, sem perder o alvo de 44 px: sem espaço entre eles, o tamanho acompanha a largura */
  [data-perfil="operador"] .timer-main { padding-left: max(.25rem, var(--safe-l)); padding-right: max(.25rem, var(--safe-r)); }
  /* dividem a largura REAL da barra em partes iguais (sem quebrar linha), redondos, até 52 px; em 360 px dá 44 px */
  [data-perfil="operador"] .controls { gap: 0; flex-wrap: nowrap; }
  [data-perfil="operador"] .ctrl { flex: 1 1 0; min-width: 0; max-width: 3.25rem; width: auto; height: auto; aspect-ratio: 1; font-size: .6875rem; }
}


/* ---------- visão em anel: gauge das partes (cores da timeline) + anel de progresso exterior ---------- */
/* na coluna de status, abaixo da seleção de reunião (o atributo hidden esconde na visão em barra) */
.gauge { position: relative; container-type: inline-size; width: 100%; max-width: clamp(6rem, 30vh, 14rem); aspect-ratio: 1; margin: .25rem auto 0; }
.gauge-svg { display: block; width: 100%; height: 100%; overflow: visible; }
.g-seg { fill: none; stroke-width: 22; }                      /* arcos das partes: mesma ordem e cores da timeline */
.g-seg.azul { stroke: #0a64c8; }
.g-seg.laranja { stroke: #b25000; }
.g-seg.vinho { stroke: #8e1b3a; }
.g-seg.neutro { stroke: var(--fill-2); }
.g-seg.feito { opacity: .45; }                                /* sessões já passadas (introdução e conclusão nunca) */
/* progresso em fatias (mesma função da barra): traços apagados no tom de fundo, acesos na cor de destaque */
.g-tick { stroke: var(--fill-2); stroke-width: 1.3; }
.g-tick.m5 { stroke-width: 1.9; }
.g-tick.m10 { stroke-width: 2.6; }
.g-tick.on { stroke: var(--accent); }
.g-ticks.atrasada .g-tick.on { stroke: var(--red); }
.g-marca { stroke: var(--label); stroke-width: 3.5; stroke-linecap: round; }   /* início e término previstos da parte atual (independem da barra) */
.g-marca.ini { stroke-dasharray: 4 3; }                        /* início: tracejado; término: contínuo */
.g-faixa { fill: none; stroke: var(--label); stroke-width: 22; opacity: .22; }   /* trecho previsto da parte atual, no anel */
.gauge-centro { position: absolute; inset: 24%; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; pointer-events: none; }
.gauge-texto { font-size: clamp(.6875rem, 11cqw, 1.125rem); font-weight: 700; color: var(--label); line-height: 1.2; }
.gauge-texto.dividido { display: flex; flex-direction: column; align-items: center; gap: .1em; max-width: 100%; }
.gauge-texto .g-rotulo { font-size: .72em; font-weight: 600; color: var(--label-2); line-height: 1.15; }
.gauge-texto .g-valor { white-space: nowrap; font-variant-numeric: tabular-nums; }
.gauge-texto .g-valor.excedeu { color: var(--red-text, var(--red)); }

/* ---------- visão linear: uma linha por parte, de cima (início) para baixo (término previsto) ---------- */
/* Cada linha tem 2 colunas (9 | 3): a parte (nome · previsto · real, nas cores dos blocos) | a diferença do tempo ("+MM:SS"
   excedido em vermelho, "−MM:SS" não utilizado). As linhas formam uma pilha: cada uma cresce na proporção dos minutos
   (flex-grow), mas nunca fica abaixo da ALTURA MÍNIMA de uma linha de texto. */
.reta { margin-top: .25rem; }
.reta-partes { display: flex; flex-direction: column; min-height: clamp(12rem, 42vh, 26rem); }   /* espaço para as linhas longas continuarem maiores mesmo com a altura mínima */
/* 4 colunas: início · parte (nome · previsto · real) · término · diferença. Os horários previstos (sem contagem) ficam
   em tom mais fraco e em itálico (.prevista); os reais, na cor do texto. */
.r-linha {
  flex: 1 1 0; min-height: 1.5rem;          /* altura mínima da linha: cabe uma linha de texto com folga */
  display: grid; grid-template-columns: 6.6ch minmax(0, 1fr) 6.6ch 6.6ch; column-gap: .35rem;
  font-size: .75rem;
}
.r-hora { padding-top: .3rem; font-size: .75rem; line-height: 1.1; font-variant-numeric: tabular-nums; white-space: nowrap; color: var(--label); font-weight: 600; }
.r-ini { text-align: right; }
.r-hora.prevista { color: var(--label-2); font-weight: 400; font-style: italic; }
.r-linha.r-cab { flex: none; min-height: 0; padding-bottom: .2rem; color: var(--label-2); font-size: .6875rem; font-weight: 600; white-space: nowrap; }
.r-cab > span { overflow: hidden; text-overflow: ellipsis; }
.r-cab .r-fim { overflow: visible; }   /* "Término" pode avançar sobre a coluna da diferença (o "Dif." fica à direita) */
.r-cab .r-cab-parte { padding-inline: .4rem; }
.r-cab .r-dif { padding-top: 0; font-size: inherit; font-weight: inherit; }
/* coluna estreita: primeiro sai o previsto de dentro da barra, depois os horários (continuam no title da parte) */
@container (max-width: 22rem) { .r-prev { display: none; } .r-cab .r-cab-parte { font-size: 0; } .r-cab .r-cab-parte::after { content: "Parte · real"; font-size: .6875rem; } }
@container (max-width: 15rem) { .r-hora, .r-cab .r-ini, .r-cab .r-fim { display: none; } .r-linha { grid-template-columns: minmax(0, 1fr) 6.6ch; } }
.r-parte {
  min-width: 0; display: flex; align-items: flex-start; justify-content: space-between; gap: .4rem;   /* texto SEMPRE no topo */
  padding: .3rem .4rem 0; overflow: hidden;
  box-shadow: inset 0 -1px 0 var(--bg);   /* separa as partes */
  color: #fff; font-weight: 600; line-height: 1.1; white-space: nowrap;
}
/* diferença do tempo da parte: excedido em vermelho; não utilizado em cinza */
.r-dif { padding-top: .3rem; font-size: .75rem; font-weight: 700; line-height: 1.1; text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.r-dif.excedeu { color: var(--red-text, var(--red)); }
.r-dif.sobrou { color: var(--label-2); }
/* um único tamanho de texto para todas as partes (legível e cabe na altura mínima) */
.r-parte > span { font-size: .75rem; }
.r-nome { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.r-prev, .r-real { flex: none; font-variant-numeric: tabular-nums; }
.r-prev { opacity: .85; font-weight: 500; }
.r-real { font-weight: 700; min-width: 4.5ch; text-align: right; }   /* tempo exato da contagem da parte */
.r-parte.azul { background: #0a64c8; }
.r-parte.laranja { background: #b25000; }
.r-parte.vinho { background: #8e1b3a; }
.r-parte.neutro { background: var(--fill-2); color: var(--label); }
.r-parte.feito { opacity: .45; }
.r-parte.atual { box-shadow: inset 0 0 0 2px #fff; }
/* tocar na visão troca para a próxima: botão transparente sobre toda a coluna de status */
.visao-toque { position: absolute; inset: 0; z-index: 2; margin: 0; padding: 0; border: 0; border-radius: var(--radius); background: transparent; cursor: pointer; }
.visao-toque:hover { background: color-mix(in srgb, var(--label) 4%, transparent); }

/* ---------- mostrador simplificado: só a parte atual ----------
   Arco de 270° em filetes de 1 minuto (o último em laranja), círculo vermelho no fim e um ponteiro com o tempo corrido.
   No meio, o tempo previsto da parte. */
.simples { position: relative; container-type: inline-size; width: 100%; max-width: clamp(6rem, 30vh, 14rem); aspect-ratio: 1; margin: .25rem auto 0; }
.simples-svg { display: block; width: 100%; height: 100%; overflow: visible; }
/* filetes: cor de destaque da congregação em tom fraco; o minuto já alcançado fica com a cor cheia. O último minuto faz o
   mesmo com o laranja. (--accent já é a cor da congregação dentro de .timer-screen[data-cor].) */
.s-filete { fill: color-mix(in srgb, var(--accent) 28%, transparent); transition: fill .3s; }
.s-filete.passou { fill: var(--accent); }
.s-filete.ultimo { fill: color-mix(in srgb, var(--orange) 30%, transparent); }   /* último minuto */
.s-filete.ultimo.passou { fill: var(--orange); }
.s-fim { fill: var(--red); stroke: var(--bg); stroke-width: 2; } /* fim do tempo */
.s-ponteiro line { stroke: var(--label); stroke-width: 5; stroke-linecap: round; }
.simples.excedido .s-ponteiro line { stroke: var(--red); }       /* passou do previsto: parado no fim, vermelho */
.simples-centro { position: absolute; inset: 30% 14%; display: grid; place-items: center; pointer-events: none; }
/* MM:SS em negrito ocupa ~2,5 em; HH:MM:SS (parte de 60 min ou mais) ~3,9 em: fonte menor para caber nos 72% do centro */
.simples-centro span { font-family: var(--font-rounded); font-size: clamp(1rem, 17cqw, 3rem); font-weight: 700; font-variant-numeric: tabular-nums; color: var(--label); line-height: 1; white-space: nowrap; }
.simples-centro span.longo { font-size: clamp(.75rem, 14cqw, 2.4rem); }
.simples.ultimo-minuto .simples-centro span { color: var(--orange); }
.simples.excedido .simples-centro span { color: var(--red); }

/* ---------- visão em lista: texto monoespaçado (parte, previsto, real) ---------- */
.lista-partes {
  margin: .25rem 0 0; padding: 0; overflow: hidden; white-space: pre;
  font-family: ui-monospace, "Cascadia Mono", "SF Mono", Menlo, Consolas, monospace;
  font-size: clamp(.5625rem, 3.1cqw, 1rem); line-height: 1.4; color: var(--label); font-variant-numeric: tabular-nums;   /* ~52 colunas de texto */
}
.lista-partes .l-prevista { color: var(--label-2); font-weight: 400; font-style: italic; }   /* horário previsto (sem contagem) */
.lista-partes .l-cab { color: var(--label-2); font-weight: 600; }
.lista-partes .l-neutro { color: var(--label-2); }
.lista-partes .l-azul { color: light-dark(#0a64c8, #8be9fd); }     /* escuro: cyan, orange e pink do Dracula */
.lista-partes .l-laranja { color: light-dark(#b25000, #ffb86c); }
.lista-partes .l-vinho { color: light-dark(#8e1b3a, #ff79c6); }
.lista-partes .l-atual { font-weight: 700; }
.lista-partes .l-total { font-weight: 700; }

/* tela da reunião (lista de partes) */
.parte-lista { margin: 0; }
.parte-linha { flex-wrap: nowrap; gap: .6rem; }
.parte-ir {
  flex: none; display: grid; place-items: center; width: var(--tap); height: var(--tap);
  background: var(--fill); color: var(--label-2); border: 0; border-radius: 50%; font-weight: 600; cursor: pointer;
}
.parte-ir[aria-current="true"] { background: var(--accent); color: var(--accent-ink); }
.campo-hora { flex: none; min-height: var(--tap); padding: .35rem .65rem; background: var(--fill); color: var(--label); border: 0; border-radius: var(--radius-sm); font-size: 1.125rem; }
.parte-campo {
  flex: 1; min-width: 0; min-height: var(--tap); padding: .35rem .65rem;
  background: var(--fill); color: var(--label); border: 0; border-radius: var(--radius-sm);
}
.parte-min-wrap { flex: none; display: flex; align-items: center; gap: .35rem; color: var(--label-2); }
.parte-min { width: 4.5rem; text-align: right; }

.status-cel { position: relative; min-width: 0; min-height: 64px; display: flex; flex-direction: column; justify-content: center; container-type: inline-size; }

/* os botões encolhem com a largura da tela para a barra caber numa linha (quebra só em telas muito estreitas) */
.controls { display: flex; justify-content: center; gap: clamp(.25rem, 1.5vw, 1rem); flex-wrap: wrap; margin: 0; }
.ctrl {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: .15rem;
  width: clamp(3rem, 13.5vw, 6rem); height: clamp(3rem, 13.5vw, 6rem); border-radius: 50%; border: 0;
  font-size: clamp(.6875rem, 3vw, .9375rem); font-weight: 600; cursor: pointer;
  transition: opacity .15s ease, transform .1s ease;
}
.ctrl:active:not(:disabled) { transform: scale(.95); }
.ctrl:disabled { opacity: .35; cursor: not-allowed; }
.ctrl.play { background: var(--green-tint); color: var(--green); }
.ctrl.pause { background: var(--orange-tint); color: var(--orange); }
.ctrl.reset { background: var(--fill); color: var(--label); }
.ctrl.tool { background: var(--fill); color: var(--label); }
.ctrl.tool[aria-expanded="true"] { background: var(--fill-2); }
.ctrl.msg { position: relative; background: var(--accent-tint); color: var(--accent-text); }
.ctrl.msg.tem::after { /* ponto indica que há um aviso ativo */
  content: ""; position: absolute; top: .55rem; right: .55rem; width: .65rem; height: .65rem;
  border-radius: 50%; background: var(--orange); box-shadow: 0 0 0 2px var(--bg);
}
.ctrl:focus-visible { outline: 3px solid var(--accent-text); outline-offset: 3px; border-radius: 50%; }


/* faixa de avisos: a altura é RESERVADA para sempre (com ou sem aviso), então a linha 1 nunca se move. O aviso ocupa a faixa
   toda e o texto é ajustado por JS (ajustarAviso) para caber nela. O alerta de conexão usa o mesmo espaço, por cima. */
:root { --aviso-h: clamp(3.5rem, 8vh, 4.5rem); }   /* >= 56 px: cabe o sino (44 px) e 2 linhas de aviso */
/* a faixa usa a MESMA divisão 7 | 5 do tempo e do status: identificação | aviso + sino */
.aviso-linha {
  position: relative; flex: none; height: var(--aviso-h);
  display: grid; grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); column-gap: .5rem; align-items: center;
}
@media (min-width: 576px) {
  .aviso-linha { grid-template-columns: repeat(12, minmax(0, 1fr)); column-gap: 1rem; }
  .aviso-linha > .ident { grid-column: 1 / span 7; }
  .aviso-linha > .aviso-area { grid-column: 8 / span 5; }
}
.aviso-area { min-width: 0; height: 100%; display: flex; align-items: center; gap: .5rem; }
.aviso-slot { position: relative; flex: 1; min-width: 0; height: 100%; }
#aviso { position: absolute; inset: 0; z-index: 1; }   /* ocupa a coluna do aviso (o sino fica ao lado, sempre clicável) */
/* celular: a coluna do aviso é estreita demais. A identificação ocupa a faixa toda (menos o sino) e, enquanto aparece,
   o aviso cobre a faixa toda menos o sino. */
@media (max-width: 575.98px) {
  .aviso-linha { grid-template-columns: minmax(0, 1fr) auto; }
  .aviso-slot { position: static; flex: none; width: 0; }
  .ident { grid-template-columns: minmax(0, 2fr) minmax(0, 1fr) minmax(0, 1fr); gap: .35rem; }   /* o nome precisa de mais espaço */
  .cong, .ident .pill { padding-inline: .45rem; font-size: .8125rem; }   /* igual aos chips embaixo do tempo no celular */
  #aviso { right: calc(var(--tap) + .5rem); }
  .aviso-linha:has(#aviso:not([hidden])) > .ident { visibility: hidden; }
}
/* sino: mostra o aviso de novo; o ponto laranja indica que há um aviso escondido */
.sino {
  position: relative; flex: none; display: grid; place-items: center; width: var(--tap); height: var(--tap);
  border: 0; border-radius: 50%; background: var(--fill); color: var(--label); cursor: pointer;
}
.sino:hover:not(:disabled) { background: var(--fill-2); }
.sino:disabled { opacity: .35; cursor: default; }
.sino.tem { color: var(--orange-text, var(--orange)); }
.sino.tem::after {
  content: ""; position: absolute; top: .3rem; right: .3rem; width: .65rem; height: .65rem;
  border-radius: 50%; background: var(--orange); box-shadow: 0 0 0 2px var(--bg);
}
.aviso {
  display: flex; align-items: center; gap: .75rem;
  width: 100%; height: 100%; margin: 0; padding: 0 1.25rem; overflow: hidden;
  background: var(--surface); border-radius: var(--radius);
  box-shadow: 0 0 0 1px var(--separator);
  font-size: clamp(1.25rem, 4.5vw, 2.5rem); font-weight: 600; line-height: 1.25;
}
.aviso .icon { flex: none; color: var(--orange); }
.aviso-texto { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.aviso .close {
  flex: none; display: grid; place-items: center; width: var(--tap); height: var(--tap); margin: 0 -.5rem 0 0;
  background: transparent; border: 0; border-radius: 50%; color: var(--label-2); cursor: pointer;
}
.aviso .close:hover { background: var(--fill); }
#alerta { position: absolute; inset: 0; z-index: 2; width: 100%; max-width: none; margin: 0; display: flex; align-items: center; justify-content: center; }

/* ---------- aviso NOVO: animação para chamar a atenção ----------
   cronometro.js adiciona a classe .novo quando chega um aviso ao vivo (não ao abrir a tela) e a remove no fim.
   Entrada (desce com um "pulo") + realce em laranja com anel que pulsa 2 vezes. */
@keyframes aviso-entra {
  0%   { opacity: 0; transform: translateY(-1.25rem) scale(.96); }
  55%  { opacity: 1; transform: translateY(.2rem) scale(1.025); }
  100% { opacity: 1; transform: none; }
}
@keyframes aviso-destaque {
  0%, 100% { background: var(--surface); box-shadow: 0 0 0 1px var(--separator), 0 0 0 0 transparent; }
  25%      { background: var(--orange-tint); box-shadow: 0 0 0 2px var(--orange), 0 0 0 12px color-mix(in srgb, var(--orange) 28%, transparent); }
  60%      { background: var(--surface); box-shadow: 0 0 0 1px var(--separator), 0 0 0 0 transparent; }
  75%      { background: var(--orange-tint); box-shadow: 0 0 0 2px var(--orange), 0 0 0 8px color-mix(in srgb, var(--orange) 18%, transparent); }
}
/* só cor (sem movimento) para quem prefere menos animação */
@keyframes aviso-realce {
  0%, 100% { background: var(--surface); box-shadow: 0 0 0 1px var(--separator); }
  30%, 70% { background: var(--orange-tint); box-shadow: 0 0 0 2px var(--orange); }
}
.aviso.novo { animation: aviso-entra .55s cubic-bezier(.2, .9, .3, 1.15), aviso-destaque 1.8s ease-out .15s; }
@media (prefers-reduced-motion: reduce) {
  .aviso.novo { animation: aviso-realce 1.6s ease-out !important; }   /* vence a regra global que zera animações */
}

/* ---------- erro do Blazor ---------- */
#blazor-error-ui {
  display: none; position: fixed; left: 0; right: 0; bottom: 0; z-index: 1000;
  padding: .75rem 1.25rem calc(.75rem + var(--safe-b));
  background: var(--red-fill); color: #fff;
}
#blazor-error-ui a { color: #fff; text-decoration: underline; }
#blazor-error-ui .dismiss { position: absolute; right: .75rem; top: .6rem; cursor: pointer; }

/* ---------- responsivo ---------- */
@media (max-width: 480px) {
  .large-title { font-size: 1.875rem; }
}
@media (min-width: 720px) {
  .grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 1.5rem; align-items: start; }
}



/* ---------- grade do cronômetro: 3 linhas ----------
   Linha 1: Tempo | Status (visões do andamento), na proporção 7 | 5 (XS: 7fr | 5fr; SM em diante: 12 colunas = 7 | 5).
   Linha 2: previsão da parte (embaixo do tempo) | seletor de reunião (embaixo do status), mesma divisão.
   Linha 3: barra de ferramentas, SEMPRE nas 12 colunas (largura total), em qualquer tamanho de janela.
   A identificação e o aviso não são linhas da grade: ficam na faixa do topo (ver .aviso-linha).
   Pontos de quebra do Bootstrap. */
.timer-grid {
  display: grid; align-items: start; align-content: start;
  grid-template-columns: minmax(0, 7fr) minmax(0, 5fr);
  grid-template-rows: auto auto auto;
  column-gap: .5rem; row-gap: .3rem;
}
.timer-grid > .display        { grid-column: 1; grid-row: 1; }
.timer-grid > .status-cel     { grid-column: 2; grid-row: 1; }                    /* visões do andamento */
.timer-grid > .previsto-tempo { grid-column: 1; grid-row: 2; }                    /* linha 2, embaixo do tempo: previsão da parte */
.timer-grid > .previsto       { grid-column: 2; grid-row: 2; }                    /* linha 2, embaixo do status: seletor de reunião */
.timer-grid > .controls       { grid-column: 1 / -1; grid-row: 3; }
/* celular (XS): o tempo fica centralizado na VERTICAL da linha 1 (ao lado da visão de status, que é mais alta) */
@media (max-width: 575.98px) {
  .timer-grid > .display { align-self: center; }
}
@media (min-width: 576px) {
  .timer-grid { grid-template-columns: repeat(12, minmax(0, 1fr)); column-gap: 1rem; }
  .timer-grid > .display, .timer-grid > .previsto-tempo { grid-column: 1 / span 7; }
  .timer-grid > .status-cel, .timer-grid > .previsto    { grid-column: 8 / span 5; }
}

/* ---------- janela baixa (faixa de 240 px, ou celular na horizontal) ----------
   Mesma estrutura (2 linhas, barra em 12 colunas); só reduz tamanhos e espaçamentos para caber na altura. */
@media (max-height: 420px) {
  :root { --aviso-h: 3rem; }
  .timer-main { padding: calc(.25rem + var(--safe-t)) max(1rem, var(--safe-r)) calc(.25rem + var(--safe-b)) max(1rem, var(--safe-l)); gap: .3rem; }
  .timer-grid { row-gap: .2rem; }
  .ident { gap: .4rem; }
  .cong, .ident .pill { font-size: .875rem; }   /* na faixa baixa: mesmo tamanho dos chips início · previsto · término */
  /* sino menor que a faixa (que tem 2 a 3 rem); a área de toque continua com 44 px pelo ::before */
  .sino { width: 2rem; height: 2rem; }
  .sino::before { content: ""; position: absolute; inset: -6px; }
  .sino.tem::after { top: 0; right: 0; width: .5rem; height: .5rem; }
  .display { --tempo-alvo: clamp(3.25rem, min(44vh, 49.4cqw), 15.6rem); }   /* +30% sobre min(34vh, 38cqw) */
  /* com a linha 2 (previsão da parte / seletor de reunião) o tempo cede altura para tudo caber nos 240 px */
  .timer-screen.tem-parte .display { --tempo-alvo: clamp(2.75rem, min(32vh, 49.4cqw), 15.6rem); }
  /* visões na faixa de 240 px: mostradores pequenos, só o desenho (o texto do centro não cabe) */
  .gauge, .simples { max-width: 4.25rem; }
  .gauge-centro, .g-tempos, .simples-centro { display: none; }
  /* linear na faixa baixa: altura da linha 1, partes só com a cor (sem texto e sem altura mínima) */
  .reta-partes { min-height: 0; height: 4.5rem; }
  .r-linha { min-height: 0; }
  .r-parte { padding-block: 0; }
  .r-parte > span, .r-dif, .r-hora, .r-linha.r-cab { display: none; }
  .r-linha { grid-template-columns: minmax(0, 1fr); }
  .lista-partes { max-height: 4.5rem; font-size: .5rem; line-height: 1.2; }
  .previsto, [data-perfil="operador"] .previsto { margin-top: .1rem; margin-bottom: 0; min-height: 0; }
  .previsto-txt { flex-direction: row; align-items: baseline; justify-content: center; gap: .5rem; max-width: 100%; }
  .parte-nome { font-size: .875rem; }
  .parte-info { font-size: .8125rem; flex: none; }
  .previsto-tempo { min-height: 0; }
  .previsto-tempo .parte-info, .pt-item { font-size: .875rem; }
  .pt-item .icon { width: 14px; height: 14px; }
  .parte-seta { margin: -10px 0; }                                         /* 44 px de toque sem aumentar a altura da linha */
  .ctrl, [data-perfil="operador"] .ctrl { width: 2.75rem; height: 2.75rem; font-size: .6875rem; }   /* 44 px: mínimo de toque */
  .controls { gap: .35rem; }
  .aviso { padding: 0 .75rem; }
}

/* ---------- seletor de tema (Automático | Claro | Escuro) ---------- */
.tema-seletor { max-width: 24rem; margin: 0 auto; }
.tema-seletor button { cursor: pointer; font: inherit; }
.tema-rodape { margin: 2rem auto 0; max-width: 24rem; text-align: center; }
.tema-rodape .rotulo { margin: 0 0 .4rem; font-size: .8125rem; color: var(--label-2); }

/* ---------- seleção da cor de destaque ---------- */
.cores { display: flex; flex-wrap: wrap; align-items: center; gap: .15rem; }
.cor-op {
  display: grid; place-items: center; flex: none; width: var(--tap); height: var(--tap); padding: 0;
  background: transparent; border: 0; border-radius: 50%; cursor: pointer;
}
.cor-op > .bolinha {
  display: grid; place-items: center; width: 30px; height: 30px; border-radius: 50%;
  background: var(--c); color: var(--ink);
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .18);
  transition: box-shadow .15s ease;
}
.cor-op[aria-pressed="true"] > .bolinha { box-shadow: 0 0 0 2px var(--surface), 0 0 0 4px var(--c); }
.cor-op:focus-visible { outline: 3px solid var(--accent-text); outline-offset: 0; border-radius: 50%; }
.cor-livre { display: inline-flex; align-items: center; gap: .5rem; margin-left: .5rem; font-size: .875rem; color: var(--label-2); }
.cor-livre input[type=color] {
  width: var(--tap); height: var(--tap); padding: 2px; background: transparent; border: 0; border-radius: 50%; cursor: pointer;
}
.cor-livre input[type=color]::-webkit-color-swatch-wrapper { padding: 0; }
.cor-livre input[type=color]::-webkit-color-swatch { border: 1px solid var(--separator); border-radius: 50%; }
.cor-ponto { display: inline-block; width: .8rem; height: .8rem; margin-right: .35rem; border-radius: 50%; background: var(--c); box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .2); vertical-align: -.05em; }

/* ---------- movimento reduzido ---------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}

/* ---------- logo ---------- */
.app-logo { display: block; width: 7rem; height: 7rem; margin: 0 auto 1rem; border-radius: 22%; box-shadow: 0 6px 18px rgba(0, 0, 0, .18); }
.brand-logo { width: 1.75rem; height: 1.75rem; border-radius: 22%; }

/* ---------- janela de espera de conexão ---------- */
dialog.sheet.conexao { width: min(calc(100% - 2rem), 340px); }
dialog.sheet.conexao::backdrop { background: rgba(0, 0, 0, .55); }
.conexao-spin { position: relative; width: 3rem; height: 3rem; margin: 0 auto .75rem; }
.conexao-spin[hidden] { display: none; }
.conexao-spin span {
  position: absolute; inset: 0; border-radius: 50%;
  border: 3px solid var(--accent); opacity: 0;
  animation: conexao-onda 1.6s ease-out infinite;
}
.conexao-spin span:nth-child(2) { animation-delay: .8s; }
@keyframes conexao-onda { from { transform: scale(.3); opacity: .9; } to { transform: scale(1); opacity: 0; } }
@media (prefers-reduced-motion: reduce) { .conexao-spin span { animation: none; opacity: .5; } }
