/* POS móvel da Bilheteira d'Os Músicos (PWA para a secretaria e a direção).
   Herda DESIGN.md e consola.css: papel claro, filetes em vez de caixas, ouro só na ação principal,
   Archivo condensada nos letreiros e números, Inter no texto, JetBrains Mono nas referências.
   Uma mão, em pé, com pressa: alvos de 48 px (lugares de 44 px), ação principal sempre na barra de baixo.
   Sem sombras, sem cápsulas, sem barra lateral de cor. Prefixo .p-. Ver ESPEC.md. */
:root {
    --carvao: #212125;
    --cinza: #45454C;
    --cinza-medio: #77777E;   /* contornos de campos, 3:1 sobre o papel */
    --cinza-claro: #BCBCBC;
    --ouro: #E9B220;
    --ouro-texto: #7A5A00;    /* 5,9:1 sobre o papel */
    --ouro-suave: #F7E7B4;
    --papel: #FAF6EC;
    --papel-2: #F2ECDD;
    --papel-3: #FFFDF7;
    --ok: #1E6B3A;     --ok-suave: #E4F0E2;
    --alerta: #8A4500; --alerta-suave: #FBE7CC;
    --erro: #A3241B;   --erro-suave: #F6DEDA;
    --mobilidade: #1F5FA8;    /* só no lugar de mobilidade condicionada: 6,1:1 sobre papel-3, 3,6:1 sobre o ouro */
    --letreiro: 'Archivo', 'Arial Narrow', sans-serif;
    --texto: 'Inter', system-ui, sans-serif;
    --mono: 'JetBrains Mono', ui-monospace, monospace;
    --topo: 56px;
    --barra: 80px;
    --lugar: 44px;
    --passo: 48px;            /* lugar + 4 px de espaço */
}
* { margin: 0; padding: 0; box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html { -webkit-text-size-adjust: 100%; }
body {
    font-family: var(--texto); font-size: 15px; line-height: 1.45; color: var(--carvao);
    background: var(--papel); font-variant-numeric: tabular-nums; overflow-x: hidden;
    min-height: 100vh; padding-bottom: calc(var(--barra) + 16px + env(safe-area-inset-bottom));
}
button, input, textarea { font: inherit; color: inherit; }
a { color: var(--ouro-texto); text-underline-offset: 3px; }
.mono { font-family: var(--mono); font-size: 0.92em; letter-spacing: 0.02em; }
.cinza { color: var(--cinza); }
.peq { font-size: 13px; }
.num { text-align: right; white-space: nowrap; }
.ico { width: 20px; height: 20px; flex: none; stroke: currentColor; fill: none; stroke-width: 2; stroke-linecap: square; stroke-linejoin: miter; }
.sem-maiusc { text-transform: none; }
.so-leitor { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

/* letreiros */
.sobre { font-family: var(--letreiro); font-stretch: 75%; font-weight: 700; font-size: 12px; letter-spacing: 0.16em; text-transform: uppercase; color: var(--ouro-texto); }
.p-h1 { font-family: var(--letreiro); font-stretch: 68%; font-weight: 800; text-transform: uppercase; font-size: 34px; line-height: 0.95; }
.p-h2 {
    font-family: var(--letreiro); font-stretch: 75%; font-weight: 800; text-transform: uppercase; letter-spacing: 0.06em;
    font-size: 13px; display: flex; align-items: center; gap: 10px; margin: 0 0 6px;
}
.p-h2::after { content: ''; flex: 1; border-top: 1px solid var(--carvao); }
.p-h2 .extra { order: 2; font-family: var(--texto); font-stretch: 100%; font-weight: 400; text-transform: none; letter-spacing: 0; color: var(--cinza); font-size: 13px; }

/* ---------- moldura: topo fixo + conteúdo + barra de baixo fixa ---------- */
.p-topo {
    position: sticky; top: 0; z-index: 5; height: var(--topo); display: flex; align-items: center; gap: 4px;
    padding: 0 12px 0 4px; background: var(--papel); border-bottom: 1.5px solid var(--carvao);
}
.p-topo .voltar { width: 48px; height: 48px; display: grid; place-items: center; background: none; border: 0; cursor: pointer; flex: none; }
.p-topo .voltar .ico { width: 24px; height: 24px; }
.p-topo .titulo { font-family: var(--letreiro); font-stretch: 72%; font-weight: 800; font-size: 20px; letter-spacing: 0.04em; text-transform: uppercase; flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.p-topo .contexto { text-align: right; line-height: 1.1; flex: none; }
.p-topo .contexto b { display: block; font-family: var(--letreiro); font-stretch: 72%; font-weight: 800; font-size: 20px; }
.p-topo .contexto span { font-family: var(--letreiro); font-stretch: 80%; font-weight: 700; font-size: 11.5px; letter-spacing: 0.12em; text-transform: uppercase; color: var(--cinza); }
.p-topo .logo { height: 30px; width: auto; display: block; margin-left: 10px; }
.p-main { padding: 16px 16px 8px; }
.p-sec { margin-top: 22px; }

.p-barra {
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 6; background: var(--papel);
    border-top: 1.5px solid var(--carvao); padding: 12px 16px calc(12px + env(safe-area-inset-bottom));
    display: flex; align-items: center; gap: 12px; min-height: var(--barra);
}
.p-barra .total { flex: 1; min-width: 0; line-height: 1.15; }
.p-barra .total small { display: block; font-size: 12.5px; color: var(--cinza); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.p-barra .total b { font-family: var(--letreiro); font-stretch: 70%; font-weight: 800; font-size: 30px; line-height: 1; white-space: nowrap; }
.p-barra .btn { min-height: 56px; flex: none; }
.p-barra.so-botao .btn { flex: 1; }

/* ---------- botões e campos ---------- */
.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 8px;
    min-height: 48px; padding: 0 18px; border-radius: 2px; border: 1.5px solid var(--carvao);
    font-family: var(--letreiro); font-weight: 700; font-stretch: 85%; font-size: 16px; letter-spacing: 0.04em; text-transform: uppercase;
    background: transparent; color: var(--carvao); cursor: pointer; text-decoration: none; white-space: nowrap;
}
.btn:active { background: var(--carvao); color: var(--papel); }
.btn-ouro { background: var(--ouro); }
.btn-ouro:active { background: var(--carvao); color: var(--ouro); }
.btn-bloco { width: 100%; }
.btn[disabled] { background: var(--papel-2); border-color: var(--cinza-claro); color: var(--cinza); cursor: not-allowed; }
.btn-txt { background: none; border: 0; min-height: 48px; padding: 0 2px; font: 600 15px var(--texto); color: var(--ouro-texto); text-decoration: underline; text-underline-offset: 3px; cursor: pointer; display: inline-flex; align-items: center; }
.btn:focus-visible, .btn-txt:focus-visible, .p-entrada:focus, .lug:focus-visible, .p-op:focus-visible { outline: 3px solid var(--ouro); outline-offset: 2px; }

.p-campo { display: grid; gap: 6px; }
.p-campo label, .p-rot { font-weight: 600; font-size: 13px; }
.p-entrada {
    height: 52px; width: 100%; padding: 0 14px; border: 1.5px solid var(--cinza-medio); border-radius: 2px;
    background: var(--papel-3); font-size: 16px; /* 16 px: o iOS não amplia */
}
.p-entrada::placeholder { color: var(--cinza-medio); }
.p-ajuda { font-size: 13px; color: var(--cinza); }

/* opções grandes (local, método, sessão): retângulos, o escolhido a carvão */
.p-opcoes { display: grid; gap: 8px; }
.p-opcoes.duas { grid-template-columns: 1fr 1fr; }
.p-op {
    min-height: 64px; padding: 10px 14px; border: 1.5px solid var(--carvao); border-radius: 2px; background: var(--papel-3);
    text-align: left; display: flex; flex-direction: column; justify-content: center; cursor: pointer; width: 100%;
}
.p-op b { font-family: var(--letreiro); font-stretch: 75%; font-weight: 800; font-size: 20px; text-transform: uppercase; letter-spacing: 0.03em; line-height: 1.05; }
.p-op span { font-size: 13px; color: var(--cinza); }
.p-op[aria-pressed="true"] { background: var(--carvao); color: var(--papel); }
.p-op[aria-pressed="true"] span { color: var(--cinza-claro); }
.p-op[aria-pressed="true"] b::before { content: ''; display: inline-block; width: 14px; height: 8px; border-left: 3px solid var(--ouro); border-bottom: 3px solid var(--ouro); transform: rotate(-45deg) translate(2px, -3px); margin-right: 8px; }

/* segmentos (separadores do mapa, métodos de pagamento) */
.p-seg { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; border: 1.5px solid var(--carvao); border-radius: 2px; }
.p-seg > * {
    min-height: 48px; border: 0; background: var(--papel-3); cursor: pointer; padding: 4px 6px;
    font-family: var(--letreiro); font-stretch: 78%; font-weight: 800; font-size: 15px; letter-spacing: 0.04em; text-transform: uppercase;
    display: flex; flex-direction: column; align-items: center; justify-content: center; line-height: 1.05; text-decoration: none; color: var(--carvao);
}
.p-seg > * + * { border-left: 1.5px solid var(--carvao); }
.p-seg > * small { font-family: var(--texto); font-stretch: 100%; font-weight: 500; text-transform: none; letter-spacing: 0; font-size: 11.5px; color: var(--cinza); margin-top: 2px; }
.p-seg > [aria-selected="true"] { background: var(--carvao); color: var(--papel); }
.p-seg > [aria-selected="true"] small { color: var(--ouro); }
.p-seg .geral { flex: none; }
.p-seg.com-geral { grid-template-columns: 52px; grid-auto-columns: 1fr; }

/* contador (crianças ao colo) */
.p-contador { display: inline-grid; grid-template-columns: 52px 48px 52px; border: 1.5px solid var(--carvao); border-radius: 2px; height: 52px; background: var(--papel-3); }
.p-contador button { border: 0; background: none; font: 700 24px var(--texto); cursor: pointer; }
.p-contador button[disabled] { color: var(--cinza-claro); }
.p-contador span { display: grid; place-items: center; border-left: 1px solid var(--cinza-claro); border-right: 1px solid var(--cinza-claro); font-family: var(--letreiro); font-stretch: 75%; font-weight: 800; font-size: 24px; }

/* etiquetas de estado (retângulo, contorno, ícone e palavra) */
.est {
    display: inline-flex; align-items: center; gap: 5px; height: 24px; padding: 0 7px; border: 1px solid currentColor; border-radius: 2px;
    font-family: var(--letreiro); font-stretch: 80%; font-weight: 700; font-size: 12px; letter-spacing: 0.06em; text-transform: uppercase; white-space: nowrap;
}
.est .ico { width: 13px; height: 13px; stroke-width: 2.5; }
.est-ok { color: var(--ok); background: var(--ok-suave); }
.est-alerta { color: var(--alerta); background: var(--alerta-suave); }
.est-erro { color: var(--erro); background: var(--erro-suave); }
.est-neutro { color: var(--cinza); background: var(--papel-2); }
.est-convite { color: var(--carvao); background: var(--ouro-suave); }

/* lista pontilhada (programa de sala) */
.p-pontos { list-style: none; }
.p-pontos li { display: flex; align-items: baseline; gap: 6px; min-height: 40px; padding: 8px 0; border-bottom: 1px solid var(--cinza-claro); }
.p-pontos li .pt { flex: 1; border-bottom: 1.5px dotted var(--cinza-claro); transform: translateY(-4px); min-width: 12px; }
.p-pontos li b, .p-pontos li .v { font-family: var(--letreiro); font-stretch: 75%; font-weight: 800; font-size: 19px; white-space: nowrap; }
.p-pontos li.forte { border-top: 1.5px solid var(--carvao); border-bottom: 1.5px solid var(--carvao); }
.p-pontos li.forte b { font-size: 24px; }

/* ---------- login ---------- */
.p-login { padding: 40px 20px 0; }
.p-login .logo { width: 150px; height: auto; display: block; margin-bottom: 36px; }
.p-login .p-h1 { font-size: 48px; margin: 6px 0 10px; }
.p-codigo { display: grid; grid-template-columns: repeat(6, 1fr); gap: 8px; margin: 18px 0 8px; }
.p-codigo input {
    height: 60px; width: 100%; text-align: center; border: 1.5px solid var(--cinza-medio); border-radius: 2px; background: var(--papel-3);
    font-family: var(--letreiro); font-stretch: 75%; font-weight: 800; font-size: 30px;
}
.p-codigo input.cheio { border-color: var(--carvao); border-width: 2px; }
.p-codigo input.atual { outline: 3px solid var(--ouro); outline-offset: 1px; }

/* ---------- início ---------- */
.p-sessoes { list-style: none; border-top: 1.5px solid var(--carvao); }
.p-sessoes li { border-bottom: 1px solid var(--cinza-claro); }
.p-sessoes button {
    width: 100%; min-height: 68px; display: grid; grid-template-columns: 84px 1fr auto; align-items: center; gap: 10px;
    background: none; border: 0; text-align: left; padding: 6px 10px 6px 0; cursor: pointer;
}
.p-sessoes .h { font-family: var(--letreiro); font-stretch: 65%; font-weight: 800; font-size: 34px; line-height: 1; padding-left: 10px; }
.p-sessoes .det { font-size: 13px; color: var(--cinza); line-height: 1.3; }
.p-sessoes .livres { text-align: right; line-height: 1; }
.p-sessoes .livres b { display: block; font-family: var(--letreiro); font-stretch: 70%; font-weight: 800; font-size: 26px; }
.p-sessoes .livres span { font-size: 12px; color: var(--cinza); }
.p-sessoes button[aria-pressed="true"] { background: var(--carvao); color: var(--papel); }
.p-sessoes button[aria-pressed="true"] .det, .p-sessoes button[aria-pressed="true"] .livres span { color: var(--cinza-claro); }
.p-sessoes button[aria-pressed="true"] .livres b { color: var(--ouro); }
.p-sessoes button[disabled] { color: var(--cinza-medio); cursor: not-allowed; }
.p-caixa { display: flex; align-items: center; gap: 12px; padding: 12px 0; border-top: 1.5px solid var(--carvao); border-bottom: 1.5px solid var(--carvao); }
.p-caixa .txt { flex: 1; min-width: 0; font-size: 13px; color: var(--cinza); }
.p-caixa .txt b { display: block; color: var(--carvao); font-size: 15px; }

/* ---------- legenda do mapa ---------- */
.p-legenda { display: flex; flex-wrap: wrap; gap: 4px 12px; font-size: 12.5px; color: var(--cinza); margin: 10px 0 8px; }
.p-legenda span { display: inline-flex; align-items: center; gap: 5px; white-space: nowrap; }
.p-legenda svg { flex: none; }

/* ---------- mapa: vista geral (planta inteira em pequeno) ---------- */
.p-geral { position: relative; border-top: 1.5px solid var(--carvao); border-bottom: 1.5px solid var(--carvao); background: var(--papel-3); padding: 8px 0 6px; }
.p-geral > svg { display: block; width: 100%; height: auto; }
.p-geral .palco { fill: none; stroke: var(--carvao); stroke-width: 0.06; }
.p-geral text { font-family: var(--letreiro); font-stretch: 75%; font-weight: 700; fill: var(--cinza); }
.p-geral .fila { font-size: 0.55px; fill: var(--carvao); }
.p-geral .zona-res { fill: none; stroke: var(--cinza); stroke-width: 0.05; stroke-dasharray: 0.14 0.1; }
.p-geral .zona-zoom { fill: none; stroke: var(--carvao); stroke-width: 0.06; stroke-dasharray: 0.3 0.15; }
.p-geral .zona-nome { font-size: 0.5px; letter-spacing: 0.08px; fill: var(--carvao); }
.p-geral .g rect { fill: var(--papel-3); stroke: var(--carvao); stroke-width: 0.07; }
.p-geral .g.o rect { fill: var(--cinza-claro); stroke: var(--cinza-claro); }
.p-geral .g.r rect { fill: url(#hatch); stroke: var(--cinza-medio); stroke-width: 0.04; }
.p-geral .g.s rect { fill: var(--ouro); stroke: var(--carvao); stroke-width: 0.16; }
.p-geral .g.m rect { stroke: var(--mobilidade); stroke-width: 0.16; }
.p-geral .g.m.o rect { stroke: var(--mobilidade); fill: var(--cinza-claro); }
.p-geral .g.vip rect { stroke-width: 0.14; }
.p-dica .btn { min-height: 48px; }
.p-zonas { list-style: none; display: grid; gap: 8px; margin-top: 12px; }
.p-zonas a {
    display: grid; grid-template-columns: 1fr auto 20px; align-items: center; gap: 10px; min-height: 56px; padding: 0 12px;
    border: 1.5px solid var(--carvao); border-radius: 2px; background: var(--papel-3); color: var(--carvao); text-decoration: none;
}
.p-zonas a b { font-family: var(--letreiro); font-stretch: 75%; font-weight: 800; font-size: 19px; text-transform: uppercase; letter-spacing: 0.03em; }
.p-zonas a b small { font-family: var(--texto); font-stretch: 100%; font-weight: 500; font-size: 13px; text-transform: none; letter-spacing: 0; color: var(--cinza); margin-left: 6px; }
.p-zonas a .n { font-size: 13px; color: var(--cinza); text-align: right; line-height: 1.15; }
.p-zonas a .n b { font-size: 22px; display: block; color: var(--carvao); }
.p-zonas a .n b.sel { color: var(--ouro-texto); font-size: 17px; text-transform: none; letter-spacing: 0; }
.p-zonas a > b { white-space: nowrap; }

/* ---------- mapa com zoom: lugares de 44 px, deslize na horizontal ---------- */
.p-mapa { border-top: 1.5px solid var(--carvao); border-bottom: 1.5px solid var(--carvao); background: var(--papel-3); margin: 0 -16px; }
.p-mapa-scroll { overflow-x: auto; overscroll-behavior-x: contain; scrollbar-width: none; padding: 10px 0 12px; }
.p-mapa-scroll::-webkit-scrollbar { display: none; }
.p-sala { width: max-content; }
.p-palco { margin: 0 32px 12px; height: 26px; border-bottom: 2px solid var(--carvao); border-radius: 0 0 50% 50% / 0 0 100% 100%; display: grid; place-items: center;
    font-family: var(--letreiro); font-stretch: 75%; font-weight: 800; font-size: 12px; letter-spacing: 0.4em; color: var(--cinza); }
.p-aviso-zona { margin: 0 32px 8px; justify-content: center !important; font-family: var(--letreiro); font-stretch: 78%; font-weight: 700; font-size: 12px; letter-spacing: 0.12em; text-transform: uppercase; color: var(--cinza); display: flex; justify-content: space-between; }
.p-fila { display: flex; align-items: center; height: var(--passo); }
.p-fila .letra {
    position: sticky; z-index: 2; width: 32px; height: var(--passo); flex: none; display: grid; place-items: center;
    font-family: var(--letreiro); font-stretch: 75%; font-weight: 800; font-size: 18px; background: var(--papel-3);
}
.p-fila .letra.esq { left: 0; border-right: 1px solid var(--cinza-claro); }
.p-fila .letra.dir { right: 0; border-left: 1px solid var(--cinza-claro); }
.p-fila .faixa { position: relative; height: var(--passo); flex: none; }
.p-bloco-res { position: absolute; border: 1.5px dashed var(--cinza); pointer-events: none; }
.p-bloco-res span { position: absolute; top: -20px; left: 0; font-family: var(--letreiro); font-stretch: 78%; font-weight: 700; font-size: 11.5px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--cinza); white-space: nowrap; }

.lug {
    position: absolute; top: 2px; width: var(--lugar); height: var(--lugar); border: 1.5px solid var(--carvao); border-radius: 2px;
    background: var(--papel-3); cursor: pointer; padding: 0; display: grid; place-items: center; line-height: 1;
    font-family: var(--letreiro); font-stretch: 78%; font-weight: 800; font-size: 17px; color: var(--carvao);
}
.lug .vip { position: absolute; top: 3px; left: 0; right: 0; text-align: center; font-size: 9px; letter-spacing: 0.12em; font-weight: 700; }
.lug.vip-l { border: 5px double var(--carvao); padding-top: 9px; }
.lug.vip-l .vip { top: 2px; }
.lug.ocu { background: var(--cinza-claro); border-color: var(--cinza-claro); color: var(--cinza); font-weight: 600; cursor: not-allowed; }
.lug.ocu.vip-l { border-color: var(--cinza); }
.lug.res { background: repeating-linear-gradient(45deg, var(--papel-2) 0 5px, var(--cinza-claro) 5px 6.5px); border: 1px solid var(--cinza-medio); color: var(--cinza); font-weight: 600; cursor: not-allowed; }
.lug.mob { border: 3px solid var(--mobilidade); padding-bottom: 12px; }
.lug.mob .cadeira { position: absolute; bottom: 2px; left: 50%; width: 16px; height: 16px; margin-left: -8px; color: var(--mobilidade); }
.lug.mob.ocu { background: var(--cinza-claro); }
.lug.sel { background: var(--ouro); border-width: 3px; }
.lug.sel.mob { border-color: var(--mobilidade); }
.lug.sel .visto { position: absolute; top: -7px; right: -7px; width: 18px; height: 18px; background: var(--carvao); color: var(--ouro); display: grid; place-items: center; border-radius: 2px; }
.lug.sel .visto svg { width: 12px; height: 12px; stroke-width: 3; }

.p-posicao { margin: 8px 0 0; height: 6px; background: var(--papel-2); position: relative; }
.p-posicao i { position: absolute; top: 0; bottom: 0; background: var(--carvao); }
.p-dica { font-size: 12.5px; color: var(--cinza); margin-top: 6px; display: flex; justify-content: space-between; gap: 8px; }

.p-escolhidos { list-style: none; display: flex; flex-wrap: wrap; gap: 6px; }
.p-escolhidos li {
    display: inline-flex; align-items: center; gap: 4px; height: 52px; padding: 0 2px 0 12px; border: 1.5px solid var(--carvao); border-radius: 2px; background: var(--ouro-suave);
    font-family: var(--letreiro); font-stretch: 78%; font-weight: 800; font-size: 17px;
}
.p-escolhidos li small { font-family: var(--texto); font-stretch: 100%; font-weight: 500; font-size: 12.5px; color: var(--cinza); margin-left: 4px; }
.p-escolhidos li button { width: 44px; height: 48px; border: 0; background: none; display: grid; place-items: center; cursor: pointer; }
.p-escolhidos li button .ico { width: 16px; height: 16px; }

/* ---------- família e convites ---------- */
.p-procura { position: relative; }
.p-procura .ico { position: absolute; left: 14px; top: 16px; color: var(--cinza); }
.p-procura .p-entrada { padding-left: 44px; }
.p-resultados { list-style: none; border-top: 1.5px solid var(--carvao); margin-top: 12px; }
.p-resultados > li { border-bottom: 1px solid var(--cinza-claro); }
.p-resultados .linha { width: 100%; min-height: 64px; display: grid; grid-template-columns: 1fr auto; gap: 2px 10px; align-items: center; padding: 10px 0; background: none; border: 0; text-align: left; cursor: pointer; }
.p-resultados .nome { font-weight: 600; font-size: 16px; }
.p-resultados mark { background: var(--ouro-suave); color: inherit; }
.p-resultados .det { grid-column: 1 / -1; font-size: 13px; color: var(--cinza); }
.p-resultados li.aberto { background: var(--papel-2); margin: 0 -16px; padding: 0 16px 14px; border-bottom: 1.5px solid var(--carvao); }
.p-aplicar { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 0; border-top: 1px solid var(--cinza-claro); }
.p-aplicar .txt b { display: block; }
.p-aplicar .txt span { font-size: 13px; color: var(--cinza); }

/* ---------- resumo ---------- */
.p-tab { width: 100%; border-collapse: collapse; }
.p-tab th { font-family: var(--letreiro); font-stretch: 80%; font-weight: 700; font-size: 12px; letter-spacing: 0.08em; text-transform: uppercase; text-align: left; padding: 6px 0; border-top: 1.5px solid var(--carvao); border-bottom: 1.5px solid var(--carvao); }
.p-tab td { padding: 0; height: 48px; border-bottom: 1px solid var(--cinza-claro); vertical-align: middle; }
.p-tab .lugar { font-family: var(--letreiro); font-stretch: 75%; font-weight: 800; font-size: 20px; }
.p-tab tr.total td { border-top: 1.5px solid var(--carvao); border-bottom: 1.5px solid var(--carvao); font-weight: 700; }
.p-tab tr.total .num { font-family: var(--letreiro); font-stretch: 70%; font-weight: 800; font-size: 28px; }
.p-iva { font-size: 12.5px; color: var(--cinza); margin-top: 6px; }
.p-linha-ctl { display: flex; align-items: center; justify-content: space-between; gap: 12px; }

/* ---------- pagamento ---------- */
.p-cobrar { display: flex; justify-content: space-between; align-items: baseline; padding: 12px 0 10px; border-bottom: 1px solid var(--cinza-claro); }
.p-cobrar .v { font-family: var(--letreiro); font-stretch: 70%; font-weight: 800; font-size: 30px; }
.p-recebido { display: flex; justify-content: space-between; align-items: center; gap: 12px; height: 64px; padding: 0 14px; margin-top: 10px; border: 2px solid var(--carvao); border-radius: 2px; background: var(--papel-3); }
.p-recebido .rot { font-weight: 600; font-size: 13px; }
.p-recebido .v { font-family: var(--letreiro); font-stretch: 70%; font-weight: 800; font-size: 38px; }
.p-recebido .v::after { content: ''; display: inline-block; width: 2px; height: 30px; background: var(--ouro); margin-left: 3px; vertical-align: -3px; }
.p-rapidos { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; margin-top: 8px; }
.p-rapidos button { min-height: 48px; border: 1.5px solid var(--carvao); border-radius: 2px; background: var(--papel-3); font-family: var(--letreiro); font-stretch: 78%; font-weight: 800; font-size: 17px; cursor: pointer; }
.p-rapidos button[aria-pressed="true"] { background: var(--carvao); color: var(--papel); }
.p-troco { display: flex; justify-content: space-between; align-items: center; margin-top: 10px; padding: 6px 14px; background: var(--carvao); color: var(--papel); border-radius: 2px; }
.p-troco .rot { font-family: var(--letreiro); font-stretch: 75%; font-weight: 800; font-size: 20px; letter-spacing: 0.08em; text-transform: uppercase; }
.p-troco .v { font-family: var(--letreiro); font-stretch: 66%; font-weight: 800; font-size: 60px; line-height: 1; color: var(--ouro); }
.p-teclado { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; margin-top: 10px; }
.p-teclado button { height: 54px; border: 1px solid var(--cinza-claro); border-radius: 2px; background: var(--papel-3); font: 600 24px var(--texto); cursor: pointer; display: grid; place-items: center; }
.p-teclado button.fn { font: 700 14px var(--letreiro); font-stretch: 85%; text-transform: uppercase; letter-spacing: 0.04em; background: var(--papel-2); }
.p-passos { list-style: none; counter-reset: p; border-top: 1.5px solid var(--carvao); }
.p-passos li { counter-increment: p; display: grid; grid-template-columns: 30px 1fr; gap: 6px; padding: 12px 0; border-bottom: 1px solid var(--cinza-claro); }
.p-passos li::before { content: counter(p) "."; font-family: var(--letreiro); font-stretch: 75%; font-weight: 800; font-size: 22px; line-height: 1; }
.p-cobrar-grande { text-align: center; padding: 22px 0 18px; border-top: 1.5px solid var(--carvao); border-bottom: 1.5px solid var(--carvao); background: var(--papel-3); margin: 14px -16px 0; }
.p-cobrar-grande .rot { font-family: var(--letreiro); font-stretch: 78%; font-weight: 700; font-size: 13px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--cinza); }
.p-cobrar-grande .v { font-family: var(--letreiro); font-stretch: 66%; font-weight: 800; font-size: 76px; line-height: 1; margin-top: 4px; }
.p-nota { margin-top: 14px; padding: 10px 12px; border: 1.5px dashed var(--cinza-medio); border-radius: 2px; font-size: 13px; color: var(--cinza); }
.p-nota b { color: var(--carvao); }

/* ---------- sucesso: QR em ecrã inteiro ---------- */
body.sucesso { background: #fff; }
.p-sucesso { padding: 14px 16px 0; text-align: center; }
.p-sucesso .cab { display: flex; justify-content: space-between; align-items: center; gap: 8px; text-align: left; }
.p-sucesso .qr { margin: 18px auto 10px; width: 100%; max-width: 340px; }
.p-sucesso .qr svg { width: 100%; height: auto; display: block; }
.p-sucesso .lugares { font-family: var(--letreiro); font-stretch: 70%; font-weight: 800; font-size: 30px; line-height: 1.05; text-transform: uppercase; }
.p-sucesso .det { font-size: 14px; color: var(--cinza); margin-top: 4px; }
.p-sucesso .lembrete { display: flex; justify-content: space-between; align-items: center; margin-top: 14px; padding: 4px 14px; border: 2px solid var(--carvao); border-radius: 2px; text-align: left; }
.p-sucesso .lembrete .v { font-family: var(--letreiro); font-stretch: 68%; font-weight: 800; font-size: 34px; }
.p-sucesso .acoes { display: grid; gap: 8px; margin-top: 12px; }

/* ---------- fecho de caixa ---------- */
.p-dif { display: flex; justify-content: space-between; align-items: center; gap: 10px; min-height: 48px; padding: 6px 12px; margin-top: 8px; border: 1.5px solid currentColor; border-radius: 2px; font-weight: 600; }
.p-dif .v { font-family: var(--letreiro); font-stretch: 70%; font-weight: 800; font-size: 26px; display: inline-flex; align-items: center; gap: 6px; }
.p-dif.ok { color: var(--ok); background: var(--ok-suave); }
.p-dif.erro { color: var(--erro); background: var(--erro-suave); }
.p-talao { display: grid; grid-template-columns: 64px 1fr auto; align-items: center; gap: 12px; margin-top: 10px; padding: 8px 0; border-top: 1px solid var(--cinza-claro); border-bottom: 1px solid var(--cinza-claro); }
.p-talao .mini { width: 64px; height: 80px; background: repeating-linear-gradient(180deg, #fff 0 6px, var(--papel-2) 6px 8px); border: 1px solid var(--cinza-claro); }
textarea.p-entrada { height: auto; min-height: 76px; padding: 12px 14px; resize: vertical; }

/* ---------- ecrãs pequenos (360 x 640) ---------- */
@media (max-height: 700px) {
    .p-topo { --topo: 52px; height: 52px; }
    .p-main { padding-top: 12px; }
    .p-legenda { margin: 6px 0; gap: 2px 10px; font-size: 12px; }
}
@media (max-width: 370px) {
    .p-h1 { font-size: 30px; }
    .p-seg > * { font-size: 14px; }
    .p-barra .total b { font-size: 27px; }
    .p-barra .btn { padding: 0 14px; }
}

/* ---------- acrescentos da app real (02/12/2026): avisos, modo teste, sem rede, menu, etiquetas dos blocos ---------- */
[hidden] { display: none !important; }
.p-aviso { display: flex; gap: 8px; align-items: flex-start; margin: 12px 0 4px; padding: 10px 12px; border: 1.5px solid currentColor; border-radius: 2px; font-size: 14px; }
.p-aviso .ico { margin-top: 1px; }
.p-aviso.erro { color: var(--erro); background: var(--erro-suave); }
.p-aviso.ok { color: var(--ok); background: var(--ok-suave); }
.p-aviso.nota { color: var(--alerta); background: var(--alerta-suave); }
.p-faixa-teste { background: repeating-linear-gradient(-45deg, var(--ouro-suave) 0 10px, var(--papel) 10px 20px); border-bottom: 1px solid var(--carvao); text-align: center; font-size: 12.5px; font-weight: 600; padding: 4px 8px; }
.p-sem-rede { position: sticky; top: 0; z-index: 9; background: repeating-linear-gradient(-45deg, var(--erro-suave) 0 10px, var(--papel) 10px 20px); color: var(--erro); border-bottom: 1.5px solid var(--erro); text-align: center; font-weight: 700; font-size: 14px; padding: 10px 8px; }
body.sem-rede .p-barra .btn-ouro { background: var(--papel-2); border-color: var(--cinza-claro); color: var(--cinza); pointer-events: none; }
.p-menu { position: sticky; top: var(--topo); z-index: 5; display: grid; background: var(--papel); border-bottom: 1.5px solid var(--carvao); }
.p-menu button { min-height: 52px; text-align: left; padding: 0 16px; background: none; border: 0; border-top: 1px solid var(--cinza-claro); font-weight: 600; cursor: pointer; }
.p-blocos { position: relative; height: 22px; }
.p-blocos span { position: absolute; padding-left: 6px; font-family: var(--letreiro); font-stretch: 78%; font-weight: 700; font-size: 11.5px; letter-spacing: .1em; text-transform: uppercase; color: var(--cinza); white-space: nowrap; }
.p-aviso-sessao { display: flex; gap: 6px; align-items: flex-start; margin-top: 8px; color: var(--alerta); }
.p-barra .total small.alerta { color: var(--erro); font-weight: 700; }
.p-troco.falta { background: var(--erro); }
.p-troco.falta .v { color: var(--papel); }
.p-sucesso .qr img { width: 100%; height: auto; display: block; image-rendering: pixelated; }
.c-vazio { color: var(--cinza); padding: 14px 0; }
.p-op, .p-sessoes button, .p-zonas a, .p-seg > * { -webkit-user-select: none; user-select: none; }
.lug { -webkit-user-select: none; user-select: none; outline: none; }
/* A hora dentro do contexto do topo fica em grande (o span de hm() não herda o estilo do local). */
.p-topo .contexto b span { font: inherit; letter-spacing: 0; text-transform: none; color: inherit; }
