/* Explain: Styles to prevent horizontal scrolling and fit content to screen width. */
/* ===================================================================
   FIT TO SCREEN — Knowledge School
   -------------------------------------------------------------------
   Garante que NENHUMA página do site (desktop e telemóvel) cria
   scroll horizontal (esquerda / direita). Todo o conteúdo reflui para
   caber no ecrã: as tabelas encolhem, os valores mantêm-se inteiros
   e os textos longos quebram dentro da caixa em vez de esticar a
   página. Carregado por último para prevalecer sobre as restantes.
   =================================================================== */

/* ---------- 1. Nunca alargar a página além do ecrã ---------- */
body {
    max-width: 100%;
    overflow-x: hidden;
}

main,
header,
footer,
section,
.ks-shell,
.ks-shell-portal {
    max-width: 100%;
}

img,
svg,
video,
canvas,
iframe {
    max-width: 100%;
}

img,
video,
canvas,
svg {
    height: auto;
}

/* ---------- 2. Caixas flexíveis podem encolher abaixo do conteúdo ---------- */
.portal-panel,
.portal-card,
.portal-row,
.portal-stat,
.ks-card {
    min-width: 0;
}

/* ---------- 3. Textos longos (emails, ligações, códigos) quebram na caixa ---------- */
td,
th,
dd,
dt,
p,
li,
a,
span,
strong,
.portal-panel,
.portal-row dd,
.portal-stat-value,
.portal-stat-label {
    overflow-wrap: break-word;
    word-break: normal;
    -webkit-hyphens: none;
    hyphens: none;
}

/* ---------- 4. Tabelas cabem sempre inteiras dentro do ecrã ---------- */
table {
    width: 100%;
    max-width: 100%;
    min-width: 0 !important;
}

.agenda-grid,
.agenda-cell,
.portal-table,
.price-table,
.att-grid,
#signupPricePreview .portal-table {
    min-width: 0 !important;
}

.portal-table th,
.portal-table td,
.price-table th,
.price-table td,
.att-grid th,
.att-grid td,
.agenda-grid th,
.agenda-grid td,
table th,
table td {
    white-space: normal;
    overflow-wrap: break-word;
    word-break: normal;
    hyphens: none;
    min-width: 0;
}

/* Valores e números permanecem numa só linha, sem partir */
.portal-table th.portal-num,
.portal-table td.portal-num,
.price-table th,
.price-table td {
    white-space: nowrap;
}

/* Os contentores deixam de rolar: a tabela reflui para caber */
.overflow-x-auto,
.portal-table-scroll,
.portal-table-wrap,
.agenda-wrap {
    overflow-x: hidden;
    max-width: 100%;
}

/* ---------- 5. Grelhas densas: letras mais pequenas para caberem todas ---------- */
.agenda-grid {
    font-size: .7rem;
}

.att-grid {
    font-size: .72rem;
}

.agenda-grid th,
.agenda-grid td,
.att-grid th,
.att-grid td {
    padding: .22rem .2rem;
}

.agenda-select {
    font-size: .66rem;
}