/* ==================================================================== */
/* Base Toast Notification Styles                                       */
/* ==================================================================== */

/* A FONTE ÚNICA DOS TOASTS, do CMS e do site público: o Toast.js é o mesmo
   nos dois, e as duas cabeças (head.php) carregam esta folha. O site não tem
   as variáveis do CMS, por isso o que os toasts de cor usam leva sempre um
   valor de recurso; o aviso com decisão e a janela de voltar a avisar só
   existem no CMS e leem os tokens dele. */

/* O tipo do `--toast-offset-top`, declarado para o valor CHEGAR EM PIXELS ao
   JS. Sem `@property` uma custom property guarda o TEXTO do `calc()`, e o
   `getPropertyValue` do Toast.js recebia a expressão em vez de um número: o
   toast ficava no canto de cima, por cima do cabeçalho (2026-09-17). Com o
   tipo declarado, o browser resolve o calc e entrega `70px`.

   A DERIVAÇÃO VIVE NO <body> de cada plataforma (o header.css do CMS, o
   default.css do site), e NÃO no :root: um `calc()` com `var()` resolve-se no
   elemento onde é declarado, e no `:root` a faixa do topo do CMS vale sempre
   0px, porque quem a liga é a classe no <body>. Declarado no :root, o toast
   ficava a 70px com a faixa ligada e tapava-a. */
@property --toast-offset-top {
  syntax: "<length>";
  inherits: true;
  initial-value: 10px;
}

.toast-notification {
    /* Positioning and Layering */
    position: fixed;
    z-index: 999999;
    /* Ensures the toast appears on top of other elements */

    /* Box Model and Appearance */
    /* Tecto de segurança: um toast nunca passa da largura do ecrã, seja qual for
       o `width` que lhe passem. Havia avisos a 60% da largura (1020px num ecrã
       de 1700) para duas linhas e dois botões, o que tapava a página em vez de
       avisar ao canto. Um aviso com acção anda pelos 400-500px. */
    max-width: min(560px, calc(100vw - 32px));
    background-color: #fff;
    /* A tinta do texto, que a ação por baixo dele herda. Cada cor de aviso
       declara a sua mais abaixo; esta é a do toast sem cor, o fundo branco,
       onde o cinzento #bbb que aqui estava se lia a 1,9:1. Escura e fixa, como
       a das outras cores: um toast não segue o tema. */
    color: #1c1917;
    box-shadow: 0 6px 20px -5px rgba(0, 0, 0, 0.7);
    border-radius: 4px;
    display: flex;
    padding: 10px 20px 15px 20px;
    overflow: hidden;
    /* Essential for containing the progress bar and respecting border-radius */

    /* Initial state for animation (positioned off-screen at the top) */
    transform: translate(0, -150%);

    /* Removes text decoration if the toast is a link */
    text-decoration: none;
}

/* Um toast que fechou com o rato dentro da pilha fica no lugar, invisível, até
   o rato sair: não reage ao clique nem ao teclado, e o vazio que deixa é o que
   impede o toast de baixo de subir para debaixo do ponteiro. */
.toast-notification.is-fantasma {
    pointer-events: auto;
    cursor: default;
}
.toast-notification.is-fantasma > * {
    visibility: hidden;
    pointer-events: none;
}

/* O destino de um toast é um botão («Abrir o pedido») debaixo do texto, longe do
   ×: o cartão em si não é uma ligação. Lê-se no tamanho do texto, que se fixa
   aqui: herdado, valia o da página, 12px no CMS e 16px no site. */
.toast-notification .toast-notification-actions {
    margin-top: var(--space-2, 8px);
    font-size: var(--text-sm, 12px);
    line-height: 1.5;
}
.toast-notification .toast-notification-actions .revert-action-button {
    margin-left: 0;
}


/* ==================================================================== */
/* Inner Toast Structure                                                */
/* ==================================================================== */

.toast-notification .toast-notification-wrapper {
    display: flex;
    flex-direction: column;
    justify-content: center;
    flex: 1;
    /* Takes up available space */
    padding-right: 10px;
    overflow: hidden;
}

.toast-notification .toast-notification-wrapper .toast-notification-header {
    padding: 0;
    margin: 0;
    font-weight: var(--weight-bold, 700);
    font-size: var(--text-lg, 14px);
    letter-spacing: -0.01em;
    color: inherit;
    /* IMPROVEMENT: `overflow-wrap` is better than `word-break` for wrapping long text without breaking words */
    overflow-wrap: break-word;
}

/* O título e o espaço até ao texto são os das outras cores. A altura da linha
   fica `normal`, porque o toque de uma chamada (call-toast.css) herda-a daqui
   e não a repõe. */
.toast-notification .toast-notification-wrapper .toast-notification-content {
    margin: 5px 0 0 0;
    font-size: 12px;
    line-height: normal;
    padding: 0;
    color: inherit;
}

/* O alvo do × mede 24 por 24 no mínimo (WCAG 2.5.8), e 44 por 44 num ecrã de
   toque: o símbolo é o mesmo, a caixa é que cresce à volta dele. Com 15px de
   texto o botão media 10 por 19. A caixa de toque encosta ao canto, porque o
   aviso corta o que sair dele, e o texto do aviso afasta-se para não ficar
   por baixo. */
.toast-notification .toast-notification-close {
    position: absolute;
    top: 3px;
    right: 3px;
    display: grid;
    place-items: center;
    width: 24px;
    height: 24px;
    padding: 0;

    /* Reset button styles */
    appearance: none;
    border: none;
    background: transparent;
    cursor: pointer;

    /* Text styles */
    font-size: 15px;
    line-height: normal;
    font-weight: 600;
    color: rgba(28, 25, 23, 0.6);
    outline: none;
}
@media (pointer: coarse) {
    .toast-notification .toast-notification-close {
        top: 0;
        right: 0;
        width: 44px;
        height: 44px;
    }
    .toast-notification .toast-notification-wrapper { padding-right: 24px; }
}

.toast-notification .toast-notification-close:focus-visible {
  outline: calc(var(--focus-ring-width, 1px) * 2) solid var(--focus-ring-color, currentColor);
  outline-offset: 2px;
}

/* Hover effect */
.toast-notification .toast-notification-close:hover {
    color: #1c1917;
}

/* A ação dentro do aviso (o «Desfazer» do Por fazer, o «Responder» de um
   e-mail que chegou, o «Abrir a encomenda»): um botão, com o alvo do teclado,
   lido pelo sublinhado e na tinta do próprio aviso, como as ligações da casa.
   Com 24px de alto, o mínimo da WCAG 2.2, e 44px num ecrã de toque: em linha
   de texto media 22px, e o dedo falhava-o. O alvo cresce na altura e não dos
   lados, e o texto encosta à esquerda: com enchimento lateral e o centrado do
   botão, a ação ficava recuada em relação ao parágrafo e, ao partir em duas
   linhas, centrada a meio do aviso. Uma ligação escrita no próprio texto (um
   `<a>` no conteúdo) lê-se igual, porque o `base.css` tira o sublinhado a todo
   o `<a>` e ali ficava texto corrido. */
.toast-notification .revert-action-button {
    appearance: none;
    display: inline-flex;
    align-items: center;
    min-height: 24px;
    vertical-align: middle;
    margin: 0 0 0 10px;
    padding: 2px 0;
    border: 0;
    border-radius: var(--radius-sm, 4px);
    background: transparent;
    color: inherit;
    font: inherit;
    font-weight: var(--weight-semibold, 600);
    text-align: start;
    cursor: pointer;
}
.toast-notification .revert-action-button,
.toast-notification .toast-notification-header a,
.toast-notification .toast-notification-content a {
    color: inherit;
    text-decoration: underline;
    text-decoration-color: currentColor;
    text-decoration-thickness: 1px;
    text-decoration-skip-ink: none;
    text-underline-offset: 3px;
}
@media (pointer: coarse) {
    .toast-notification .revert-action-button { min-height: 44px; }
}
.toast-notification .revert-action-button:focus-visible,
.toast-notification .toast-notification-header a:focus-visible,
.toast-notification .toast-notification-content a:focus-visible {
    outline: 2px solid currentColor;
    outline-offset: 2px;
}
/* No aviso com decisão a tinta segue o tema; um `<a>` solto no texto leva o
   traço e a cor do texto à volta, como a `.cms-link`, que já se desenha só. */
.toast-decision-text a:not(.cms-link) {
    color: inherit;
    text-decoration: underline;
    text-decoration-thickness: 1px;
    text-decoration-skip-ink: none;
    text-underline-offset: 3px;
}


/* ==================================================================== */
/* Positioning Classes                                                  */
/* Defines the initial off-screen state for different positions.        */
/* The JavaScript will calculate the final animated position.           */
/* ==================================================================== */

.toast-notification.toast-notification-top-center {
    /* CORRECTION: Uses translate(-50%) with `left: 50%` from JS for perfect horizontal centering. */
    transform: translate(-50%, -150%);
}

.toast-notification.toast-notification-bottom-left,
.toast-notification.toast-notification-bottom-right {
    transform: translate(0, 150%);
}

.toast-notification.toast-notification-bottom-center {
    /* CORRECTION: Uses translate(-50%) with `left: 50%` from JS for perfect horizontal centering. */
    transform: translate(-50%, 150%);
}


/* ====================================================================
   TEMAS: fundo sólido colorido, ícone em medalhão, texto branco
   ====================================================================
   Desenho escolhido pelo Jorge (2026-08-27), a partir de uma referência que
   enviou. O que muda em relação ao anterior:

     antes                          agora
     fundo claro pastel             fundo SÓLIDO da cor
     filete de 10px à esquerda      sem filete
     texto na cor escura            texto branco
     barra de progresso escura      barra clara, no fundo, a toda a largura
     (sem ícone)                    ícone em medalhão translúcido à esquerda

   Continua a valer a regra de sempre: **estas cores são FIXAS e não seguem o
   tema** (ver a nota no fim do ficheiro). O que mudou foi o desenho, não a
   natureza: um toast é a mesma coisa em claro e em escuro.

   O ícone é desenhado no `::before` do próprio toast, porque o markup do
   Toast.js não tem elemento para ele e não se toca no componente por causa de
   uma decoração. Vai como SVG em data-URI, branco: não depende da fonte de
   ícones estar carregada no momento em que o toast aparece.
   ==================================================================== */

/* Cada tema declara a SUA cor e o SEU glifo; tudo o resto é comum.

   AS CORES SÃO AS DA REFERÊNCIA, UM TOM MAIS FUNDAS. Nas cores exactas da
   imagem, o texto branco não é legível: medido, nenhuma das cinco chega ao
   mínimo (4,5:1):

       success #57bb6e  2,40:1      error #e9584a  3,52:1
       info    #0c8ce0  3,59:1      warning #fdc00c  1,65:1

   Baixar a luminosidade entre 6% e 17%, mantendo matiz e saturação, põe as
   três acima de 4,5:1 sem mudar a cor de família: continua a ler-se "o verde",
   "o vermelho", "o azul". O amarelo não se resolve assim (teria de ficar
   castanho): é a excepção, e leva tinta escura em vez de branca.

   ERAM CINCO. O laranja saiu (2026-09-01): entre o amarelo do `warning` e o
   vermelho do `error` não havia um terceiro grau de urgência para dizer: quem
   escolhia entre os dois escolhia à sorte, e quem lia não distinguia o que os
   separava. Um `style: 'orange'` esquecido em qualquer lado cai no amarelo: o
   alias vive no `push()` do Toast.js. */
.toast-notification.toast-notification-success { --toast-cor: #368548; }  /* 4,56:1 */
.toast-notification.toast-notification-error   { --toast-cor: #e22d1b; }  /* 4,54:1 */
.toast-notification.toast-notification-info    { --toast-cor: #0b7bc5; }  /* 4,51:1 */
.toast-notification.toast-notification-warning { --toast-cor: #fdc00c; }  /* tinta escura */

.toast-notification.toast-notification-success,
.toast-notification.toast-notification-error,
.toast-notification.toast-notification-info,
.toast-notification.toast-notification-warning {
    background-color: var(--toast-cor);
    border-left: none;
    align-items: flex-start;
    gap: 12px;
    padding: 14px 18px 16px 18px;
    color: #fff;
}

/* O medalhão do ícone. `flex-shrink: 0` porque o texto pode ser longo.
   32px (era 44) e glifo de 18 (era 24): a 44 o medalhão era mais alto do que as
   duas linhas de texto que acompanha, e o aviso lia-se como um cartaz, e o olho
   ia para o símbolo em vez de ir para a frase. */
.toast-notification.toast-notification-success::before,
.toast-notification.toast-notification-error::before,
.toast-notification.toast-notification-info::before,
.toast-notification.toast-notification-warning::before {
    content: '';
    flex: 0 0 auto;
    width: 32px;
    height: 32px;
    margin-top: 1px;
    border-radius: 50%;
    background-color: rgba(255, 255, 255, 0.22);
    background-repeat: no-repeat;
    background-position: center;
    background-size: 18px 18px;
}

/* ✓ */
.toast-notification.toast-notification-success::before {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23fff' stroke-width='2.6' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M20 6 9 17l-5-5'/%3E%3C/svg%3E");
}
/* × */
.toast-notification.toast-notification-error::before {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23fff' stroke-width='2.6' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M18 6 6 18M6 6l12 12'/%3E%3C/svg%3E");
}
/* i */
.toast-notification.toast-notification-info::before {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23fff' stroke-width='2.6' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M12 16v-5M12 8h.01'/%3E%3C/svg%3E");
}
/* O glifo do `warning` é o triângulo, e está lá em baixo, no bloco do amarelo:
   é a única cor com tinta escura, e um `background-image` branco aqui seria
   sempre sobreposto: regra morta a fingir que desenha alguma coisa. */

/* Texto: tudo branco. O título destaca-se pelo peso e pelo tamanho, não pela
   cor: sobre um fundo saturado, dois brancos diferentes leem-se como um
   engano de renderização. */
.toast-notification.toast-notification-success .toast-notification-wrapper .toast-notification-header,
.toast-notification.toast-notification-error   .toast-notification-wrapper .toast-notification-header,
.toast-notification.toast-notification-info    .toast-notification-wrapper .toast-notification-header,
.toast-notification.toast-notification-warning .toast-notification-wrapper .toast-notification-header {
    color: #fff;
    font-size: var(--text-lg, 14px);
    font-weight: var(--weight-bold, 700);
    letter-spacing: -0.01em;
}

.toast-notification.toast-notification-success .toast-notification-wrapper .toast-notification-content,
.toast-notification.toast-notification-error   .toast-notification-wrapper .toast-notification-content,
.toast-notification.toast-notification-info    .toast-notification-wrapper .toast-notification-content,
.toast-notification.toast-notification-warning .toast-notification-wrapper .toast-notification-content {
    color: #fff;
    margin-top: 5px;
    font-size: var(--text-sm, 12px);
    line-height: 1.5;
}

/* O × de fechar: branco esbatido, cheio no hover. */
.toast-notification.toast-notification-success .toast-notification-close,
.toast-notification.toast-notification-error   .toast-notification-close,
.toast-notification.toast-notification-info    .toast-notification-close,
.toast-notification.toast-notification-warning .toast-notification-close {
    color: rgba(255, 255, 255, 0.75);
    top: 3px;
    right: 3px;
    font-size: 15px;
}

.toast-notification.toast-notification-success .toast-notification-close:hover,
.toast-notification.toast-notification-error   .toast-notification-close:hover,
.toast-notification.toast-notification-info    .toast-notification-close:hover,
.toast-notification.toast-notification-warning .toast-notification-close:hover {
    color: #fff;
}

/* ── Amarelo: a excepção ───────────────────────────────────────────────
   Branco sobre #fdc00c dá 1,65:1, ilegível. O amarelo é a única das quatro
   cores clara o bastante para exigir tinta ESCURA; o desenho é o mesmo, muda
   só a tinta. Medido: 6,92:1 no texto.

   E é aqui que mora o TRIÂNGULO. Um "!" solto dentro do medalhão redondo
   diferia do "i" do `info` só pela ordem do ponto e da haste, e a 18px ninguém
   lê essa diferença, e os dois avisos passavam a valer o mesmo. O triângulo
   distingue-se pela FORMA, que se apanha antes de se ler o símbolo. */
.toast-notification.toast-notification-warning {
    color: #4a3702;
}
.toast-notification.toast-notification-warning .toast-notification-wrapper .toast-notification-header,
.toast-notification.toast-notification-warning .toast-notification-wrapper .toast-notification-content {
    color: #4a3702;
}
.toast-notification.toast-notification-warning::before {
    background-color: rgba(74, 55, 2, 0.16);
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%234a3702' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M10.29 3.86 1.82 18a2 2 0 0 0 1.71 3h16.94a2 2 0 0 0 1.71-3L13.71 3.86a2 2 0 0 0-3.42 0Z'/%3E%3Cpath d='M12 9v4M12 17h.01'/%3E%3C/svg%3E");
}
.toast-notification.toast-notification-warning .toast-notification-close {
    color: rgba(74, 55, 2, 0.7);
}
.toast-notification.toast-notification-warning .toast-notification-close:hover {
    color: #4a3702;
}

/* ── Barra de progresso ────────────────────────────────────────────────
   No fundo, de ponta a ponta, um branco sobre a cor, em vez da barra escura
   que havia. A calha é o próprio fundo, um pouco escurecido. */
.toast-notification.toast-notification-success .progress,
.toast-notification.toast-notification-error   .progress,
.toast-notification.toast-notification-info    .progress,
.toast-notification.toast-notification-warning .progress {
    height: 4px;
    background-color: rgba(0, 0, 0, 0.12);
}

.toast-notification.toast-notification-success .progress-bar-inner,
.toast-notification.toast-notification-error   .progress-bar-inner,
.toast-notification.toast-notification-info    .progress-bar-inner {
    background-color: rgba(255, 255, 255, 0.55);
}

.toast-notification.toast-notification-warning .progress-bar-inner {
    background-color: rgba(74, 55, 2, 0.35);
}

/* ── Ritmo vertical ────────────────────────────────────────────────────
   Quatro medidas, e cada uma diz o que separa:

     título → texto      6px    são a mesma frase, dita em dois tempos
     linha → linha       1,5    dentro do texto, é o line-height que separa
     texto → botões     16px    aqui muda a natureza: deixa de se ler e passa
                                a decidir-se, e o olho precisa da pausa
     botões → fundo     20px    o padding do toast

   O `<i>` do conteúdo (a segunda linha, em itálico) é um bloco com 4px por
   cima: escrito a seguir a um `<br>`, ficava colado à linha anterior. */

.toast-notification .toast-notification-wrapper .toast-notification-content > i,
.toast-notification .toast-notification-wrapper .toast-notification-content > em {
    display: block;
    margin-top: 4px;
}

/* ── Botões dentro do toast ────────────────────────────────────────────
   O LAYOUT (flex, gap, margem de cima) e as cores. O fundo passou a ser a cor
   saturada, por isso a tinta escura que aqui estava (feita para o pastel
   claro) deixou de servir: contornado a branco, cheio a branco com a letra na
   cor do toast. Funciona nas cinco. */

.toast-notification .toast-buttons {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    margin-top: 16px;
}
.toast-notification .toast-buttons .toast-notification-btn {
    color: #fff;
    background: transparent;
    border-color: rgba(255, 255, 255, 0.6);
}

.toast-notification .toast-buttons .toast-notification-btn:hover:not(.disabled, [disabled]) {
    color: #fff;
    background: rgba(255, 255, 255, 0.18);
    border-color: #fff;
}

.toast-notification .toast-buttons .toast-notification-btn.is-primary {
    color: var(--toast-cor, #1c1917);
    background: #fff;
    border-color: #fff;
}

.toast-notification .toast-buttons .toast-notification-btn.is-primary:hover:not(.active, .disabled, [disabled]) {
    color: var(--toast-cor, #1c1917);
    background: rgba(255, 255, 255, 0.86);
    border-color: rgba(255, 255, 255, 0.86);
}

/* No amarelo o texto do botão cheio é a tinta escura, não o amarelo (que sobre
   branco seria ilegível). */
.toast-notification.toast-notification-warning .toast-buttons .toast-notification-btn {
    color: #4a3702;
    border-color: rgba(74, 55, 2, 0.4);
}
.toast-notification.toast-notification-warning .toast-buttons .toast-notification-btn:hover:not(.disabled, [disabled]) {
    color: #4a3702;
    background: rgba(74, 55, 2, 0.1);
    border-color: #4a3702;
}
.toast-notification.toast-notification-warning .toast-buttons .toast-notification-btn.is-primary {
    color: #4a3702;
    background: #fff;
    border-color: #fff;
}
.toast-notification.toast-notification-warning .toast-buttons .toast-notification-btn.is-primary:hover:not(.active, .disabled, [disabled]) {
    color: #4a3702;
    background: rgba(255, 255, 255, 0.86);
    border-color: rgba(255, 255, 255, 0.86);
}


/* ====================================================================
   AVISOS: a outra família de toasts (decisão do Jorge, 2026-09-16)
   ====================================================================
   Os quatro de cima contam o resultado de uma operação e vão-se embora. Os
   avisos (`style: 'alert'`) dizem que alguma coisa espera por alguém: um
   pedido de apoio à direção, uma cotação a rever, um pedido urgente sem dono.
   Vieram substituir o balão que flutuava ao centro, para haver um sítio só
   onde se avisa. Seis níveis, do menos ao mais importante: azul, verde,
   amarelo, laranja, roxo e vermelho, e é o nível que diz a cor. O mesmo
   desenho dos outros (fundo sólido, medalhão, texto branco, cores FIXAS que
   não seguem o tema), com o que os distingue à primeira vista: o ícone é da
   família dos avisos, não o visto, a cruz ou o «i», e cresce com o escalão
   (sino, sino a tocar, altifalante, sirene), para quem não distingue cores
   ler o nível na forma. O vermelho pulsa: é o urgente.

   Contraste medido com o branco: azul 4,51:1, verde 4,56:1, laranja 4,56:1,
   roxo 5,70:1, vermelho 4,54:1. O amarelo leva tinta escura, como o `warning`
   (6,92:1). O azul, o verde, o amarelo e o vermelho são as mesmas cores dos
   toasts de operação, de propósito: é a mesma casa, e o que muda é o ícone.
   O laranja voltou (tinha saído dos de operação a 2026-09-01) porque aqui há
   uma escala de seis a dizer, e não dois graus a confundir. */
.toast-notification.toast-notification-alert--blue { --toast-cor: #0b7bc5; }
.toast-notification.toast-notification-alert--green { --toast-cor: #368548; }
.toast-notification.toast-notification-alert--yellow { --toast-cor: #fdc00c; }
.toast-notification.toast-notification-alert--orange { --toast-cor: #c8500a; }
.toast-notification.toast-notification-alert--purple { --toast-cor: #7c3aed; }
.toast-notification.toast-notification-alert--red { --toast-cor: #e22d1b; }

.toast-notification.toast-notification-alert {
    background-color: var(--toast-cor);
    border-left: none;
    align-items: flex-start;
    gap: 12px;
    padding: 14px 18px 16px 18px;
    color: #fff;
}
.toast-notification.toast-notification-alert::before {
    content: '';
    flex: 0 0 auto;
    width: 32px;
    height: 32px;
    margin-top: 1px;
    border-radius: 50%;
    background-color: rgba(255, 255, 255, 0.22);
    background-repeat: no-repeat;
    background-position: center;
    /* 16px e não 18px, ao contrário dos toasts de operação, e é isso que os faz
       parecer do MESMO tamanho (2026-09-17). O medalhão é o mesmo (32px) e a
       caixa do toast é a mesma; o que muda é o desenho lá dentro: um sino, um
       megafone ou uma sirene preenchem quase todo o viewBox de 24, enquanto um
       visto ocupa 11 unidades e um «i» oito. À mesma medida, o aviso lia-se
       maior do que o sucesso ao lado. Alinhamento óptico: iguala-se o que se
       vê, não o número. */
    background-size: 16px 16px;
}
/* O sino: azul e verde, algo espera. */
.toast-notification.toast-notification-alert--blue::before,
.toast-notification.toast-notification-alert--green::before {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23fff' stroke-width='2.6' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M18 8a6 6 0 0 0-12 0c0 7-3 9-3 9h18s-3-2-3-9'/%3E%3Cpath d='M13.7 21a2 2 0 0 1-3.4 0'/%3E%3C/svg%3E");
}
/* O sino a tocar: amarelo e laranja, pede atenção. No amarelo é a tinta escura. */
.toast-notification.toast-notification-alert--orange::before {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23fff' stroke-width='2.6' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M17.5 9a5.5 5.5 0 0 0-11 0c0 6-2.5 7.5-2.5 7.5h16s-2.5-1.5-2.5-7.5'/%3E%3Cpath d='M13.6 20.5a1.8 1.8 0 0 1-3.2 0'/%3E%3Cpath d='M2.5 6.5A9 9 0 0 1 5 3.2'/%3E%3Cpath d='M21.5 6.5A9 9 0 0 0 19 3.2'/%3E%3C/svg%3E");
}
.toast-notification.toast-notification-alert--yellow::before {
    background-color: rgba(74, 55, 2, 0.16);
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%234a3702' stroke-width='2.6' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M17.5 9a5.5 5.5 0 0 0-11 0c0 6-2.5 7.5-2.5 7.5h16s-2.5-1.5-2.5-7.5'/%3E%3Cpath d='M13.6 20.5a1.8 1.8 0 0 1-3.2 0'/%3E%3Cpath d='M2.5 6.5A9 9 0 0 1 5 3.2'/%3E%3Cpath d='M21.5 6.5A9 9 0 0 0 19 3.2'/%3E%3C/svg%3E");
}
/* O altifalante: roxo, a direção chama. */
.toast-notification.toast-notification-alert--purple::before {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23fff' stroke-width='2.6' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M11 5 6 9H3v6h3l5 4V5z'/%3E%3Cpath d='M15.5 9.5a3.5 3.5 0 0 1 0 5'/%3E%3Cpath d='M18.5 6.5a7.5 7.5 0 0 1 0 11'/%3E%3C/svg%3E");
}
/* A sirene: vermelho, urgente. */
.toast-notification.toast-notification-alert--red::before {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23fff' stroke-width='2.6' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 21h14'/%3E%3Cpath d='M7 21v-7a5 5 0 0 1 10 0v7'/%3E%3Cpath d='M12 5V2.5'/%3E%3Cpath d='M5.5 8 3.7 6.2'/%3E%3Cpath d='M18.5 8l1.8-1.8'/%3E%3Cpath d='M12 12v3'/%3E%3C/svg%3E");
}

.toast-notification.toast-notification-alert .toast-notification-wrapper .toast-notification-header {
    color: #fff;
    font-size: var(--text-lg, 14px);
    font-weight: var(--weight-bold, 700);
    letter-spacing: -0.01em;
}
.toast-notification.toast-notification-alert .toast-notification-wrapper .toast-notification-content {
    color: #fff;
    margin-top: 5px;
    font-size: var(--text-sm, 12px);
    line-height: 1.5;
}
.toast-notification.toast-notification-alert .toast-notification-close {
    color: rgba(255, 255, 255, 0.75);
    top: 3px;
    right: 3px;
    font-size: 15px;
}
.toast-notification.toast-notification-alert .toast-notification-close:hover { color: #fff; }

/* O amarelo com tinta escura, pela mesma razão do `warning`. */
.toast-notification.toast-notification-alert--yellow,
.toast-notification.toast-notification-alert--yellow .toast-notification-wrapper .toast-notification-header,
.toast-notification.toast-notification-alert--yellow .toast-notification-wrapper .toast-notification-content { color: #4a3702; }
.toast-notification.toast-notification-alert--yellow .toast-notification-close { color: rgba(74, 55, 2, 0.7); }
.toast-notification.toast-notification-alert--yellow .toast-notification-close:hover { color: #4a3702; }
.toast-notification.toast-notification-alert--yellow .toast-buttons .toast-notification-btn { color: #4a3702; border-color: rgba(74, 55, 2, 0.4); }
.toast-notification.toast-notification-alert--yellow .toast-buttons .toast-notification-btn.is-primary { color: #4a3702; border-color: #fff; }

/* SEM PULSAR, em nenhum nível (decisão do Jorge, 2026-09-17). O urgente nasceu
   a pulsar, herdado do balão que substituiu; num aviso que fica no ecrã
   enquanto o motivo durar, o anel a bater ao lado do trabalho cansa e deixa de
   se ver ao fim de meia hora. O vermelho e a sirene dizem o nível, e ficam
   quietos. A classe `is-urgent` continua a marcar o vermelho para quem precise
   de lhe pegar, mas não desenha movimento nenhum. */

/* O modal da escolha ao fechar um aviso fixo (Services/AlertCenter.js): o
   respiro do corpo é o da janela da casa. A frase, o botão de abrir o local e a
   pergunta separam-se pelo ritmo do formulário. */
.modal-window-container[data-modal-id="alert-snooze"] .modal-content > p { margin: 0 0 var(--space-3); }
/* A coluna do formulário traz 5px de cada lado; aqui a pergunta alinha pela frase. */
.modal-window-container[data-modal-id="alert-snooze"] .modal-content .form-row { margin-top: var(--space-2); margin-inline: -5px; width: auto; }

/* A barra de progresso, se um aviso levar tempo (não é o caso dos fixos). */
.toast-notification.toast-notification-alert .progress { height: 4px; background-color: rgba(0, 0, 0, 0.12); }
.toast-notification.toast-notification-alert .progress-bar-inner { background-color: rgba(255, 255, 255, 0.55); }
.toast-notification.toast-notification-alert--yellow .progress-bar-inner { background-color: rgba(74, 55, 2, 0.35); }

/* Com uma janela aberta, os alertas de fundo saem de cena, como os botões
   flutuantes: no telemóvel tapavam as opções da janela. Escondidos (e fora do
   Tab e do leitor de ecrã) e não apagados: o AlertCenter volta a mostrá-los
   quando a última janela fecha. Os outros toasts (sucesso, erro, informação)
   também não se desenham com uma janela aberta: esperam em fila no Toast.js e
   mostram-se quando ela fecha (2026-11-03), por isso este esconder só apanha o
   que já estava à vista quando a janela abriu. */
body.has-modal-open .toast-notification.toast-notification-alert,
body.has-modal-open .toast-notification.toast-notification-decision {
    visibility: hidden;
    pointer-events: none;
}


/* --- Dimmed State --- */
/* Dims toasts that are behind a new one */
.toast-notification.toast-notification-dimmed {
    opacity: 0.3;
}

.toast-notification.toast-notification-dimmed:hover,
.toast-notification.toast-notification-dimmed:active {
    opacity: 1;
}


/* ==================================================================== */
/* Action Buttons and Progress Bar                                      */
/* ==================================================================== */

/* --- Progress Bar Styles --- */
/* The progress bar container */
.toast-notification .progress {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    /* CORRECTION/IMPROVEMENT: The height is defined on the container. */
    height: 4px;
    display: flex;
    overflow: hidden;
    background-color: rgba(0, 0, 0, 0.1);
}

/* The inner progress bar that gets animated */
.toast-notification .progress-bar-inner {
    /* The inner bar fills 100% of the container's height. */
    height: 100%;
    background-color: #000000;
    animation: progress_bar-countdown linear 1 forwards;
    animation-play-state: paused;
    /* Will be set to 'running' by JS */
}

/* Sets the progress bar color for each theme */

.progress-bar-inner.progress-error {
    background-color: #a75151;
}


/* ==================================================================== */
/* Animations and Other Rules                                           */
/* ==================================================================== */

/* Progress Bar Animation */
@keyframes progress_bar-countdown {

    /* Animates the width from 100% to 0% */
    from {
        width: 100%;
    }

    to {
        width: 0%;
    }
}

/* Ícone inline no conteúdo do toast (ex.: avisos de ligação em layout.js) */
.toast-inline-icon {
    font-size: 1.1em;
    vertical-align: middle;
    margin-right: 6px;
}

/*
    COMMENTED-OUT RULE: This rule probably doesn't work as intended.
    1. The main class is `.toast-notification`, not `.toast`.
    2. The `~` (general sibling) selector would only affect buttons that are siblings
       to the toast element in the `<body>`.
    3. It's very specific and brittle. Uncomment with care if you know what you are doing.
  */
/*
  .toast.active~button {
    pointer-events: none;
  }
  */


/* ====================================================================
   O TOAST COM DECISÃO (o `decide()` do Toast.js, desde 2026-10-03)
   ====================================================================
   É o aviso urgente (vermelho e fixo) do AlertCenter: deixou a doca e a
   janela «Voltar a avisar», e decide-se no próprio toast. A linha do ícone,
   do título, da seta que recolhe e do X; por baixo o texto e os botões; no
   fim a contagem, com a barra a encher. As confirmações
   de acções continuam a ser janela.

   AO CONTRÁRIO DOS OUTROS TOASTS, SEGUE O TEMA. Os outros têm a cor fixa e a
   tinta fixa por cima; este leva os botões do sistema (`bt-*`), que seguem o
   tema, e um fundo fixo com botões que mudam ficava ilegível num dos dois.
   É uma peça que flutua, com a superfície, a hairline e a sombra de um menu
   ou de uma janela.

   Escrito para o telemóvel: a largura é a do ecrã menos as margens da pilha
   (10px de cada lado), e só um ecrã largo a prende nos 380px. */
.toast-notification.toast-notification-decision {
    display: block;
    width: min(380px, calc(100vw - 20px));
    max-width: none;
    padding: 0;
    color: var(--color-text);
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg); /* ds-ok: peça que flutua */
}

.toast-decision-head {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    padding: var(--space-3) var(--space-2) var(--space-3) var(--space-4);
}

.toast-decision-icon {
    flex: none;
    font-size: 20px;
    color: var(--color-primary-text);
}
.toast-notification-decision.is-danger .toast-decision-icon { color: var(--color-danger); }

.toast-decision-title {
    flex: 1;
    min-width: 0;
    margin: 0;
    font-size: var(--text-md);
    font-weight: var(--weight-semibold);
    line-height: 1.3;
    color: var(--color-text);
    overflow-wrap: anywhere;
}

.toast-decision-fold,
.toast-decision-close {
    flex: none;
    display: inline-grid;
    place-items: center;
    width: 32px;
    height: 32px;
    padding: 0;
    font-size: 16px;
    color: var(--color-text-muted);
    background: none;
    border: 1px solid transparent;
    border-radius: var(--radius-md);
    cursor: pointer;
}
/* Num ecrã de toque, 44 por 44, como o × dos outros avisos (WCAG 2.5.5): a 32
   o dedo falhava a seta e o ×, que ficam lado a lado. A linha de cima aperta
   na vertical para o aviso recolhido não crescer. */
@media (pointer: coarse) {
    .toast-decision-head { padding-block: var(--space-1); }
    .toast-decision-fold,
    .toast-decision-close {
        width: 44px;
        height: 44px;
    }
}
.toast-decision-fold:hover,
.toast-decision-close:hover {
    color: var(--color-text);
    background: var(--color-surface-hover);
}
.toast-decision-fold:focus-visible,
.toast-decision-close:focus-visible {
    outline: none;
    color: var(--color-text);
    border-color: var(--focus-ring-color);
}

/* O texto e os botões alinham pelo título, como na referência: o ícone fica
   sozinho na coluna dele. */
.toast-decision-body {
    padding: 0 var(--space-4) var(--space-4) calc(var(--space-4) + 20px + var(--space-2));
    animation: toast-decision-in var(--dur-fast) var(--ease-out);
}
.toast-notification-decision.is-folded .toast-decision-body { display: none; }

.toast-decision-text {
    max-height: min(40vh, 320px);
    overflow-y: auto;
    font-size: var(--text-sm);
    line-height: 1.5;
    color: var(--color-text-secondary);
    overflow-wrap: anywhere;
}
.toast-decision-text > :first-child { margin-top: 0; }
.toast-decision-text > :last-child { margin-bottom: 0; }
.toast-decision-text > * + * { margin-top: var(--space-2); }
.toast-decision-text b,
.toast-decision-text strong { color: var(--color-text); }

.toast-decision-actions {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-2);
    margin-top: var(--space-3);
}
/* Passa os botões seguintes para a linha de baixo: o que abre o assunto fica
   sozinho em cima, e os prazos de voltar a avisar juntos por baixo. */
.toast-decision-break {
    flex-basis: 100%;
    height: 0;
}

.toast-decision-timer {
    position: relative;
    padding: var(--space-2) var(--space-4) calc(var(--space-2) + 3px);
    background: var(--color-surface-alt);
    border-top: 1px solid var(--color-border);
}
.toast-decision-timer > p {
    margin: 0;
    font-size: var(--text-xs);
    line-height: 1.5;
    color: var(--color-text-secondary);
}
.toast-decision-timer b {
    font-variant-numeric: tabular-nums;
    color: var(--color-text);
}

/* A barra ENCHE com o tempo que passou, como na referência; a dos avisos
   esvazia, mas lá o que se lê é o que resta de um aviso, e aqui é a pergunta
   a acabar. */
.toast-decision-bar {
    position: absolute;
    inset: auto 0 0 0;
    height: 3px;
}
.toast-decision-bar > span {
    display: block;
    height: 100%;
    background: var(--color-primary);
    transform: scaleX(0);
    transform-origin: left center;
    animation: toast-decision-fill linear 1 forwards;
    animation-play-state: paused;
}
.toast-notification-decision.is-danger .toast-decision-bar > span { background: var(--color-danger); }

@keyframes toast-decision-fill {
    from { transform: scaleX(0); }
    to   { transform: scaleX(1); }
}
@keyframes toast-decision-in {
    from { opacity: 0; }
    to   { opacity: 1; }
}

@media (prefers-reduced-motion: reduce) {
    .toast-decision-body { animation: none; }
}

/* ═══ Toast: as variantes ═══ */

/* O aviso do toque de uma chamada: a superfície da casa, sem o recheio do
   hospedeiro (o recheio é do cartão), e a barra do tempo na cor do ponto que
   pulsa (verde a receber, azul a chamar) sobre a hairline. */
.toast-notification.toast-notification-call {
    background: var(--color-surface, #1a1d27);
    color: var(--color-text, #e8eaf0);
    border: 1px solid var(--color-surface-hover, #272a38);
    border-radius: 14px;
    box-shadow: 0 20px 50px -20px rgba(0, 0, 0, .55);
    padding: 0;
}
.toast-notification.toast-notification-call .toast-notification-wrapper { padding-right: 0; }
.toast-notification.toast-notification-call .toast-notification-content {
    margin: 0;
    color: inherit;
    font-size: inherit;
}
.toast-notification.toast-notification-call .progress {
    height: 3px;
    background-color: var(--color-border);
}
.toast-notification.toast-notification-call .progress-bar-inner { background-color: var(--color-green); }
.toast-notification.toast-notification-call:has(.pct-outgoing) .progress-bar-inner { background-color: var(--color-blue); }

/* O aviso de quem entra: vidro, como a ilha das chamadas, recortado para a
   barra do tempo não passar os cantos, com a tinta do vidro nos dois temas. */
.toast-notification.toast-notification-presence {
    overflow: hidden;
    background: var(--glass-island-bg, var(--backdrop-glass-bg));
    -webkit-backdrop-filter: var(--backdrop-glass-filter);
    backdrop-filter: var(--backdrop-glass-filter);
    border: 1px solid var(--glass-fill);
    border-radius: var(--radius-xl);
    color: var(--glass-ink);
    box-shadow: var(--shadow-lg); /* ds-ok: flutua sobre o CMS, e a sombra é o que o separa dele */
    padding: 0;
}
.toast-notification.toast-notification-presence .toast-notification-wrapper { padding-right: 0; }
.toast-notification.toast-notification-presence .toast-notification-content { margin: 0; color: inherit; font-size: inherit; }
.toast-notification.toast-notification-presence .progress {
    height: 3px;
    background-color: var(--glass-fill);
}
.toast-notification.toast-notification-presence .progress-bar-inner { background-color: var(--color-green, #16a34a); }
