/* Thera Fone — paleta Thera: preto #0B0B0D (noturno), dourado #C9A35F, dourado de texto no claro #76551D, IBM Plex (local).
   Direção: aparelho de mesa de central — superfícies escuras foscas, um único acento dourado, o símbolo de 3 nós da Thera
   vira a órbita da tela de chamada (o único elemento animado). Mobile first; no desktop o app vira um cartão centralizado. */
@font-face { font-family: 'IBM Plex Sans'; font-style: normal; font-weight: 300; font-display: swap; src: local('IBM Plex Sans Light'), local('IBMPlexSans-Light'), url('../fonts/ibm-plex-sans-latin-300-normal.woff2') format('woff2'); }
@font-face { font-family: 'IBM Plex Sans'; font-style: normal; font-weight: 400; font-display: swap; src: local('IBM Plex Sans'), local('IBMPlexSans'), url('../fonts/ibm-plex-sans-latin-400-normal.woff2') format('woff2'); }
@font-face { font-family: 'IBM Plex Sans'; font-style: normal; font-weight: 500; font-display: swap; src: local('IBM Plex Sans Medium'), local('IBMPlexSans-Medium'), url('../fonts/ibm-plex-sans-latin-500-normal.woff2') format('woff2'); }
@font-face { font-family: 'IBM Plex Sans'; font-style: normal; font-weight: 600; font-display: swap; src: local('IBM Plex Sans SemiBold'), local('IBMPlexSans-SemiBold'), url('../fonts/ibm-plex-sans-latin-600-normal.woff2') format('woff2'); }

:root {
  --preto: #0B0B0D; --dourado: #C9A35F; --dourado-texto: #76551D;
  --fundo: #0B0B0D; --sup: #121215; --sup2: #1A1A1F; --sup3: #24242B; --borda: #2C2C34; --borda-forte: #3A3A44;
  --texto: #EEEAE2; --suave: #A9A397; --acento: #C9A35F; --acento-txt: #C9A35F; --acento-hover: #D8B677; --sobre-acento: #0B0B0D;
  --acento-veu: rgba(201, 163, 95, .16);
  --verde: #22774A; --verde-vivo: #3DBA7A; --vermelho: #C0392E; --vermelho-txt: #F08A80; --amarelo: #E0AE2E;
  --foco: #E8C987; --sombra: 0 24px 60px rgba(0, 0, 0, .55);
  --raio: 16px; --raio-g: 28px;
  --fonte: 'IBM Plex Sans', system-ui, -apple-system, 'Segoe UI', Roboto, Arial, sans-serif;
  --tec: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  --topo-h: 56px; --abas-h: 64px;
  --sa-t: env(safe-area-inset-top, 0px); --sa-b: env(safe-area-inset-bottom, 0px);
  --sa-l: env(safe-area-inset-left, 0px); --sa-r: env(safe-area-inset-right, 0px);
  color-scheme: dark;
}
:root[data-tema="claro"] {
  --fundo: #F5F2EC; --sup: #FFFFFF; --sup2: #EFEAE0; --sup3: #E5DDCD; --borda: #DAD1C0; --borda-forte: #C4B9A4;
  --texto: #17150F; --suave: #5C564B; --acento: #C9A35F; --acento-txt: #76551D; --acento-hover: #B8914C; --sobre-acento: #0B0B0D;
  --acento-veu: rgba(201, 163, 95, .22);
  --verde: #1E7044; --verde-vivo: #17713F; --vermelho: #B8342A; --vermelho-txt: #A3281F; --amarelo: #8A6400;
  --foco: #76551D; --sombra: 0 24px 60px rgba(60, 45, 20, .14);
  color-scheme: light;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
html, body { margin: 0; height: 100%; }
body {
  background: var(--fundo); color: var(--texto); font: 400 16px/1.5 var(--fonte);
  -webkit-font-smoothing: antialiased; -webkit-tap-highlight-color: transparent; overflow: hidden;
}
[hidden] { display: none !important; }
a { color: var(--acento-txt); text-underline-offset: 3px; }
button { font: inherit; color: inherit; }
img { display: block; }
:focus-visible { outline: 3px solid var(--foco); outline-offset: 2px; }
.vis-oculto { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap; }
.pular { position: absolute; left: 12px; top: -80px; background: var(--acento); color: var(--sobre-acento); padding: 10px 14px; border-radius: 10px; z-index: 90; font-weight: 600; }
.pular:focus { top: calc(8px + var(--sa-t)); }
.tec { font-family: var(--tec); font-size: .86em; overflow-wrap: anywhere; }

/* ================================================================= casca do app */
.app {
  position: relative; display: flex; flex-direction: column; height: 100vh; height: 100dvh; width: 100%;
  background: var(--fundo); overflow: hidden; isolation: isolate;
}
.topo {
  flex: none; display: flex; align-items: center; justify-content: space-between; gap: 10px;
  min-height: calc(var(--topo-h) + var(--sa-t)); padding: var(--sa-t) calc(12px + var(--sa-r)) 0 calc(16px + var(--sa-l));
  border-bottom: 1px solid var(--borda);
}
.marca { display: flex; align-items: center; gap: 9px; min-width: 0; }
.simbolo { width: 26px; height: 26px; color: var(--acento-txt); flex: none; }
.wordmark { font-weight: 600; font-size: 1.12rem; letter-spacing: .02em; }
.produto { font-weight: 400; font-size: 1.12rem; color: var(--acento-txt); margin-left: -3px; }
.acoes-topo { display: flex; align-items: center; gap: 6px; }

.estado {
  display: inline-flex; align-items: center; gap: 7px; font-size: .82rem; font-weight: 500; line-height: 1;
  padding: 7px 11px 7px 9px; border-radius: 999px; background: var(--sup2); border: 1px solid var(--borda); white-space: nowrap;
}
.estado .ponto { width: 9px; height: 9px; border-radius: 50%; background: var(--suave); flex: none; }
.estado[data-estado="ok"] .ponto { background: var(--verde-vivo); box-shadow: 0 0 0 3px color-mix(in srgb, var(--verde-vivo) 25%, transparent); }
.estado[data-estado="conn"] .ponto { background: var(--amarelo); animation: pisca 1.1s ease-in-out infinite; }
.estado[data-estado="warn"] .ponto { background: var(--amarelo); }
.estado[data-estado="err"] .ponto { background: var(--vermelho); }
.estado[data-estado="err"] { color: var(--vermelho-txt); }
@keyframes pisca { 50% { opacity: .3; } }

button.icone {
  width: 48px; height: 48px; display: inline-grid; place-items: center; border-radius: 12px; cursor: pointer;
  background: transparent; border: 1px solid transparent; color: var(--texto);
}
button.icone:hover { background: var(--sup2); }
button.icone svg { width: 22px; height: 22px; }
:root[data-tema="claro"] .ic-sol, :root:not([data-tema="claro"]) .ic-lua { display: none; }

.palco { flex: 1; min-height: 0; display: flex; flex-direction: column; outline: none; overflow: hidden; }

/* ================================================================= login */
.login {
  flex: 1; overflow-y: auto; overscroll-behavior: contain; display: flex; flex-direction: column;
  padding: 24px calc(20px + var(--sa-r)) calc(12px + var(--sa-b)) calc(20px + var(--sa-l)); max-width: 460px; width: 100%; margin: 0 auto;
}
.login-marca { width: 52px; height: 52px; color: var(--acento-txt); margin: 0 0 14px; flex: none; }
.login-marca svg { width: 100%; height: 100%; }
h1 { font-size: 1.75rem; line-height: 1.2; font-weight: 600; margin: 0 0 8px; letter-spacing: -.01em; }
h2 { font-size: 1.15rem; font-weight: 600; margin: 0; }
h3 { font-size: .95rem; font-weight: 600; margin: 0 0 10px; color: var(--acento-txt); }
.sub { color: var(--suave); font-size: .95rem; margin: 0 0 22px; max-width: 46ch; }
.form-login { display: flex; flex-direction: column; gap: 14px; }
.campo { display: flex; flex-direction: column; gap: 6px; }
label { font-size: .9rem; font-weight: 500; }
input, select {
  width: 100%; font: inherit; color: var(--texto); background: var(--sup2); border: 1px solid var(--borda);
  border-radius: 12px; padding: 12px 14px; min-height: 52px;
}
input:hover, select:hover { border-color: var(--borda-forte); }
input:focus, select:focus { border-color: var(--acento); outline: none; box-shadow: 0 0 0 3px var(--acento-veu); }
input:focus-visible, select:focus-visible { outline: 2px solid var(--foco); outline-offset: 1px; }
#in-ramal { font-size: 1.25rem; letter-spacing: .06em; font-variant-numeric: tabular-nums; }
.senha-caixa { position: relative; }
.senha-caixa input { padding-right: 56px; }
.ver-senha {
  position: absolute; right: 2px; top: 2px; width: 48px; height: 48px; display: grid; place-items: center;
  background: none; border: 0; border-radius: 10px; color: var(--suave); cursor: pointer;
}
.ver-senha svg { width: 22px; height: 22px; }
.ver-senha[aria-pressed="false"] .risco { display: none; }
label.chk { display: flex; gap: 12px; align-items: flex-start; font-weight: 400; color: var(--suave); font-size: .9rem; min-height: 32px; cursor: pointer; }
label.chk input { width: 22px; height: 22px; min-height: 0; margin: 0; accent-color: var(--acento); flex: none; padding: 0; }
details.avancado { font-size: .9rem; border-top: 1px solid var(--borda); padding-top: 4px; }
details.avancado summary { cursor: pointer; color: var(--acento-txt); padding: 10px 0; min-height: 44px; font-weight: 500; }
details.avancado[open] summary { margin-bottom: 6px; }
.aviso { background: color-mix(in srgb, var(--amarelo) 11%, transparent); border-left: 3px solid var(--amarelo); padding: 10px 12px; border-radius: 8px; font-size: .85rem; margin: 10px 0 0; }
.erro { background: color-mix(in srgb, var(--vermelho) 14%, transparent); border-left: 3px solid var(--vermelho); padding: 10px 12px; border-radius: 8px; font-size: .92rem; margin: 0; }
.servidor { font-size: .85rem; color: var(--suave); margin: 2px 0 0; text-align: center; }
.login-rodape { margin-top: auto; padding-top: 16px; display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.link-discreto { font-size: .92rem; font-weight: 500; min-height: 48px; display: inline-flex; align-items: center; padding: 0 4px; }

.idiomas { display: inline-flex; gap: 4px; }
.bandeira {
  width: 48px; height: 48px; display: grid; place-items: center; border-radius: 12px; border: 1px solid transparent;
  background: none; cursor: pointer; opacity: .62;
}
.bandeira img { width: 26px; height: 18px; border-radius: 3px; box-shadow: 0 0 0 1px rgba(0, 0, 0, .25); }
.bandeira:hover { opacity: 1; }
.bandeira[aria-pressed="true"] { opacity: 1; border-color: var(--acento); background: var(--sup2); }

/* ================================================================= botões */
.primario, .secundario, .perigo {
  display: flex; align-items: center; justify-content: center; gap: 10px; width: 100%; min-height: 52px; border-radius: 14px;
  padding: 10px 16px; font-weight: 600; cursor: pointer; text-decoration: none; text-align: center; font-size: 1rem;
}
.primario { background: var(--acento); color: var(--sobre-acento); border: 0; }
.primario:hover { background: var(--acento-hover); }
.primario:disabled { opacity: .7; cursor: progress; }
.secundario { background: transparent; color: var(--texto); border: 1px solid var(--borda-forte); font-weight: 500; }
.secundario:hover { background: var(--sup2); }
.secundario:disabled { opacity: .6; cursor: default; }
.perigo { background: transparent; color: var(--vermelho-txt); border: 1px solid color-mix(in srgb, var(--vermelho) 60%, transparent); }
.perigo:hover { background: color-mix(in srgb, var(--vermelho) 10%, transparent); }
.texto-bt { background: none; border: 0; color: var(--acento-txt); font-weight: 500; cursor: pointer; min-height: 44px; padding: 0 8px; border-radius: 10px; }
.texto-bt:hover { background: var(--sup2); }
.giro { display: none; width: 18px; height: 18px; border-radius: 50%; border: 2px solid currentColor; border-right-color: transparent; animation: gira .8s linear infinite; }
.carregando .giro { display: inline-block; }
@keyframes gira { to { transform: rotate(1turn); } }

/* ================================================================= telefone: painéis + abas inferiores */
.fone { flex: 1; min-height: 0; display: flex; flex-direction: column; }
.paineis { flex: 1; min-height: 0; position: relative; }
.painel {
  position: absolute; inset: 0; overflow-y: auto; overscroll-behavior: contain; outline: none;
  padding: 16px calc(20px + var(--sa-r)) 20px calc(20px + var(--sa-l));
  animation: painel-entra .2s ease-out;
}
@keyframes painel-entra { from { opacity: 0; transform: translateY(6px); } }
.abas {
  flex: none; display: grid; grid-template-columns: repeat(3, 1fr); border-top: 1px solid var(--borda); background: var(--sup);
  padding: 0 var(--sa-r) var(--sa-b) var(--sa-l);
}
.abas button {
  position: relative; min-height: var(--abas-h); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
  background: none; border: 0; color: var(--suave); cursor: pointer; font-size: .78rem; font-weight: 500;
}
.abas button svg { width: 24px; height: 24px; }
.abas button[aria-selected="true"] { color: var(--acento-txt); }
.abas button[aria-selected="true"]::before { content: ''; position: absolute; top: -1px; left: 30%; right: 30%; height: 2px; background: var(--acento); border-radius: 0 0 2px 2px; }
.abas button:hover { color: var(--texto); }
.abas button[aria-selected="true"]:hover { color: var(--acento-txt); }
.badge {
  position: absolute; top: 8px; left: calc(50% + 6px); min-width: 19px; height: 19px; padding: 0 5px; border-radius: 10px;
  background: var(--vermelho); color: #fff; font-size: .7rem; font-weight: 600; line-height: 19px; text-align: center;
}

/* ---------- teclado */
.p-teclado { display: flex; flex-direction: column; align-items: center; justify-content: safe center; padding-bottom: 28px; }
.p-teclado > * { width: 100%; max-width: 340px; }
.meu-ramal { margin: 0; text-align: center; color: var(--suave); font-size: .85rem; }
.meu-ramal strong { color: var(--texto); font-weight: 600; font-variant-numeric: tabular-nums; letter-spacing: .04em; }
.visor { display: flex; align-items: center; justify-content: center; min-height: 84px; margin: 4px 0 6px; }
#in-numero {
  border: 0; background: transparent; text-align: center; padding: 0 4px; min-height: 64px; border-radius: 12px;
  font-weight: 300; font-size: 2.5rem; letter-spacing: .04em; font-variant-numeric: tabular-nums; caret-color: var(--acento);
}
#in-numero[data-tam="2"] { font-size: 2rem; }
#in-numero[data-tam="3"] { font-size: 1.55rem; }
#in-numero::placeholder { font-size: 1.05rem; font-weight: 400; letter-spacing: 0; color: var(--suave); opacity: 1; }
#in-numero:focus { box-shadow: none; }
#in-numero:focus-visible { outline: none; box-shadow: inset 0 -2px 0 var(--acento-txt); border-radius: 0; }

.teclado { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px 18px; }
.tecla {
  position: relative; height: 66px; border-radius: 20px; border: 1px solid var(--borda); background: var(--sup2); color: var(--texto);
  cursor: pointer; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1px;
  touch-action: manipulation; user-select: none; -webkit-user-select: none;
  transition: background-color .12s, transform .08s, border-color .12s;
}
.tecla:hover { border-color: var(--borda-forte); background: var(--sup3); }
.tecla:active, .tecla.premida { transform: scale(.95); background: var(--acento-veu); border-color: var(--acento); }
.tecla .dig { font-size: 1.85rem; font-weight: 300; line-height: 1; font-variant-numeric: tabular-nums; }
.tecla .let { font-size: .64rem; font-weight: 500; letter-spacing: .2em; color: var(--acento-txt); min-height: .9em; line-height: 1; padding-left: .2em; }
.tecla[aria-label="*"] .dig { font-size: 2.2rem; transform: translateY(5px); }
.linha-ligar { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; align-items: center; justify-items: center; margin-top: 16px; }
.bt-ligar {
  width: 72px; height: 72px; border-radius: 50%; border: 0; background: var(--verde); color: #fff; cursor: pointer; display: grid; place-items: center;
  box-shadow: 0 8px 24px color-mix(in srgb, var(--verde) 40%, transparent); transition: transform .1s, filter .12s;
}
.bt-ligar svg { width: 30px; height: 30px; }
.bt-ligar:hover { filter: brightness(1.1); }
.bt-ligar:active { transform: scale(.94); }
.bt-ligar:disabled { opacity: .45; cursor: not-allowed; box-shadow: none; }
.bt-apagar {
  width: 56px; height: 56px; border-radius: 50%; border: 0; background: none; color: var(--suave); cursor: pointer; display: grid; place-items: center;
  touch-action: manipulation; transition: opacity .15s;
}
.bt-apagar svg { width: 28px; height: 28px; }
.bt-apagar:hover { color: var(--texto); background: var(--sup2); }
.bt-apagar.sem { opacity: 0; pointer-events: none; }
.atalhos { display: none; margin: 18px 0 0; text-align: center; color: var(--suave); font-size: .8rem; }
@media (hover: hover) and (pointer: fine) { .atalhos { display: block; } }

/* ---------- histórico */
.cab-painel { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 6px; min-height: 44px; }
.hist { list-style: none; margin: 0; padding: 0; }
.hist li { display: flex; align-items: stretch; border-bottom: 1px solid var(--borda); }
.hist .h-abrir {
  flex: 1; min-width: 0; display: flex; align-items: center; gap: 14px; text-align: left; background: none; border: 0; color: var(--texto);
  padding: 12px 4px; cursor: pointer; border-radius: 10px; min-height: 64px;
}
.hist .h-abrir:hover { background: var(--sup2); }
.h-ic { width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; background: var(--sup2); color: var(--acento-txt); flex: none; }
.h-ic svg { width: 20px; height: 20px; }
.h-in .h-ic { color: var(--verde-vivo); }
.h-missed .h-ic { color: var(--vermelho-txt); background: color-mix(in srgb, var(--vermelho) 12%, transparent); }
.h-txt { display: flex; flex-direction: column; min-width: 0; }
.hist strong { font-weight: 500; font-size: 1.1rem; font-variant-numeric: tabular-nums; letter-spacing: .02em; overflow-wrap: anywhere; }
.h-missed strong { color: var(--vermelho-txt); }
.h-meta { font-size: .82rem; color: var(--suave); }
.hist .h-ligar {
  width: 52px; flex: none; display: grid; place-items: center; background: none; border: 0; color: var(--verde-vivo); cursor: pointer; border-radius: 12px;
}
.hist .h-ligar svg { width: 22px; height: 22px; }
.hist .h-ligar:hover { background: var(--sup2); }
.vazio { text-align: center; color: var(--suave); padding: 56px 16px; }
.vazio svg { width: 44px; height: 44px; color: var(--borda-forte); margin: 0 auto 10px; display: block; }
.vazio p { margin: 0; }

/* ---------- ajustes */
.p-ajustes > * { max-width: 520px; margin-left: auto; margin-right: auto; }
.grupo { padding: 16px 0 20px; border-bottom: 1px solid var(--borda); display: flex; flex-direction: column; gap: 8px; }
.grupo:first-of-type { padding-top: 4px; }
.grupo > label, .rotulo { margin: 6px 0 0; font-size: .9rem; font-weight: 500; }
.grupo .secundario, .grupo .perigo { margin-top: 6px; }
.nota { margin: 0; color: var(--suave); font-size: .86rem; }
.dados { margin: 0; display: grid; gap: 2px; }
.dados div { display: flex; justify-content: space-between; gap: 16px; padding: 8px 0; border-bottom: 1px dashed var(--borda); }
.dados div:last-child { border-bottom: 0; }
.dados dt { color: var(--suave); font-size: .9rem; }
.dados dd { margin: 0; font-weight: 500; text-align: right; min-width: 0; }
.segmento { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; gap: 4px; padding: 4px; background: var(--sup2); border-radius: 14px; border: 1px solid var(--borda); }
.segmento button {
  min-height: 46px; border-radius: 10px; border: 0; background: none; color: var(--suave); cursor: pointer; font-weight: 500;
  display: flex; align-items: center; justify-content: center; gap: 8px; padding: 6px 8px; font-size: .9rem;
}
.segmento button img { width: 22px; height: 15px; border-radius: 2px; box-shadow: 0 0 0 1px rgba(0, 0, 0, .25); flex: none; }
.segmento button[aria-pressed="true"] { background: var(--sup); color: var(--texto); box-shadow: 0 1px 4px rgba(0, 0, 0, .25), inset 0 0 0 1px var(--acento); }
.segmento button:hover { color: var(--texto); }
.idiomas-lista { grid-auto-flow: row; grid-auto-columns: auto; grid-template-columns: 1fr; }
@media (min-width: 360px) { .idiomas-lista { grid-template-columns: repeat(3, 1fr); } .idiomas-lista button { flex-direction: column; gap: 4px; } }
.sobre { color: var(--suave); font-size: .82rem; margin: 18px auto 8px; }

/* ================================================================= chamada (tela cheia) */
.chamada {
  position: absolute; inset: 0; z-index: 30; display: flex; flex-direction: column; align-items: center;
  padding: calc(14px + var(--sa-t)) calc(20px + var(--sa-r)) calc(20px + var(--sa-b)) calc(20px + var(--sa-l));
  background: var(--fundo); text-align: center; overflow-y: auto; animation: sobe .26s cubic-bezier(.2, .8, .2, 1);
}
@keyframes sobe { from { opacity: .6; transform: translateY(24px); } }
.chamada > * { width: 100%; max-width: 380px; }
.ch-topo { display: flex; align-items: center; justify-content: space-between; gap: 10px; min-height: 40px; }
.ch-estado { margin: 0; font-weight: 500; color: var(--acento-txt); font-size: .95rem; display: inline-flex; align-items: center; gap: 8px; }
.ch-estado::before { content: ''; width: 8px; height: 8px; border-radius: 50%; background: currentColor; }
.chamada[data-fase="ativa"] .ch-estado { color: var(--verde-vivo); }
.chamada[data-fase="espera"] .ch-estado { color: var(--amarelo); }
.chamada[data-fase="fim"] .ch-estado { color: var(--suave); }
.chamada[data-fase="saindo"] .ch-estado::before, .chamada[data-fase="tocando"] .ch-estado::before, .chamada[data-fase="entrando"] .ch-estado::before { animation: pisca 1s ease-in-out infinite; }
.ch-centro { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; min-height: 0; padding: 8px 0; }

.avatar { position: relative; width: 208px; height: 208px; margin-bottom: 18px; flex: none; transition: width .25s, height .25s, margin .25s; }
.orbita { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; }
.trilho { fill: none; stroke: var(--borda); stroke-width: 1; }
.elo { fill: none; stroke: var(--acento); stroke-width: 1.4; stroke-opacity: .45; stroke-linejoin: round; }
.no { fill: var(--acento); }
.onda { fill: none; stroke: var(--verde-vivo); stroke-width: 2; opacity: 0; transform-box: view-box; transform-origin: 100px 100px; }
.rede { transform-box: view-box; transform-origin: 100px 100px; }
.disco {
  position: absolute; inset: 41px; border-radius: 50%; background: var(--sup2); border: 1px solid var(--borda-forte);
  display: grid; place-items: center; color: var(--texto);
}
.iniciais { font-size: 2.6rem; font-weight: 300; letter-spacing: .04em; line-height: 1; }
.sem-nome { width: 44px; height: 44px; color: var(--acento-txt); display: none; }
.iniciais:empty { display: none; }
.iniciais:empty + .sem-nome { display: block; }
/* chamando / tocando: o sinal percorre a rede de 3 nós */
.chamada[data-fase="saindo"] .elo, .chamada[data-fase="tocando"] .elo { stroke-dasharray: 6 10; animation: sinal 1.4s linear infinite; stroke-opacity: .8; }
.chamada[data-fase="saindo"] .no, .chamada[data-fase="tocando"] .no { animation: acende 1.5s ease-in-out infinite; }
.chamada[data-fase="saindo"] .n2, .chamada[data-fase="tocando"] .n2 { animation-delay: .5s; }
.chamada[data-fase="saindo"] .n3, .chamada[data-fase="tocando"] .n3 { animation-delay: 1s; }
@keyframes sinal { to { stroke-dashoffset: -32; } }
@keyframes acende { 0%, 100% { opacity: .25; } 35% { opacity: 1; } }
/* recebendo: ondas saindo do disco + nós pulsando juntos */
.chamada[data-fase="entrando"] .onda { animation: onda 2s ease-out infinite; }
.chamada[data-fase="entrando"] .o2 { animation-delay: 1s; }
.chamada[data-fase="entrando"] .no { animation: acende 1s ease-in-out infinite; }
.chamada[data-fase="entrando"] .elo { stroke-opacity: .8; }
.chamada[data-fase="entrando"] .disco { border-color: var(--verde-vivo); }
@keyframes onda { 0% { opacity: .7; transform: scale(1); } 100% { opacity: 0; transform: scale(1.55); } }
/* em chamada: rede firme, giro lento */
.chamada[data-fase="ativa"] .elo { stroke-opacity: .9; }
.chamada[data-fase="ativa"] .rede { animation: gira 60s linear infinite; }
.chamada[data-fase="ativa"] .disco { border-color: var(--acento); }
.chamada[data-fase="espera"] .orbita { opacity: .35; }
.chamada[data-fase="espera"] .disco { opacity: .6; }
.chamada[data-fase="fim"] .orbita { opacity: .2; }

.ch-nome { margin: 0; font-size: 1.6rem; font-weight: 500; line-height: 1.2; overflow-wrap: anywhere; }
.ch-numero { margin: 2px 0 0; font-size: 2rem; font-weight: 300; letter-spacing: .04em; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; line-height: 1.2; }
.ch-nome:not([hidden]) + .ch-numero { font-size: 1.1rem; color: var(--suave); font-weight: 400; }
.ch-tempo { margin: 8px 0 0; color: var(--suave); font-variant-numeric: tabular-nums; font-size: 1.05rem; letter-spacing: .06em; min-height: 1.5em; }
.chamada:not([data-fase="ativa"]):not([data-fase="espera"]) .ch-tempo { visibility: hidden; }

/* teclado de DTMF aberto: avatar encolhe */
.chamada[data-teclado="1"] .avatar { width: 96px; height: 96px; margin-bottom: 8px; }
.chamada[data-teclado="1"] .disco { inset: 19px; }
.chamada[data-teclado="1"] .iniciais { font-size: 1.2rem; }
.chamada[data-teclado="1"] .sem-nome { width: 22px; height: 22px; }
.chamada[data-teclado="1"] .ch-nome { font-size: 1.15rem; }
.chamada[data-teclado="1"] .ch-numero { font-size: 1.25rem; }

.ch-entrada { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; padding: 8px 0 24px; }
.par { display: flex; justify-content: center; }
.redondo {
  width: 76px; height: 76px; border-radius: 50%; border: 0; color: #fff; cursor: pointer; display: inline-grid; place-items: center;
  position: relative; transition: transform .1s, filter .12s; touch-action: manipulation;
}
.redondo svg { width: 32px; height: 32px; }
.redondo:hover { filter: brightness(1.1); }
.redondo:active { transform: scale(.94); }
.redondo.xl { width: 88px; height: 88px; }
.redondo.xl svg { width: 36px; height: 36px; }
.redondo .rot { position: absolute; top: calc(100% + 10px); left: 50%; transform: translateX(-50%); font-size: .92rem; font-weight: 500; color: var(--texto); white-space: nowrap; }
.redondo.verde { background: var(--verde); }
.redondo.vermelho { background: var(--vermelho); }
.chamada[data-fase="entrando"] #bt-atender { animation: chama 1.6s ease-out infinite; }
@keyframes chama { 0% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--verde-vivo) 55%, transparent); } 100% { box-shadow: 0 0 0 20px transparent; } }
.ch-entrada .redondo { margin-bottom: 30px; }

.ch-controles { display: flex; flex-direction: column; align-items: center; gap: 14px; padding-bottom: 4px; }
.ch-controles > * { width: 100%; }
.ch-grade { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.ctl {
  background: none; border: 0; color: var(--texto); cursor: pointer; display: flex; flex-direction: column; align-items: center; gap: 6px;
  font-size: .78rem; font-weight: 500; padding: 0; min-height: 48px;
}
.ctl-ic { width: 60px; height: 60px; border-radius: 50%; display: grid; place-items: center; background: var(--sup2); border: 1px solid var(--borda); transition: background-color .15s, color .15s; }
.ctl-ic svg { width: 24px; height: 24px; }
.ctl:hover .ctl-ic { background: var(--sup3); }
.ctl[aria-pressed="true"] .ctl-ic, .ctl[aria-expanded="true"] .ctl-ic { background: var(--acento); color: var(--sobre-acento); border-color: var(--acento); }
#bt-mudo[aria-pressed="false"] .risco { display: none; }
#bt-desligar { width: 72px; height: 72px; margin-top: 4px; }
.ch-saida { display: flex; justify-content: center; padding-bottom: 8px; }
.ch-saida:empty, .ch-saida:has(> [hidden]:only-child) { display: none; }
.teclado.compacto { gap: 8px 12px; }
.teclado.compacto .tecla { height: 52px; border-radius: 16px; }
.teclado.compacto .tecla .dig { font-size: 1.5rem; }
.teclado.compacto .let { display: none; }
.ch-dtmf-eco { margin: 0; min-height: 1.4em; color: var(--acento-txt); font-variant-numeric: tabular-nums; letter-spacing: .25em; font-size: 1.05rem; }
.ch-dtmf-eco:empty { display: none; }
.ch-transf { text-align: left; display: flex; flex-direction: column; gap: 8px; }
.ch-transf .primario, .ch-transf .secundario { margin: 0; }
.duplo { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }

.qualidade { display: inline-flex; align-items: center; gap: 7px; font-size: .82rem; color: var(--suave); padding: 6px 10px; border-radius: 999px; background: var(--sup2); }
.barras { display: inline-flex; align-items: flex-end; gap: 2px; height: 14px; }
.barras i { width: 4px; background: var(--borda-forte); border-radius: 1px; }
.barras i:nth-child(1) { height: 5px; } .barras i:nth-child(2) { height: 9px; } .barras i:nth-child(3) { height: 14px; }
.qualidade[data-q="boa"] .barras i { background: var(--verde-vivo); }
.qualidade[data-q="media"] .barras i:nth-child(-n+2) { background: var(--amarelo); }
.qualidade[data-q="ruim"] .barras i:nth-child(1) { background: var(--vermelho); }

/* ================================================================= aviso (toast) */
.toast {
  position: absolute; left: 50%; bottom: calc(var(--abas-h) + var(--sa-b) + 14px); transform: translateX(-50%); z-index: 60;
  background: var(--texto); color: var(--fundo); padding: 12px 18px; border-radius: 14px; font-size: .92rem; font-weight: 500;
  width: max-content; max-width: calc(100% - 32px); box-shadow: var(--sombra); animation: toast .22s ease-out; text-align: center;
}
.toast[data-tipo="erro"] { background: var(--vermelho); color: #fff; }
body[data-vista="login"] .toast { bottom: calc(24px + var(--sa-b)); }
@keyframes toast { from { opacity: 0; transform: translate(-50%, 10px); } }

/* ================================================================= desktop: cartão centralizado */
@media (min-width: 720px) and (min-height: 600px) {
  body { display: grid; place-items: center; padding: 24px; overflow: auto; background: var(--fundo); }
  :root:not([data-tema="claro"]) body { background: #08080A; }
  .app {
    width: 420px; height: min(820px, calc(100dvh - 48px)); border: 1px solid var(--borda); border-radius: var(--raio-g);
    box-shadow: var(--sombra); background: var(--sup);
  }
  :root[data-tema="claro"] .app { background: var(--sup); }
  .app .topo { padding-top: 0; min-height: var(--topo-h); }
  .chamada { background: var(--sup); }
  .tecla { background: var(--sup2); }
}

/* ================================================================= instalar.html */
body.pg-instalar { overflow: auto; height: auto; min-height: 100%; display: block; padding: 0; place-items: normal; }
a.marca { text-decoration: none; color: var(--texto); border-radius: 10px; min-height: 48px; }
.toast.toast-fixo { position: fixed; bottom: calc(24px + var(--sa-b)); }
body.pg-instalar .topo { position: sticky; top: 0; background: var(--fundo); z-index: 5; }
.inst { max-width: 980px; margin: 0 auto; padding: 32px calc(20px + var(--sa-r)) calc(40px + var(--sa-b)) calc(20px + var(--sa-l)); }
.inst-cab { display: grid; gap: 28px; align-items: center; margin-bottom: 36px; }
.inst-cab h1 { font-size: 2.1rem; }
.inst-cab .sub { margin-bottom: 18px; }
.inst-acoes { display: flex; gap: 10px; flex-wrap: wrap; }
.inst-acoes .primario, .inst-acoes .secundario { width: auto; }
.qr-cartao { display: flex; gap: 18px; align-items: center; background: var(--sup); border: 1px solid var(--borda); border-radius: 20px; padding: 18px; }
.qr-caixa { background: #fff; padding: 10px; border-radius: 12px; line-height: 0; flex: none; }
.qr-caixa svg { width: 148px; height: 148px; }
.qr-txt p { margin: 0 0 6px; font-size: .92rem; color: var(--suave); }
.qr-txt .url { color: var(--texto); font-size: .9rem; }
.inst-grade { display: grid; gap: 16px; }
.inst-bloco { background: var(--sup); border: 1px solid var(--borda); border-radius: 20px; padding: 20px 20px 18px; position: relative; }
.inst-bloco.seu { border-color: var(--acento); box-shadow: 0 0 0 1px var(--acento); }
.inst-bloco .seu-tag { display: none; position: absolute; top: 18px; right: 18px; font-size: .78rem; font-weight: 600; color: var(--sobre-acento); background: var(--acento); padding: 3px 10px; border-radius: 999px; }
.inst-bloco.seu .seu-tag { display: inline-block; }
.inst-bloco h2 { display: flex; align-items: center; gap: 10px; margin: 0 0 12px; padding-right: 96px; }
.inst-bloco h2 svg { width: 26px; height: 26px; color: var(--acento-txt); flex: none; }
.inst-bloco ol { margin: 0; padding: 0; list-style: none; counter-reset: passo; }
.inst-bloco li { counter-increment: passo; position: relative; padding: 0 0 12px 40px; font-size: .95rem; }
.inst-bloco li::before {
  content: counter(passo); position: absolute; left: 0; top: -1px; width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center;
  border: 1px solid var(--acento); color: var(--acento-txt); font-size: .82rem; font-weight: 600;
}
.inst-bloco .aviso { margin-top: 4px; }
.inst-rodape { margin-top: 28px; color: var(--suave); font-size: .92rem; display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; align-items: center; }
@media (min-width: 760px) {
  .inst-cab { grid-template-columns: 1.2fr 1fr; }
  .inst-grade { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 420px) { .qr-cartao { flex-direction: column; align-items: flex-start; } .inst-cab h1 { font-size: 1.7rem; } }

/* ================================================================= telas baixas / estreitas */
@media (max-height: 700px) {
  .visor { min-height: 64px; }
  .tecla { height: 56px; }
  .teclado { gap: 9px 16px; }
  .avatar { width: 160px; height: 160px; }
  .disco { inset: 32px; }
  .linha-ligar { margin-top: 10px; }
}
@media (max-width: 350px) { .teclado { gap: 10px 10px; } .estado #estado-txt { display: none; } .estado { padding: 8px; } }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
  .chamada[data-fase="saindo"] .no, .chamada[data-fase="tocando"] .no, .chamada[data-fase="entrando"] .no { opacity: 1; }
}
@media (forced-colors: active) { .tecla, .ctl-ic, .redondo, .bt-ligar { border: 1px solid ButtonText; } }
