/* Gerado de /css/mobile-shell.css com a paleta do SeuCenoura (app/scripts/gerar-camada-sc.php). Nao editar: editar a original e gerar de novo. */
/* One content scroller, with the header and navigation outside it. */
@media (max-width: 1023px) {
    html:has(body.sn-mobile-shell.logged-in), body.sn-mobile-shell.logged-in {
        height: 100%; overflow: hidden !important; padding-bottom: 0 !important; overscroll-behavior: none;
    }
    body.sn-mobile-shell.logged-in #appWrapper { position: fixed; inset: 0; height: 100dvh; overflow: hidden; }
    html body.sn-mobile-shell.logged-in #mainContent {
        box-sizing: border-box; height: 100dvh; max-height: none; min-height: 0;
        overflow-x: hidden; overflow-y: auto; overscroll-behavior: contain; scroll-behavior: auto;
        padding-top: calc(var(--sn-header-h, var(--header-height, 60px)) + 8px);
        padding-bottom: calc(var(--sn-nav-space, 65px) + 8px) !important;
        scroll-padding: 8px; -webkit-overflow-scrolling: touch;
    }
    body.sn-mobile-shell.scroll-locked #mainContent { overflow: hidden; }
    html body.sn-mobile-shell.chat-ativo #mainContent {
        position: relative; top: var(--vv-top, 0px);
        height: var(--chat-vh, 100dvh) !important; max-height: var(--chat-vh, 100dvh) !important;
        padding-top: calc(var(--sn-header-h, 60px) + 6px);
        padding-bottom: var(--sn-nav-space, 65px) !important;
        overflow: hidden; transition: none;
    }
    /* 16/10/2026 (#703 h): o campo de digitacao encosta no menu (antes sobravam 6 px mais a borda do cartao). */
    html body.sn-mobile-shell.chat-ativo #sec-chat > .card { border-bottom-width: 0; border-bottom-left-radius: 0; border-bottom-right-radius: 0; }
    html.kb-aberto body.sn-mobile-shell.chat-ativo #mainContent { padding-bottom: 0 !important; }
    html.kb-aberto body.sn-mobile-shell.chat-ativo .app-header { top: var(--vv-top, 0px); }
    html body.sn-mobile-shell.chat-ativo #sec-chat > .card { margin: 0; }
    html body.sn-mobile-shell.chat-ativo #sec-chat .card-header { padding: 8px 12px; }
    html body.sn-mobile-shell.chat-ativo #sec-chat .card-header h3 { margin: 0; }
    html body.sn-mobile-shell.chat-ativo .chat-thread .chat-messages { min-height: 0; }
    html body.sn-mobile-shell.chat-ativo .chat-thread .chat-input-area {
        position: static; flex: 0 0 auto; bottom: auto; margin: 0; padding: 6px 10px; transition: none;
    }
    html body.sn-mobile-shell #sec-chat textarea.chat-input {
        min-height: 44px; max-height: min(112px, 24dvh); line-height: 22px;
        padding: 10px 14px; font-size: 16px; resize: none;
    }
    body.sn-mobile-shell #sec-agenda .card-body { padding: 12px; }
    body.sn-mobile-shell #agendaContent > .card:last-child { margin-bottom: 0; }
    body.sn-mobile-shell #sec-agenda .card-header { padding: 12px; }
    body.sn-mobile-shell #sec-agenda .agenda-tabs { margin-bottom: 12px; }
    body.sn-mobile-shell #sec-agenda .appointment-item { padding: 12px; margin-bottom: 10px; }
    body.sn-mobile-shell #sec-agenda .agenda-tab { min-height: 44px; min-width: 0; gap: 5px; padding: 8px 6px; font-size: 12px; white-space: nowrap; }
    body.sn-mobile-shell #sec-agenda .agenda-tab-count { flex: 0 0 auto; }
    body.sn-mobile-shell #sec-agenda .empty-state { padding: 12px 8px; }
    body.sn-mobile-shell #sec-agenda .empty-mascote img { width: 48px; height: 48px; margin: 0 auto 10px; }
    body.sn-mobile-shell #sec-agenda .empty-mascote-title { font-size: 15px; line-height: 1.35; margin: 0 0 8px; }
    body.sn-mobile-shell #sec-agenda .empty-mascote-desc { font-size: 13px; line-height: 1.45; margin: 0 0 12px; }
    body.sn-mobile-shell #sec-agenda .empty-mascote-action { min-height: 44px; margin: 0; padding: 10px 12px; gap: 8px; font-size: 12px; }
    body.sn-mobile-shell #sec-agenda .empty-mascote-action :is(i, svg, [data-lucide]) { width: 18px; height: 18px; font-size: 18px; flex: 0 0 18px; margin: 0; }
    body.sn-mobile-shell #sec-treino .tk-hero { padding: 12px 14px; }
    body.sn-mobile-shell #sec-treino .tk-hero-num { margin-top: 8px; }
    body.sn-mobile-shell #sec-treino .tk-hero-num strong { font-size: 38px; }
    body.sn-mobile-shell #sec-treino .tk-hero-num span { font-size: 13px; }
    body.sn-mobile-shell #sec-treino .tk-hero-rodape { margin-top: 6px; }
    body.sn-mobile-shell #sec-treino .tk-hero-cta { min-height: 44px; margin-top: 10px; font-size: 14px; }
    body.sn-mobile-shell #sec-treino .tk-vazio { padding: 10px 8px; font-size: 12px; }
    body.sn-mobile-shell #sec-treino .tk-secao { gap: 6px; }
}
@media (min-width: 560px) and (max-width: 1023px) and (max-height: 460px) {
    body.sn-mobile-shell #sec-treino .tk-wrap:not(:has(.tk-form:not([hidden]))) { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 10px; }
    body.sn-mobile-shell #sec-treino .tk-wrap:not(:has(.tk-form:not([hidden]))) #tkHoje { grid-column: 1; grid-row: 1 / 3; align-self: start; }
    body.sn-mobile-shell #sec-treino .tk-wrap:not(:has(.tk-form:not([hidden]))) .tk-secao { grid-column: 2; }
    body.sn-mobile-shell #sec-agenda .card-header { display: none; }
    body.sn-mobile-shell #sec-agenda .empty-mascote { display: grid; grid-template-columns: minmax(0, 1fr) minmax(160px, .8fr); align-items: center; gap: 6px 14px; padding: 8px; }
    body.sn-mobile-shell #sec-agenda .empty-mascote img { display: none; }
    body.sn-mobile-shell #sec-agenda .empty-mascote-title, body.sn-mobile-shell #sec-agenda .empty-mascote-desc { grid-column: 1; margin: 0; }
    body.sn-mobile-shell #sec-agenda .empty-mascote-action { grid-column: 2; grid-row: 1 / 3; }
}
.chat-retry { display: inline-flex; align-items: center; min-height: 44px; color: inherit; border: 1px solid currentColor; background: transparent; padding: 6px 10px; border-radius: 8px; font: inherit; cursor: pointer; }
.chat-msg[data-send-state="pending"] { opacity: .8; }
/* Um Voltar oculto pela rolagem também sai da navegação por teclado.
   Se já tinha foco, permanece visível até a pessoa mover o foco. */
body.back-btn-oculto .page-back-btn:not(:focus-within) { visibility: hidden; }
body.back-btn-oculto .page-back-btn:focus-within { opacity: 1; pointer-events: auto; transform: none; }
@media (prefers-reduced-motion: reduce) { .chat-messages { scroll-behavior: auto; } }
/* 16/10/2026 (dono): no assistente SeuCenoura o teclado cobria o campo de digitação. A janela passa a
   ocupar exatamente a área visível (--vv-top e --vvh, medidas por chat-keyboard.js pela visualViewport
   e pelos eventos do teclado do Capacitor), em vez de descontar --kb-h de uma janela presa ao fundo da
   tela: vale igual para teclado que recua a página, que se sobrepõe a ela ou que o WebView não informa. */
html.kb-aberto .sc-modal.open { inset: auto 0 auto 0; top: var(--vv-top, 0px); height: var(--vvh, 100dvh); padding-bottom: 0; align-items: flex-end; }
html.kb-aberto .sc-modal.open .sc-modal-inner { height: min(92dvh, var(--vvh, 92dvh)); max-height: var(--vvh, 92dvh); min-height: 160px; }
.sc-modal.open .sc-input-bar { position: sticky; bottom: 0; }
.cm-img-link { display: block; cursor: pointer; }
.cm-img-link:focus-visible { outline: 3px solid var(--brand-primary-dark, #3d6041); outline-offset: 2px; border-radius: 12px; }
