/* Estilos da agenda (/agenda, Pages/Calendar.razor). Carregado globalmente pelo App.razor, então
   toda regra aqui só pode casar com markup da agenda (agenda-*, appt-*, dt-*...). Regras com classes
   usadas em outras telas (story-*, as mesmas do ShareStoryButton) ou que mudam globais do Bootstrap
   (z-index de .modal) ficam no <style> inline do Calendar.razor, valendo só com a agenda aberta. */

/* Modal de atendimento: header fixo / corpo que rola / rodapé fixo com o botão principal.
   No celular (abaixo de 576px, modal-fullscreen-sm-down) vira tela cheia; no desktop continua popup,
   com teto de altura pra o corpo rolar por dentro em vez da página. */
.appt-modal .modal-content {
    overflow: hidden;
    max-height: calc(100dvh - 3.5rem);
}

.appt-form {
    display: flex;
    flex-direction: column;
    flex: 1 1 auto;
    min-height: 0;
}

/* Grid 1fr/auto/1fr: título fica centralizado não importa a largura dos lados
   (✕ de 44px no formulário, "‹ Voltar" nas sub-telas). */
.appt-header {
    flex: 0 0 56px;
    display: grid;
    grid-template-columns: 1fr minmax(0, auto) 1fr;
    align-items: center;
    gap: .25rem;
    padding: 0 .375rem;
    border-bottom: 1px solid var(--uc-line);
}

.appt-header > :first-child {
    justify-self: start;
}

.appt-title {
    min-width: 0;
    margin: 0;
    text-align: center;
    font-size: 17px;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.appt-icon-btn,
.appt-icon-btn-spacer {
    width: 44px;
    height: 44px;
    flex-shrink: 0;
}

.appt-icon-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    border: 0;
    border-radius: 50%;
    background: transparent;
    color: var(--uc-ink-2);
    font-size: 18px;
    cursor: pointer;
}

/* Mesmo visual do toggle Dia/Semana/Mês da agenda (.agenda-view-toggle). */
.appt-segmented {
    flex-shrink: 0;
    display: flex;
    gap: 2px;
    margin: 0 0 .75rem;
    padding: 3px;
    border-radius: 12px;
    background-color: var(--uc-track);
}

.appt-segmented button {
    flex: 1;
    height: 44px;
    border: 0;
    border-radius: 9px;
    background: transparent;
    color: var(--uc-ink-2);
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
}

.appt-segmented button[aria-pressed="true"] {
    background-color: var(--uc-brand);
    color: var(--uc-brand-on);
}

.appt-body {
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: contain;
    padding: .5rem 1rem 1rem;
}

/* Edição (sem o seletor de tipo): corpo logo abaixo do header, precisa do próprio respiro. */
.appt-header + .appt-body {
    padding-top: 1rem;
}

/* Editando, a primeira linha encosta no header: o filete dela dobraria o do header. */
.appt-header + .appt-body > .appt-row-wrap:first-child {
    border-top: 0;
}

.appt-footer {
    flex-shrink: 0;
    padding: .75rem 1rem calc(.75rem + env(safe-area-inset-bottom));
    border-top: 1px solid var(--uc-line);
    background-color: var(--uc-surface);
}

.appt-footer-row {
    display: flex;
    gap: .5rem;
}

.appt-primary-btn {
    flex: 1 1 auto;
    min-width: 0;
    width: 100%;
    height: 52px;
    font-size: 16px;
    font-weight: 600;
}

.appt-more-btn {
    flex: 0 0 52px;
    height: 52px;
    padding: 0;
    font-size: 20px;
}

.appt-delete-btn:disabled {
    color: var(--uc-disabled-ink) !important;
    cursor: default;
}

.appt-footer .appt-footer-noshow {
    margin: -.25rem 0 .75rem;
}

@media (max-width: 575.98px) {
    /* rounded-4 é !important (utilitário do Bootstrap), então a tela cheia precisa sobrescrever
       com !important também pra não ficar com cantos arredondados colados na borda da tela. */
    .appt-modal .modal-content {
        max-height: none;
        border-radius: 0 !important;
    }

}

/* iOS/iPadOS Safari não encolhe o layout quando o teclado abre (interactive-widget=resizes-content
   do viewport só vale no Chrome Android) -- sem isso o rodapé fixo ficava atrás do teclado.
   --uc-vv-top/--uc-vv-h vêm do visualViewport, ver trackVisualViewport em scroll-helper.js. */
.appt-modal {
    top: var(--uc-vv-top, 0);
    height: var(--uc-vv-h, 100%);
    bottom: auto;
    /* A camada externa não rola (quem rola é .appt-body / .appt-sub-list) e não repassa o
       arrasto pra página -- antes, deslizar no header/rodapé rolava a agenda por trás. */
    overflow: hidden;
    overscroll-behavior: contain;
}

/* Página travada enquanto o formulário está aberto (classe posta por ucBack em
   scroll-helper.js). Sem isso, no celular a agenda rolava por trás do modal, a barra do
   navegador aparecia/sumia e o modal (que segue o visualViewport) "descia" junto. */
html.uc-modal-open {
    overflow: hidden;
    overscroll-behavior: none;
}

/* body com overflow:hidden vira o scroll container do sticky: no desktop a barra lateral (sticky) deixava de acompanhar
   a rolagem e sumia se a página estava rolada. Só o celular precisa do body travado. */
@media (max-width: 640.98px) {
    html.uc-modal-open body {
        overflow: hidden;
        overscroll-behavior: none;
    }
}

/* Linha do formulário: ícone 40px + rótulo pequeno + valor + chevron, sempre o mesmo formato. */
.appt-row {
    display: flex;
    align-items: center;
    gap: .75rem;
    width: 100%;
    min-height: 72px;
    padding: .5rem 0;
    border: 0;
    border-top: 1px solid var(--uc-line);
    background: transparent;
    color: inherit;
    font: inherit;
    text-align: left;
    cursor: pointer;
}

.appt-row-static {
    cursor: default;
}

/* Linha de cliente + botão WhatsApp lado a lado -- o filete fica no wrapper, não na linha. */
.appt-row-wrap {
    display: flex;
    align-items: center;
    gap: .5rem;
    border-top: 1px solid var(--uc-line);
}

.appt-row-wrap .appt-row {
    flex: 1;
    min-width: 0;
    border-top: 0;
}

.appt-row-icon {
    width: 40px;
    height: 40px;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background-color: var(--uc-surface-soft);
    color: var(--uc-brand);
    font-size: 18px;
}

.appt-row-avatar {
    font-size: 14px;
    font-weight: 600;
}

.appt-row-main {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 1px;
}

.appt-row-main-split {
    display: flex;
    align-items: center;
    gap: .5rem;
    margin-top: .25rem;
}

.appt-row-label {
    font-size: 13px;
    line-height: 1.2;
    color: var(--uc-ink-3);
}

.appt-row-value {
    font-size: 16px;
    font-weight: 600;
    line-height: 1.3;
    color: var(--uc-ink);
    overflow-wrap: anywhere;
}

.appt-row-placeholder {
    font-weight: 500;
    color: var(--uc-ink-3);
}

.appt-row-placeholder.is-error {
    color: var(--uc-error-text);
}

.appt-row-ellipsis {
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.appt-row-sub {
    font-size: 14px;
    color: var(--uc-ink-3);
}

/* Linha "Local": taxa + tempo reservado numa linha; no celular em duas ("+ R$ 20 de deslocamento" / "30 min
   reservados na agenda"), porque numa só não cabe. */
.appt-travel-narrow {
    display: none;
}

@media (max-width: 640.98px) {
    .appt-travel-wide {
        display: none;
    }

    .appt-travel-narrow {
        display: block;
    }
}

.appt-row-chevron {
    flex-shrink: 0;
    width: 20px;
    text-align: center;
    font-size: 20px;
    color: var(--uc-ink-4);
}

.appt-wa-btn {
    width: 44px;
    height: 44px;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background-color: var(--uc-status-ok-bg);
    color: var(--uc-status-ok);
    font-size: 20px;
    text-decoration: none;
}

.appt-switch-row {
    margin: 0;
}

/* !important: .form-switch .form-check-input do Bootstrap fixa width 2em e margin-left -2.5em. */
.appt-switch {
    width: 44px !important;
    height: 24px;
    margin: 0 !important;
    cursor: pointer;
}

.appt-date-chip {
    height: 48px;
    padding: 0 1rem;
    border: 0;
    border-radius: .625rem;
    background-color: var(--uc-surface-soft);
    color: var(--uc-ink);
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
}

.appt-date-chip:hover {
    background-color: var(--uc-track);
}

/* 16px em todo input: abaixo disso o iOS Safari dá zoom ao focar. */
.agenda-modal .appt-input {
    min-height: 48px;
    font-size: 16px;
}

.appt-time-range {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: .75rem;
    padding-bottom: .75rem;
}

.appt-time-field {
    display: flex;
    flex-direction: column;
    gap: .25rem;
    margin: 0;
}

.appt-obs {
    display: flex;
    flex-direction: column;
    gap: .375rem;
    padding: .75rem 0;
    border-top: 1px solid var(--uc-line);
}

.appt-reason-chip {
    min-height: 44px;
}

/* Status no cabeçalho (editando atendimento): lados com a mesma largura fixa, pra o título ficar no centro da tela.
   122px = a pílula mais longa ("Cancelado por você", 120px em 11px); sobra ~108px pro "Atendimento" (101px) em 360px. */
.appt-header.has-status {
    --appt-head-side: 132px;
    grid-template-columns: var(--appt-head-side) minmax(0, 1fr) var(--appt-head-side);
    gap: 0;
    padding: 0 .25rem;
}

/* Margem direita do status = onde o ✕ começa de fato (o glifo de 18px fica ~13px dentro do botão de 44px). */
.appt-header.has-status .appt-head-status {
    margin-right: 13px;
}

.appt-head-status {
    justify-self: end;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    justify-content: center;
    gap: 2px;
}

.appt-header .appt-head-status .ds-pill {
    padding: 0 .375rem;
    gap: .25rem;
    font-size: 11px;
}

.appt-head-left {
    font-size: 12px;
    line-height: 1.2;
    color: var(--uc-ink-3);
    white-space: nowrap;
}

.appt-banner-text {
    font-size: 14px;
    font-weight: 500;
}

.appt-delete-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: .5rem;
    width: 100%;
    min-height: 44px;
    margin-top: 1rem;
    border: 0;
    background: transparent;
    color: var(--uc-action-text);
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
}

/* Renderizado (não display:none, showPicker() exige isso) mas fora da vista -- quem
   recebe o toque é a linha inteira, que chama showDatePicker(id) no JS. */
.appt-native-date-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    opacity: 0;
    overflow: hidden;
    border: 0;
    margin: 0;
    padding: 0;
    pointer-events: none;
}

/* Aviso de intervalo curto dentro da linha "Data e horário": texto pequeno, sem caixa. */
.appt-row-warn {
    display: flex;
    gap: .3125rem;
    margin-top: 2px;
    font-size: 13px;
    font-weight: 500;
    line-height: 1.35;
    color: var(--uc-ink-2);
}

/* Neutro de propósito: não é urgente (amarelo = agir agora) nem status. O triângulo é o sinal. */
.appt-row-warn i {
    color: var(--uc-ink-3);
}

/* "Total R$ 225" no rodapé, logo acima do ⋯/Salvar: serviços + deslocamento, sempre à vista. */
.appt-total-line {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: .5rem;
    margin: -.25rem .25rem .375rem;
    font-size: 13px;
    color: var(--uc-ink-3);
}

.appt-total-line strong {
    flex-shrink: 0;
    font-size: 18px;
    font-weight: 700;
    color: var(--uc-ink);
}

.appt-total-deposit {
    margin: -.375rem .25rem .5rem;
    font-size: 12px;
    color: var(--uc-ink-3);
}

/* "+ Sinal" / "+ Observação": mais leves que os botões de ação. A área de toque segue 44px via ::after. */
.appt-opt-chip {
    position: relative;
    min-height: 30px;
    padding: 0 .75rem;
    border: 1px solid var(--uc-line);
    border-radius: 999px;
    background: transparent;
    font-size: 13px;
    color: var(--uc-ink-2);
    cursor: pointer;
}

.appt-opt-chip::after {
    content: "";
    position: absolute;
    inset: -7px -2px;
}

.appt-optional-chips {
    border-top: 1px solid var(--uc-line);
}

/* Envio que falhou: único item do histórico que fica no corpo. */
.appt-alert-line {
    display: flex;
    gap: .375rem;
    margin-top: .75rem;
    font-size: 13px;
    line-height: 1.35;
    color: var(--uc-error-text);
}

.appt-history-link {
    display: inline-flex;
    align-items: center;
    gap: .375rem;
    min-height: 44px;
    margin-top: -.25rem;
    padding: 0;
    border: 0;
    background: transparent;
    font-size: 14px;
    font-weight: 600;
    color: var(--uc-ink-2);
    cursor: pointer;
}

.appt-history-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.appt-history-item {
    display: grid;
    grid-template-columns: 20px minmax(0, 1fr);
    column-gap: .625rem;
    padding: .625rem 0;
    border-top: 1px solid var(--uc-line);
    font-size: 14px;
    color: var(--uc-ink-2);
}

.appt-history-item:first-child {
    border-top: 0;
}

.appt-history-item i {
    grid-row: span 2;
    color: var(--uc-ink-3);
}

.appt-history-item.is-alert,
.appt-history-item.is-alert i {
    color: var(--uc-error-text);
}

.appt-history-when {
    grid-column: 2;
    font-size: 12.5px;
    color: var(--uc-ink-3);
}

/* Serviços: com 2+ a linha quebra (flex-wrap) e as pílulas ocupam a largura toda, sob o ícone. */
.appt-svc-row {
    flex-wrap: wrap;
    row-gap: 8px;
}

.appt-svc-line {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: .75rem;
}

.appt-svc-meta {
    flex-shrink: 0;
    font-size: 14px;
    color: var(--uc-ink-3);
    white-space: nowrap;
}

.appt-svc-pills {
    flex: 0 0 100%;
    min-width: 0;
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.appt-svc-pill {
    max-width: 100%;
    display: inline-flex;
    align-items: baseline;
    gap: 6px;
    padding: 6px 12px;
    border-radius: 999px;
    background-color: var(--uc-track);
}

.appt-svc-pill-name {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 13px;
    font-weight: 500;
    color: var(--uc-ink);
}

.appt-svc-pill-meta {
    flex-shrink: 0;
    font-size: 12px;
    color: var(--uc-ink-2);
    white-space: nowrap;
}

.appt-inline-error {
    padding: 0 0 .5rem 52px;
    color: var(--uc-error-text);
    font-size: 14px;
}

.appt-conflict-text {
    margin: 0 0 .75rem;
    padding: .5rem .75rem;
    border-radius: .625rem;
    background: var(--uc-highlight);
    color: var(--uc-brand);
    font-size: .85rem;
    line-height: 1.4;
}

.appt-chip-row {
    display: flex;
    flex-wrap: wrap;
    gap: .5rem;
    padding: .75rem 0;
}

.appt-stepper {
    display: flex;
    align-items: center;
    border: 1px solid var(--uc-border);
    border-radius: .625rem;
    overflow: hidden;
}

.appt-stepper button {
    width: 44px;
    height: 44px;
    border: 0;
    background: var(--uc-surface);
    font-size: 1.25rem;
    cursor: pointer;
}

.appt-stepper span {
    min-width: 64px;
    text-align: center;
    font-size: .9rem;
    font-weight: 600;
}

.appt-confirm-banner {
    margin: .25rem 0 .75rem;
}

.appt-confirm-banner {
    display: flex;
    flex-direction: column;
    gap: .5rem;
    padding: .75rem .875rem;
    border-radius: .75rem;
    background: var(--uc-highlight);
    color: var(--uc-brand);
}

/* Sobre o amarelo, só --uc-brand (nunca ink-3): herdam a cor do aviso. */
.appt-banner-hint {
    margin: 0;
    font-size: 13px;
    line-height: 1.4;
}

.appt-banner-link {
    align-self: flex-start;
    min-height: 44px;
    padding: 0 2px;
    border: 0;
    background: none;
    font-size: 14px;
    font-weight: 600;
    color: inherit;
    text-decoration: underline;
    text-underline-offset: 3px;
}

    .appt-banner-link:focus-visible {
        outline: 2px solid var(--uc-focus-ring);
        outline-offset: 2px;
    }

    .appt-banner-link:disabled {
        color: var(--uc-disabled-ink);
        text-decoration: none;
    }

/* Pílula de status do modal: Shared/AppointmentStatusPill. Folha de leitura: Shared/AppointmentSheet. */

/* Agendamento com a folha aberta: anel de marca por fora (box-shadow não mexe no traço lateral
   de status). is-fading = chegou por link e a folha fechou: o anel some devagar. */
.agenda-event.is-selected,
.agenda-week-event.is-selected,
.agenda-month-event.is-selected,
.agenda-mlist-row.is-selected {
    box-shadow: 0 0 0 2px var(--uc-brand);
    z-index: 2;
    transition: box-shadow .6s ease-out;
}

.agenda-mlist-row.is-selected {
    border-radius: 10px;
}

/* Folha aberta cobre o fim da grade: espaço extra pra um horário do fim do dia poder subir acima dela. */
.agenda-day-scroll.has-sheet {
    padding-bottom: 60vh;
}

/* Célula do Mês tem overflow:hidden: anel por dentro, senão sai cortado. */
.agenda-month-event.is-selected {
    box-shadow: inset 0 0 0 2px var(--uc-brand);
}

.is-selected.is-fading {
    box-shadow: 0 0 0 2px transparent;
}

.agenda-month-event.is-selected.is-fading {
    box-shadow: inset 0 0 0 2px transparent;
}

@media (prefers-reduced-motion: reduce) {
    .agenda-event.is-selected,
    .agenda-week-event.is-selected,
    .agenda-month-event.is-selected,
    .agenda-mlist-row.is-selected {
        transition: none;
    }
}

.agenda-allday-row {
    display: flex;
    flex-wrap: wrap;
    gap: .375rem;
    padding-bottom: .5rem;
}

.agenda-week-allday-row {
    display: flex;
    gap: 2px;
    padding-bottom: 4px;
}

.agenda-week-allday-cell {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}

.agenda-allday-chip {
    background: var(--uc-status-off-bg);
    color: var(--uc-status-off-text);
    border-radius: .375rem;
    padding: .2rem .5rem;
    font-size: .75rem;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    cursor: pointer;
}

.calendar-shell {
    --rz-scheduler-event-background-color: var(--uc-status-ok-bg);
    --rz-scheduler-event-color: var(--uc-status-ok);
}

.calendar-shell .rz-event {
    background-color: var(--uc-status-ok-bg);
    color: var(--uc-status-ok);
    border-left: 3px solid var(--uc-status-ok);
    border-radius: .5rem;
    box-shadow: 0 .125rem .25rem rgba(var(--uc-brand-rgb), .12);
}

.tb-appt-title {
    font-weight: 600;
    font-size: .8rem;
    line-height: 1.2;
}

.tb-appt-time {
    font-size: .7rem;
    opacity: .85;
    line-height: 1.2;
}

.calendar-shell .rz-scheduler-toolbar {
    border-radius: .75rem .75rem 0 0;
}

.legend-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    display: inline-block;
}

/* Pill de horários livres — colapsada por padrão para não competir com o próximo
   atendimento; um toque revela a lista (flat no Dia, agrupada por dia na Semana). */
.agenda-free-pill {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background-color: var(--uc-surface);
    border: 1px solid var(--uc-border);
    border-radius: 12px;
    min-height: 44px;
    padding: 0 12px;
    margin-bottom: 8px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    color: var(--uc-ink-2);
}

.agenda-free-pill .left {
    display: flex;
    align-items: center;
    gap: 7px;
}

.agenda-free-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    border: 2px solid var(--uc-brand);
    background-color: var(--uc-surface);
    flex-shrink: 0;
}

.agenda-free-chevron {
    color: var(--uc-ink-4);
    font-size: 13px;
    transition: transform .15s ease-out;
}

.agenda-free-chevron.open {
    transform: rotate(90deg);
}

/* Flutua por cima da agenda (não empurra a grade pra baixo) -- .agenda-free-wrap é o
   âncora posicionado; a própria folha rola por dentro quando tem muito chip livre. */
.agenda-free-wrap {
    position: relative;
    margin-bottom: .5rem;
}

.agenda-free-sheet {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    z-index: 5;
    background-color: var(--uc-surface);
    border: 1px solid var(--uc-border);
    border-radius: 0 0 12px 12px;
    box-shadow: 0 8px 20px rgba(var(--uc-brand-rgb), .12);
    padding: 10px 12px 4px;
    margin-top: -2px;
    /* ponytail: .agenda-shell-fill (ancestor) tem overflow:hidden pra travar a altura da
       view Dia/Semana -- se a folha crescesse mais que o espaço restante ali, o excesso
       seria cortado (não rolaria pra fora da tela). min(50vh, 400px) fica bem abaixo do
       pior caso real; se algum dia isso não bastar, portar a folha pra fora desse ancestor. */
    max-height: min(50vh, 400px);
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}

.agenda-free-day-group {
    margin-bottom: 10px;
}

.agenda-free-day-label {
    font-size: 11px;
    font-weight: 700;
    letter-spacing: .03em;
    text-transform: uppercase;
    color: var(--uc-ink-4);
    margin-bottom: 2px;
}

/* Painel "Data e horário" do modal de atendimento -- faixa de dias com scroll horizontal
   (a partir de hoje, só dias de expediente) + chips de horário agrupados por período. */
.dt-panel {
    padding-bottom: .75rem;
}

.dt-note {
    margin: 0;
    padding: .75rem 0;
    font-size: 14px;
    color: var(--uc-ink-3);
}

.dt-strip-wrap {
    position: relative;
    display: flex;
    align-items: center;
    gap: .25rem;
    margin: 0 -1rem .5rem;
}

/* padding vertical: sem ele o anel de foco dos cards era cortado pelo overflow-x. */
.dt-day-strip {
    flex: 1;
    min-width: 0;
    display: flex;
    gap: 2px;
    padding: 4px 1rem;
    overflow-x: auto;
    scroll-snap-type: x proximity;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
}

.dt-day-strip::-webkit-scrollbar {
    display: none;
}

/* Só o dia selecionado tem fundo; embaixo, até 3 pontinhos de disponibilidade (nº de horários no aria-label). */
.dt-day-card {
    flex: 0 0 48px;
    height: 60px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
    padding: 0;
    border: 1px solid transparent;
    border-radius: 12px;
    background-color: transparent;
    color: var(--uc-ink);
    scroll-snap-align: center;
    cursor: pointer;
}

.dt-day-label {
    font-size: 12px;
    font-weight: 600;
    line-height: 1.2;
    color: var(--uc-ink-3);
}

.dt-day-num {
    font-size: 18px;
    font-weight: 700;
    line-height: 1.1;
}

/* 3 vagas fixas: as vazias ficam transparentes e mantêm a largura. Cor única -- a informação
   está na quantidade. */
.dt-day-dots {
    display: flex;
    justify-content: center;
    gap: 3px;
    margin-top: 2px;
}

.dt-day-dots > span {
    width: 5px;
    height: 5px;
    border-radius: 50%;
}

.dt-day-dots > span.on {
    background-color: var(--uc-status-ok);
}

/* Fechado ou lotado: esmaecido mas clicável -- leva ao "Fechado aos ..."/"lotado" e ainda
   permite encaixe. */
.dt-day-card.closed:not(.selected),
.dt-day-card.closed:not(.selected) .dt-day-label,
.dt-day-card.full:not(.selected),
.dt-day-card.full:not(.selected) .dt-day-label {
    color: var(--uc-disabled-ink);
}

.dt-day-card.selected {
    background-color: var(--uc-brand);
    border-color: var(--uc-brand);
    color: var(--uc-brand-on);
}

/* Lotado E selecionado: cinza escuro em vez da cor da marca, pra não parecer "tem vaga". */
.dt-day-card.selected.full {
    background-color: var(--uc-ink-3);
    border-color: var(--uc-ink-3);
}

.dt-day-card.selected .dt-day-label {
    color: var(--uc-brand-on);
}

.dt-day-card.selected .dt-day-dots > span.on {
    background-color: var(--uc-brand-on);
}

/* Virada de mês: divisor vertical com o mês, entre os cards. */
.dt-month-sep {
    flex: 0 0 auto;
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 0 6px 0 4px;
}

.dt-month-sep::before {
    content: "";
    width: 1px;
    align-self: stretch;
    margin: 6px 0;
    background-color: var(--uc-border-strong);
}

.dt-month-sep span {
    writing-mode: vertical-rl;
    transform: rotate(180deg);
    font-size: 11px;
    font-weight: 700;
    letter-spacing: .06em;
    text-transform: uppercase;
    color: var(--uc-brand);
}

.dt-strip-arrow {
    display: none;
    flex-shrink: 0;
    width: 44px;
    height: 44px;
    border: 0;
    border-radius: 50%;
    background-color: var(--uc-surface-soft);
    color: var(--uc-ink-2);
    font-size: 22px;
    line-height: 1;
    cursor: pointer;
}

/* Linha fixa de alternância livres/encaixe, logo abaixo da faixa de dias. */
.dt-mode-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: .75rem;
    min-height: 40px;
}

.dt-mode-hint {
    min-width: 0;
    font-size: 13px;
    color: var(--uc-ink-3);
}

/* vinho, igual ao "+ Adicionar outro serviço": uma cor de ação só no formulário. */
.dt-mode-link {
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    min-height: 44px;
    padding: 0;
    border: 0;
    background: transparent;
    color: var(--uc-brand);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
}

.dt-mode-link .bi {
    font-size: 16px;
}

.dt-notice {
    display: flex;
    align-items: center;
    gap: .75rem;
    margin: .25rem 0 .5rem;
    padding: .625rem .75rem;
    border-radius: .75rem;
    background-color: var(--uc-highlight);
    color: var(--uc-brand);
    font-size: 14px;
}

.dt-notice span {
    flex: 1;
}

.dt-notice .btn {
    min-height: 44px;
    flex-shrink: 0;
}

.dt-group-title {
    margin: 4px 0 8px;
    font-size: 12px;
    font-weight: 600;
    letter-spacing: .04em;
    text-transform: uppercase;
    color: var(--uc-ink-3);
}

.dt-mode-row .dt-group-title {
    margin: 0;
}

.dt-time-grid + .dt-group-title {
    margin-top: 12px;
}

.dt-time-grid {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 8px;
}

.dt-time-chip {
    height: 40px;
    border: 1px solid var(--uc-border);
    border-radius: 12px;
    background-color: var(--uc-surface);
    color: var(--uc-ink);
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
}

.dt-time-chip.selected {
    background-color: var(--uc-brand);
    border-color: var(--uc-brand);
    color: var(--uc-brand-on);
}

/* Dia sem horário (lotado ou fechado): um bloco só, com o motivo e o atalho pro próximo dia livre. */
.dt-empty {
    display: flex;
    flex-direction: column;
    gap: .375rem;
    margin-top: .5rem;
    padding: 13px;
    border: 1px solid var(--uc-border);
    border-radius: 12px;
    background-color: var(--uc-surface-soft);
}

.dt-empty-title {
    font-size: 15px;
    font-weight: 600;
    color: var(--uc-ink);
}

.dt-empty-sub {
    font-size: 14px;
    color: var(--uc-ink-3);
}

.dt-empty-next {
    width: 100%;
    height: 48px;
    margin-top: .375rem;
    border: 1.5px solid var(--uc-brand);
    border-radius: 10px;
    background-color: var(--uc-surface);
    color: var(--uc-brand);
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
}

.dt-manual {
    padding: .25rem 0;
}

.dt-manual-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: .75rem;
}

.dt-manual-grid .appt-stepper {
    min-height: 48px;
    justify-content: space-between;
}

.dt-manual-conflict {
    margin: .75rem 0 0;
}


/* Sub-telas Cliente / Nova cliente / Serviço: por cima do formulário, dentro do
   .modal-content (que já é position:relative e, no celular, tela cheia). */
.appt-sub {
    position: absolute;
    inset: 0;
    z-index: 5;
    display: flex;
    flex-direction: column;
    background-color: var(--uc-surface);
    animation: appt-sub-in .2s ease-out;
}

@keyframes appt-sub-in {
    from { transform: translateX(100%); }
    to { transform: translateX(0); }
}

@media (prefers-reduced-motion: reduce) {
    .appt-sub {
        animation: none;
    }
}

.appt-back-btn {
    display: flex;
    align-items: center;
    gap: .25rem;
    min-width: 44px;
    height: 44px;
    padding: 0 .5rem;
    border: 0;
    border-radius: .5rem;
    background: transparent;
    color: var(--uc-action-text);
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
}

.appt-back-btn span {
    font-size: 24px;
    line-height: 1;
}

.appt-sub-search {
    flex-shrink: 0;
    padding: .75rem 1rem;
    border-bottom: 1px solid var(--uc-line);
}

.appt-sub-list {
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
    padding: 0 1rem 1rem;
}

.appt-sub-form {
    flex: 1 1 auto;
    min-height: 0;
    display: flex;
    flex-direction: column;
}

.appt-sub-body {
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: .375rem;
    padding: .5rem 1rem 1rem;
}

.appt-field-label {
    margin: .75rem 0 0;
    font-size: 14px;
    font-weight: 600;
    color: var(--uc-ink);
}

.appt-form-error {
    margin-bottom: .5rem;
    font-size: 14px;
    color: var(--uc-error-text);
}

/* Altura fixa (66px, border-box) -- o Virtualize da lista "Clientes" usa ItemSize=66. */
.appt-list-row {
    display: flex;
    align-items: center;
    gap: .75rem;
    width: 100%;
    height: 66px;
    padding: 0;
    border: 0;
    border-bottom: 1px solid var(--uc-line);
    background: transparent;
    color: inherit;
    font: inherit;
    text-align: left;
    cursor: pointer;
}

.appt-list-main {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 1px;
}

.appt-list-name {
    font-size: 16px;
    font-weight: 600;
    color: var(--uc-ink);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.appt-list-action .appt-list-name {
    color: var(--uc-action-text);
}

.appt-list-meta {
    font-size: 14px;
    color: var(--uc-ink-3);
}

.appt-list-check {
    flex-shrink: 0;
    font-size: 20px;
    color: var(--uc-brand);
}

/* Lista de serviços de marcar: quadrado à esquerda (quadrado = pode marcar vários; círculo é a
   convenção de escolha única), cheio na cor da marca quando marcado. */
.appt-list-tick {
    flex-shrink: 0;
    width: 24px;
    height: 24px;
    border-radius: 6px;
    border: 2px solid var(--uc-line);
    display: grid;
    place-items: center;
    color: transparent;
    font-size: 14px;
    transition: background-color .15s ease, border-color .15s ease, color .15s ease;
}

.appt-list-tick.is-on {
    background-color: var(--uc-brand);
    border-color: var(--uc-brand);
    color: var(--uc-surface);
}

.appt-list-hint {
    margin: 0;
    padding: .25rem 0 .5rem;
    font-size: 13px;
    color: var(--uc-ink-3);
}

.appt-done-btn {
    height: auto;
    min-height: 52px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 1px;
    line-height: 1.2;
}

.appt-done-meta {
    font-size: 13px;
    font-weight: 500;
    opacity: .9;
    font-variant-numeric: tabular-nums;
}

@media (prefers-reduced-motion: reduce) {
    .appt-list-tick {
        transition: none;
    }
}

.appt-list-section {
    padding: 1rem 0 .25rem;
    font-size: 13px;
    font-weight: 600;
    color: var(--uc-ink-3);
}

.appt-list-empty {
    margin: 0;
    padding: 1rem 0;
    font-size: 15px;
    color: var(--uc-ink-3);
}

/* Tablet e desktop: popup de altura fixa (não muda ao abrir Cliente/Serviço, as sub-telas
   deslizam dentro dele). A altura segue o visualViewport, então no iPad com teclado aberto o
   rodapé continua visível. */
@media (min-width: 576px) {
    .appt-modal .modal-dialog {
        max-width: 500px;
    }

    .appt-modal .modal-content {
        height: min(720px, calc(var(--uc-vv-h, 100dvh) - 3.5rem));
        max-height: none;
    }
}

/* Tablet (toque): popup no topo, não centralizado -- centralizado, o teclado virtual cobria o
   rodapé. */
@media (min-width: 576px) and (pointer: coarse) {
    .appt-modal .modal-dialog {
        align-items: flex-start;
        margin-top: 1rem;
    }

    .appt-modal .modal-content {
        height: min(720px, calc(var(--uc-vv-h, 100dvh) - 2rem));
    }
}

/* Setas da faixa de dias só com mouse -- no toque a faixa rola com o dedo. Somem nas pontas
   (data-at-start/data-at-end vêm de ucDayStrip). */
@media (hover: hover) and (pointer: fine) {
    .dt-strip-arrow {
        display: block;
    }

    .dt-strip-wrap[data-at-start="true"] .dt-strip-arrow[data-dir="-1"],
    .dt-strip-wrap[data-at-end="true"] .dt-strip-arrow[data-dir="1"] {
        visibility: hidden;
    }

    .dt-strip-wrap {
        margin: 0 0 .5rem;
    }

    .dt-day-strip {
        padding: 4px 2px;
    }
}

@media (hover: hover) {
    .appt-row:not(.appt-row-static):not(.appt-switch-row):hover,
    .appt-list-row:hover {
        background-color: var(--uc-surface-soft);
    }

    .dt-day-card:not(.selected):hover,
    .dt-time-chip:not(.selected):hover {
        border-color: var(--uc-brand);
    }

    .appt-icon-btn:hover,
    .appt-back-btn:hover,
    .dt-strip-arrow:hover {
        background-color: var(--uc-surface-soft);
    }
}

/* Anel de foco só pra teclado. Linhas usam inset: são largura total dentro de uma área com
   overflow, e o anel externo seria cortado. */
.agenda-modal :is(.appt-row, .appt-list-row):focus-visible {
    outline: none;
    box-shadow: inset 0 0 0 .2rem var(--uc-focus-halo);
}

.agenda-modal :is(.dt-day-card, .dt-time-chip, .appt-icon-btn, .appt-back-btn, .appt-segmented button,
                  .appt-wa-btn, .appt-delete-btn, .appt-history-link, .appt-opt-chip, .dt-mode-link, .dt-empty-next, .dt-strip-arrow, .appt-date-chip,
                  .appt-stepper button):focus-visible {
    outline: none;
    box-shadow: 0 0 0 .2rem var(--uc-focus-halo);
}

/* Grade de horários livres, 5 por linha em mobile -- estrutura vem do handoff (seção
   2a/2b): só início + duração pequena embaixo. */
.dt-slot-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 5px;
}

.dt-slot-chip {
    background-color: var(--uc-surface);
    border: 1px solid var(--uc-border);
    border-radius: 8px;
    padding: 6px 2px;
    text-align: center;
    cursor: pointer;
}

.dt-slot-time {
    font-size: 11px;
    font-weight: 700;
    color: var(--uc-ink);
    white-space: nowrap;
}

.dt-slot-dur {
    font-size: 8.5px;
    color: var(--uc-ink-3);
    margin-top: 1px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.agenda-nav-btn {
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: none;
    border: none;
    border-radius: 10px;
    color: var(--uc-ink-3);
    font-size: 26px; /* o glifo ‹ › ocupa ~20px de altura visual nesse corpo */
    padding: 0;
    cursor: pointer;
    line-height: 1;
}

/* Largura fixa -- sem isso o botão › se deslocava horizontalmente conforme o texto do
   label mudava de tamanho (ex: "1 set" vs "Setembro 2026" vs "segunda-feira"). */
.agenda-date-center {
    width: 132px;
}

.agenda-date-label {
    font-size: 16px;
    font-weight: 700;
    color: var(--uc-ink);
    white-space: nowrap;
}

.agenda-date-sub {
    font-size: 12px;
    color: var(--uc-ink-3);
    text-transform: uppercase;
    letter-spacing: .04em;
    white-space: nowrap;
}

.agenda-today-btn {
    background-color: var(--uc-surface-soft);
    color: var(--uc-ink-2);
    border: none;
    border-radius: 8px;
    height: 40px;
    padding: 0 12px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
}

.agenda-head {
    margin-bottom: .5rem;
}

.agenda-view-toggle {
    display: flex;
    margin-bottom: .5rem;
    background-color: var(--uc-track);
    border-radius: 9px;
    padding: 3px;
    gap: 2px;
}

.agenda-view-toggle button {
    flex: 1;
    background: transparent;
    color: var(--uc-ink-2); /* sobre --uc-track, --uc-ink-3 fica em 4.25:1 */
    border: none;
    border-radius: 7px;
    height: 40px;
    padding: 0;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
}

.agenda-view-toggle button.active {
    background-color: var(--uc-brand);
    color: var(--uc-brand-on);
}

/* Sem isso a view "dia" ficava presa numa altura fixa (60vh) e sobrava fundo em
   branco abaixo do card em telas mais altas -- agora ocupa o resto da tela real
   (.agenda-shell-fill / .agenda-day-shell abaixo cuidam do restante da coluna flex). */
.agenda-day-scroll {
    flex: 1 1 auto;
    min-height: 120px;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    /* Espaço pro "+" flutuante não cobrir a última faixa de horário. */
    padding-bottom: 88px;
}

/* Mesma folga no Mês (aqui quem rola é a página) -- sábado/lista do dia livres do "+". */
.agenda-month-shell {
    margin-bottom: 88px;
}

/* height (não min-height!) -- com min-height o conteúdo simplesmente empurrava o card
   pra baixo do necessário e a página inteira rolava (botões do topo somem, e o scroll
   interno de .agenda-day-scroll nunca ativa porque ele nunca fica menor que o próprio
   conteúdo). Com um teto real, o flex:1 do agenda-day-shell/agenda-day-scroll é forçado
   a encolher e é ELE quem rola -- topo (data, toggle, legenda, pill) fica sempre visível.
   ponytail: se o cabeçalho crescer demais (muitos banners), o conteúdo dele é cortado em
   vez de rolar -- adicionar scroll próprio ali se isso virar problema real. */
.agenda-shell-fill {
    display: flex;
    flex-direction: column;
    height: calc(100dvh - 3.5rem);
    overflow: hidden;
}

.agenda-shell-fill .agenda-day-shell {
    display: flex;
    flex-direction: column;
    flex: 1 1 auto;
    min-height: 0;
}

/* Dia com bloqueio de dia inteiro -- antes só o chip do motivo no topo indicava isso,
   resto da grade ficava em branco e passava despercebido pro usuário. */
.agenda-day-blocked {
    background-color: var(--uc-surface-soft);
}

/* Fake continuity: the grid "slides in" from the direction the user pulled it (or the
   direction the date moved on Anterior/Próximo/Hoje), like the underlying calendar is one
   long strip and we just panned across it. */
.agenda-slide {
    animation-duration: .22s;
    animation-timing-function: ease-out;
    animation-fill-mode: both;
}

.agenda-slide-next {
    animation-name: agenda-slide-in-next;
}

.agenda-slide-prev {
    animation-name: agenda-slide-in-prev;
}

.agenda-slide-fade {
    animation-name: agenda-slide-in-fade;
}

@keyframes agenda-slide-in-next {
    from { transform: translateX(28px); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}

@keyframes agenda-slide-in-prev {
    from { transform: translateX(-28px); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}

@keyframes agenda-slide-in-fade {
    from { opacity: 0; }
    to { opacity: 1; }
}

.agenda-day-grid, .agenda-week-grid {
    position: relative;
    border-top: 1px solid var(--uc-border);
}

.agenda-hour-row {
    position: relative;
    height: 26px;
    border-bottom: 1px solid var(--uc-line);
    cursor: pointer;
}

.agenda-hour-label {
    position: absolute;
    top: -8px;
    left: 0;
    font-size: 12px;
    color: var(--uc-ink-3);
    background-color: var(--uc-surface);
    padding-right: 6px;
}

/* Fora do expediente (antes de abrir, almoço, depois de fechar): mesmo fundo de dia fechado.
   Agendamento fora do expediente continua visível por cima (camada de eventos). */
.agenda-offhours-layer {
    position: absolute;
    top: 0;
    left: 40px;
    right: 0;
    bottom: 0;
    pointer-events: none;
}

.agenda-offhours {
    position: absolute;
    background-color: var(--uc-bg-alt);
}

/* Tempo reservado para deslocamento antes de um atendimento (TravelBands): listras largas a 45°, para não se confundir
   com fora do expediente (liso no Dia, hachura fina de 1px na Semana) nem com a falta (listras na outra inclinação).
   Sem traço lateral: 4px + cor de status é o padrão dos cards (bloqueio). */
.agenda-travel {
    position: absolute;
    overflow: hidden;
    background-color: var(--uc-track);
    background-image: repeating-linear-gradient(45deg, var(--uc-surface) 0 4px, transparent 4px 10px);
}

.agenda-travel-label {
    display: inline-block;
    margin: 1px 0 0 6px;
    padding: 0 6px;
    border-radius: 999px;
    background-color: var(--uc-track);
    color: var(--uc-ink-2);
    font-size: 11px;
    font-weight: 600;
    line-height: 1.2;
    white-space: nowrap;
}

.agenda-travel-label .bi {
    margin-right: 4px;
}

.agenda-events-layer {
    position: absolute;
    top: 0;
    left: 40px;
    right: 0;
    bottom: 0;
    pointer-events: none;
}

.agenda-event {
    position: absolute;
    border-radius: 6px;
    padding: 4px 8px;
    overflow: hidden;
    box-sizing: border-box;
    border-left: 3px solid;
    cursor: pointer;
    pointer-events: auto;
}

/* Já terminou: esmaecido, mas continua clicável (editar/ver histórico). */
/* Semana fica de fora: lá o passado já se distingue pelo cabeçalho cinza, e bloco
   esmaecido sem texto (celular) virava sombra. */
.agenda-event.is-past,
.agenda-month-event.is-past {
    opacity: .55;
}

/* Linha do "agora" -- acima dos eventos, sem capturar toque. */
.agenda-now-line {
    position: absolute;
    height: 2px;
    margin-top: -1px;
    background-color: var(--uc-action-text);
    pointer-events: none;
    z-index: 3;
}

.agenda-now-line::before {
    content: "";
    position: absolute;
    left: -4px;
    top: -3px;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background-color: var(--uc-action-text);
}

/* Botão flutuante "novo agendamento" -- sobreposto à lista, mesma clearance de tab bar
   que a faixa de legenda fixa usava antes dela virar tooltip por selo. */
/* Toast (global, ToastHost) no canto de baixo: o "+" sai da frente enquanto ele estiver aberto. */
html:has(.ct-toast-wrap) .agenda-fab {
    display: none;
}

.agenda-fab {
    position: fixed;
    right: 16px;
    bottom: calc(4rem + env(safe-area-inset-bottom) + 0.75rem);
    width: 52px;
    height: 52px;
    border-radius: 50%;
    background-color: var(--uc-action);
    color: var(--uc-brand-on);
    border: none;
    font-size: 26px;
    font-weight: 300;
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: var(--uc-shadow-fab);
    cursor: pointer;
    z-index: 10;
}

/* Ícone "i" no header que substitui a legenda fixa de status -- some por padrão, só
   aparece com o toque; popover fecha ao tocar fora via .agenda-popover-backdrop. */
.agenda-info-wrap {
    position: relative;
}

/* Área de toque 44×44; o círculo visível (32px) é o span de dentro. */
.agenda-info-btn {
    width: 44px;
    height: 44px;
    padding: 0;
    border-radius: 50%;
    background: none;
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}

.agenda-info-dot {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background-color: var(--uc-surface-soft);
    color: var(--uc-ink-2);
    font-size: 14px;
    font-style: italic;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
}

:is(.agenda-nav-btn, .agenda-info-btn, .agenda-today-btn, .agenda-view-toggle button, .agenda-free-pill,
    .agenda-week-day-col, .agenda-week-event, .agenda-mday, .agenda-mlist-row, .agenda-mlist-link,
    .agenda-mlist-create):focus-visible {
    outline: none;
    box-shadow: 0 0 0 3px var(--uc-focus-halo);
}

.agenda-info-popover {
    position: absolute;
    top: calc(100% + 6px);
    right: 0;
    z-index: 6;
    background: var(--uc-surface);
    border-radius: 10px;
    box-shadow: 0 8px 20px rgba(var(--uc-brand-rgb), .18);
    padding: 10px 12px;
    min-width: 160px;
    font-size: 12.5px;
    color: var(--uc-ink);
    display: flex;
    flex-direction: column;
    gap: 6px;
    white-space: nowrap;
}

/* Camada invisível de tela inteira, só pra capturar o toque "fora" e fechar o
   popover/tooltip ativo -- mesmo truque usado pelo modal-backdrop do Bootstrap. */
.agenda-popover-backdrop {
    position: fixed;
    inset: 0;
    z-index: 5;
}

.agenda-event-head {
    display: flex;
    align-items: flex-start;
    gap: 4px;
}

.agenda-event-title {
    flex: 1 1 auto;
    min-width: 0;
    display: flex;
    gap: 4px;
    font-size: 12px;
    font-weight: 600;
    white-space: nowrap;
}

/* O horário nunca corta; quem cede é o nome. */
.agenda-event-time {
    flex-shrink: 0;
}

.agenda-event-name {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
}

.agenda-event-tag {
    flex-shrink: 0;
    margin-left: auto;
    padding: 0 6px;
    border-radius: 999px;
    background-color: var(--uc-track);
    font-size: 10.5px;
    font-weight: 700;
}

/* Falta: visível, mas não ocupa o horário -- cinza claro listrado, por baixo dos outros blocos. */
.agenda-event.is-noshow,
.agenda-week-event.is-noshow {
    background-image: repeating-linear-gradient(135deg, transparent 0 6px, rgba(0, 0, 0, .05) 6px 12px);
    z-index: 0;
}

.agenda-event-sub {
    font-size: 10.5px;
    opacity: .75;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Selo de entrega (C/L + ✓✓/✓/!) -- nunca muda a cor do card,
   badge monocromático ao lado do título. flex-shrink:0 pra nunca serem
   espremidos; quem cede espaço é o título (min-width:0 + ellipsis acima). */
.evt-badges {
    display: flex;
    align-items: center;
    gap: 2px;
    flex-shrink: 0;
    cursor: pointer;
}

/* Significado do(s) selo(s) só aparece ao toque, num toast fixo -- nada de legenda fixa
   ocupando espaço da tela pra explicar "C"/"L"/"G"/"P"/"A" o tempo todo. Toast (não
   tooltip ancorado no selo) porque os cards de evento têm overflow:hidden (pro título
   truncar com ellipsis), que cortaria qualquer coisa posicionada além dos limites do card. */
.agenda-badge-toast {
    position: fixed;
    left: 50%;
    transform: translateX(-50%);
    bottom: calc(4rem + env(safe-area-inset-bottom) + 1.25rem);
    z-index: 6;
    background: var(--uc-ink);
    color: var(--uc-brand-on);
    font-size: 12.5px;
    font-weight: 500;
    padding: 8px 14px;
    border-radius: 8px;
    white-space: nowrap;
    max-width: calc(100vw - 32px);
    overflow: hidden;
    text-overflow: ellipsis;
    box-shadow: 0 6px 16px rgba(var(--uc-brand-rgb), .25);
}

.evt-badge-delivery {
    display: flex;
    align-items: center;
    gap: 2px;
    height: 15px;
    padding: 0 4px;
    border-radius: 4px;
    background: rgba(var(--uc-surface-rgb), .85);
    border: 1px solid rgba(var(--uc-brand-rgb), .09);
    box-sizing: border-box;
}

.evt-badge-etapa {
    font-size: 9px;
    font-weight: 800;
    color: var(--uc-ink-2);
}

.evt-badge-glyph {
    font-size: 11px;
    font-weight: 700;
    letter-spacing: -.5px;
    line-height: 1;
}

/* ponytail: sem clamp de 2 linhas / variante de 30min do spec original -- o título de
   linha única com ellipsis + flex:1 já garante que ele nunca some por causa do selo;
   revisitar se o card precisar de título em 2 linhas. */

.agenda-week-header {
    display: flex;
    margin-bottom: 6px;
}

/* 28px: cabe "23" em 12px (a coluna de 24px era pra 9px). Mesma largura no spacer do
   cabeçalho, no rótulo das horas e no left da camada de eventos. */
.agenda-week-time-spacer {
    width: 28px;
    flex-shrink: 0;
}

.agenda-week-events-layer {
    left: 28px;
}

.agenda-week-day-col {
    flex: 1;
    min-width: 0;
    min-height: 44px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 2px 0;
    background: none;
    border: none;
    border-radius: 8px;
    color: inherit;
    font: inherit;
    cursor: pointer;
}

.agenda-week-day-label {
    font-size: 12px;
    color: var(--uc-ink-3);
}

.agenda-week-day-num {
    display: block;
    font-size: 14px;
    font-weight: 700;
    color: var(--uc-ink);
    width: 26px;
    height: 26px;
    line-height: 26px;
    border-radius: 50%;
    margin: 1px auto 0;
}

.agenda-week-day-col.past .agenda-week-day-label,
.agenda-week-day-col.past .agenda-week-day-num:not(.today) {
    color: var(--uc-ink-4);
}


.agenda-week-day-num.today {
    color: var(--uc-brand-on);
    /* --uc-action-text em vez de --uc-action: branco sobre #e95610 dá 3.62:1 e
       o número tem 12px. Mesmo laranja da família, 4.84:1. */
    background-color: var(--uc-action-text);
}

/* Dia sem BusinessHour cadastrado (profissional não trabalha) — sinaliza, não esconde:
   agendamentos-exceção feitos manualmente fora do expediente continuam visíveis por cima. */
.agenda-week-day-col.closed .agenda-week-day-label,
.agenda-week-day-col.closed .agenda-week-day-num {
    color: var(--uc-ink-4);
}

/* Semana: fechado (fora do expediente / dia sem atendimento) ganha hachurado sobre o
   fundo, pra não se confundir com horário livre (liso). Dia não muda. */
.agenda-week-grid .agenda-offhours {
    background-image: repeating-linear-gradient(45deg, var(--uc-border) 0 1px, transparent 1px 6px);
}

/* Coluna de hoje: mesmo laranja do número do dia no cabeçalho, bem diluído. */
.agenda-week-today-col {
    position: absolute;
    top: 0;
    bottom: 0;
    background-color: rgba(var(--uc-action-text-rgb), .06);
}

.agenda-closed-banner {
    font-size: 12px;
    color: var(--uc-ink-3);
    background-color: var(--uc-surface-soft);
    border-radius: 8px;
    padding: 6px 10px;
    margin-bottom: 8px;
}

.agenda-week-hour-row {
    position: relative;
    height: 26px;
    border-bottom: 1px solid var(--uc-line);
    display: flex;
}

.agenda-week-hour-label {
    width: 28px;
    flex-shrink: 0;
    font-size: 12px;
    line-height: 1;
    color: var(--uc-ink-3);
    padding-top: 2px;
}

/* Divisória entre dias (e entre horas e o 1º dia): mesma cor das linhas de hora. Todas
   as células têm a borda, então o flex:1 mantém as 7 colunas com 1/7 exato. */
.agenda-week-day-cell {
    flex: 1;
    cursor: pointer;
    border-left: 1px solid var(--uc-line);
}

.agenda-week-event {
    position: absolute;
    border-radius: 3px;
    border-left: 2px solid;
    cursor: pointer;
    overflow: hidden;
    box-sizing: border-box;
    padding: 1px 3px;
    pointer-events: auto;
}

.agenda-week-event-head {
    display: flex;
    align-items: flex-start;
    gap: 2px;
}

.agenda-week-event-title {
    flex: 1 1 auto;
    min-width: 0;
    font-size: 8.5px;
    font-weight: 600;
    line-height: 1.1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Card da Semana é bem menor que o de Dia -- selo encolhido pra caber, mesma informação. */
.agenda-week-event .evt-badges {
    gap: 1px;
}

.agenda-week-event .evt-badge-delivery {
    height: 11px;
    padding: 0 2px;
    gap: 1px;
}

.agenda-week-event .evt-badge-etapa {
    font-size: 7px;
}

.agenda-week-event .evt-badge-glyph {
    font-size: 8px;
}


.agenda-week-event-time {
    font-size: 7.5px;
    opacity: .8;
    line-height: 1.1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Celular: colunas de ~48px deixavam título em 8,5px e hora em 7,5px, ilegíveis. Aqui a
   Semana vira mapa de ocupação -- só cor (status) e altura (duração). O detalhe fica no
   aria-label do bloco e no Dia (o cabeçalho do dia abre ele). */
.agenda-week-event-initials {
    display: none;
}

@media (max-width: 767.98px) {
    /* Borda em volta toda (não só a lateral) + respiro de 3px/3px em WeekEventBlockStyle:
       sem isso atendimentos seguidos se fundiam numa coluna só. */
    .agenda-week-event {
        border-radius: 6px;
        border: 1.5px solid var(--evt-border);
        padding: 0;
    }

    .agenda-week-event-head,
    .agenda-week-event-time {
        display: none;
    }

    .agenda-week-event-initials {
        display: block;
        padding: 3px;
        text-align: center;
        font-size: 12px;
        font-weight: 600;
        line-height: 1;
        color: var(--uc-ink-2);
        white-space: nowrap;
        overflow: hidden;
    }
}

@media (hover: hover) {
    .agenda-week-day-col:hover,
    .agenda-nav-btn:hover {
        background-color: var(--uc-surface-soft);
    }
}

.agenda-month-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    border-top: 1px solid var(--uc-border);
    border-left: 1px solid var(--uc-border);
}

.agenda-month-weekday {
    font-size: 9.5px;
    font-weight: 700;
    text-transform: uppercase;
    color: var(--uc-ink-3);
    text-align: center;
    padding: 4px 0;
}

.agenda-month-cell {
    height: 78px;
    overflow: hidden;
    border-right: 1px solid var(--uc-border);
    border-bottom: 1px solid var(--uc-border);
    padding: 3px;
    cursor: pointer;
}

.agenda-month-cell.outside {
    background-color: var(--uc-bg-alt);
}

.agenda-month-cell.outside .agenda-month-day-num {
    color: var(--uc-ink-4);
}

.agenda-month-day-num {
    display: block;
    width: fit-content;
    font-size: 11px;
    font-weight: 700;
    color: var(--uc-ink);
    margin-bottom: 2px;
}

.agenda-month-day-num.past {
    color: var(--uc-ink-4);
}

.agenda-month-day-num.today {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background-color: var(--uc-action-text); /* ver .agenda-week-day-num.today */
    color: var(--uc-brand-on);
}

.agenda-month-event {
    font-size: 9px;
    font-weight: 600;
    border-radius: 4px;
    padding: 1px 3px;
    margin-bottom: 1px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    cursor: pointer;
}

.agenda-month-cell-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 2px;
}

/* Barra de ocupação do dia (Mês): trilho --uc-track, preenchimento --uc-brand. */
.agenda-mday-bar {
    display: block;
    height: 4px;
    border-radius: 2px;
    background-color: var(--uc-track);
    overflow: hidden;
    margin-bottom: 2px;
}

.agenda-mday-bar > span {
    display: block;
    height: 100%;
    border-radius: 2px;
    background-color: var(--uc-brand);
}

/* Tem pedido "a confirmar" nesse dia. */
.agenda-mday-pending {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background-color: var(--uc-status-wait);
    flex-shrink: 0;
}

/* ---- Mês no celular: grade compacta + lista do dia selecionado ---- */
.agenda-mgrid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 2px;
}

.agenda-mgrid .agenda-month-weekday {
    font-size: 12px;
}

.agenda-mday {
    position: relative;
    height: 52px;
    min-width: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    padding: 0 6px;
    background: none;
    border: none;
    border-radius: 10px;
    color: var(--uc-ink);
    font: inherit;
    cursor: pointer;
}

.agenda-mday-num {
    font-size: 14px;
    font-weight: 700;
    line-height: 24px;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    text-align: center;
}

.agenda-mday-num.today {
    background-color: var(--uc-action-text); /* ver .agenda-week-day-num.today */
    color: var(--uc-brand-on);
}

.agenda-mday.past .agenda-mday-num:not(.today),
.agenda-mday.closed .agenda-mday-num:not(.today) {
    color: var(--uc-ink-4);
}

.agenda-mday .agenda-mday-bar {
    width: 100%;
    margin-bottom: 0;
}

.agenda-mday .agenda-mday-pending {
    position: absolute;
    top: 6px;
    right: 6px;
}

.agenda-mday.selected {
    background-color: var(--uc-brand);
}

.agenda-mday.selected .agenda-mday-num:not(.today) {
    color: var(--uc-brand-on);
}

.agenda-mday.selected .agenda-mday-bar {
    background-color: rgba(var(--uc-surface-rgb), .3);
}

.agenda-mday.selected .agenda-mday-bar > span {
    background-color: var(--uc-brand-on);
}

.agenda-mlist {
    margin-top: 12px;
    border-top: 1px solid var(--uc-line);
    padding-top: 8px;
}

.agenda-mlist-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}

.agenda-mlist-title {
    font-size: 16px;
    font-weight: 700;
    color: var(--uc-ink);
    margin: 0;
}

.agenda-mlist-link {
    min-height: 44px;
    padding: 0 4px;
    background: none;
    border: none;
    border-radius: 8px;
    color: var(--uc-action-text);
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
}

.agenda-mlist-empty {
    font-size: 14px;
    color: var(--uc-ink-3);
    margin: 4px 0 10px;
}

.agenda-mlist-create {
    width: 100%;
    height: 48px;
    background-color: var(--uc-surface);
    border: 1.5px solid var(--uc-brand);
    border-radius: 12px;
    color: var(--uc-brand);
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
}

.agenda-mlist-rows {
    list-style: none;
    margin: 0;
    padding: 0;
}

.agenda-mlist-row {
    width: 100%;
    min-height: 56px;
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 6px 4px;
    background: none;
    border: none;
    border-bottom: 1px solid var(--uc-line);
    border-radius: 0;
    color: var(--uc-ink);
    text-align: left;
    font: inherit;
    cursor: pointer;
}

.agenda-mlist-row.is-past {
    opacity: .55;
}

.agenda-mlist-time {
    flex: 0 0 auto;
    width: 52px;
    font-size: 14px;
    font-weight: 700;
    color: var(--uc-ink-2);
}

.agenda-mlist-text {
    flex: 1 1 auto;
    min-width: 0;
    display: flex;
    flex-direction: column;
}

.agenda-mlist-main,
.agenda-mlist-sub {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.agenda-mlist-main {
    font-size: 15px;
    font-weight: 600;
}

.agenda-mlist-sub {
    font-size: 13px;
    color: var(--uc-ink-3);
}

.agenda-mlist-dot {
    flex: 0 0 auto;
    width: 10px;
    height: 10px;
    border-radius: 50%;
}

@media (hover: hover) {
    .agenda-mday:not(.selected):hover,
    .agenda-mlist-row:hover {
        background-color: var(--uc-surface-soft);
    }
}

.agenda-month-more {
    font-size: 8.5px;
    color: var(--uc-ink-3);
    padding-left: 3px;
}

.agenda-modal .form-label {
    color: var(--uc-ink);
    font-weight: 600;
}

/* Sinal (Sinal via Pix, fase 3b): sub-tela "Sinal" do modal (escolha única), nota do rodapé ao criar,
   "Cobrar sinal" abaixo da linha e a prévia da mensagem na folha depois de salvar. */
.appt-dep-context {
    margin: .25rem 0 .5rem;
    font-size: 14px;
    color: var(--uc-ink-3);
}

.appt-dep-choices {
    display: flex;
    flex-direction: column;
    gap: .5rem;
}

.appt-dep-choice {
    display: flex;
    align-items: flex-start;
    gap: .75rem;
    width: 100%;
    min-height: 56px;
    padding: .875rem;
    border: 1px solid var(--uc-line);
    border-radius: 16px;
    background: var(--uc-surface);
    color: var(--uc-ink);
    font: inherit;
    text-align: left;
}

    .appt-dep-choice.is-on {
        border-color: var(--uc-brand);
        box-shadow: inset 0 0 0 1px var(--uc-brand);
    }

    .appt-dep-choice:focus-visible {
        outline: none;
        box-shadow: 0 0 0 .2rem var(--uc-focus-halo);
    }

.appt-dep-radio {
    flex-shrink: 0;
    width: 22px;
    height: 22px;
    margin-top: 1px;
    border: 2px solid var(--uc-ink-4);
    border-radius: 50%;
    transition: border-width .15s ease, border-color .15s ease;
}

@media (prefers-reduced-motion: reduce) {
    .appt-dep-radio {
        transition: none;
    }
}

.appt-dep-choice.is-on .appt-dep-radio {
    border: 7px solid var(--uc-brand);
}

.appt-dep-choice-main {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.appt-dep-choice-title {
    font-size: 15px;
    font-weight: 600;
}

.appt-dep-choice-hint,
.appt-dep-hint {
    margin: 0;
    font-size: 13px;
    line-height: 1.4;
    color: var(--uc-ink-3);
}

.appt-dep-money {
    position: relative;
}

    .appt-dep-money .appt-input {
        padding-left: 2.75rem;
    }

.appt-dep-currency {
    position: absolute;
    left: .875rem;
    top: 50%;
    transform: translateY(-50%);
    font-weight: 600;
    color: var(--uc-ink-3);
    pointer-events: none;
}

.appt-footer-note {
    margin: 0 0 .5rem;
    font-size: 13px;
    text-align: center;
    color: var(--uc-ink-3);
}

/* Chip compacto, alinhado ao texto da linha (ícone 40px + gap 12px). 36px visíveis; a área de toque de 44px vem do
   ::before, que passa 4px pra cima e pra baixo sem mexer no layout. */
/* Sobe um pouco (a linha tem min-height de 72px e centraliza o texto, sobrando espaço embaixo do valor) e deixa
   12px antes do divisor da próxima linha, o mesmo respiro das outras. */
.appt-pix-send {
    margin: -8px 0 0;
    padding: 0 0 12px 52px;
}

.appt-pix-btn {
    position: relative;
    display: inline-flex;
    align-items: center;
    gap: .375rem;
    height: 36px;
    padding: 0 .875rem;
    border: 1px solid var(--uc-border);
    border-radius: 999px;
    background: var(--uc-surface);
    color: var(--uc-ink-2);
    font-size: 14px;
    font-weight: 600;
    text-decoration: none;
}

    .appt-pix-btn::before {
        content: "";
        position: absolute;
        inset: -4px 0;
    }

    .appt-pix-btn:hover {
        background: var(--uc-surface-soft);
        color: var(--uc-ink-2);
    }

    .appt-pix-btn:focus-visible {
        outline: none;
        box-shadow: 0 0 0 .2rem var(--uc-focus-halo);
    }

    .appt-pix-btn:disabled {
        border-color: var(--uc-disabled-border);
        background: var(--uc-disabled-bg);
        color: var(--uc-disabled-ink);
    }

.appt-pix-hint {
    margin: .25rem 0 0;
    font-size: 12.5px;
    color: var(--uc-ink-3);
}

.appt-pix-preview {
    padding: .75rem .875rem;
    border-radius: 14px;
    background: var(--uc-surface-soft);
    color: var(--uc-ink);
    font-size: 14px;
    line-height: 1.45;
    overflow-wrap: anywhere;
}

.appt-pix-footnote {
    margin: .25rem 0 0;
    font-size: 12px;
    text-align: center;
    color: var(--uc-ink-3);
}

/* Sub-tela "Local" (atendimento a domicílio). */
.appt-home-cep {
    display: grid;
    grid-template-columns: 1.4fr 1fr;
    gap: .5rem;
}

.appt-home-line {
    color: var(--uc-ink);
    font-size: 14px;
}

.appt-home-link {
    align-self: flex-start;
}

.appt-home-save {
    display: flex;
    align-items: center;
    gap: .5rem;
    min-height: 44px;
    margin-top: .5rem;
    font-size: 14px;
    color: var(--uc-ink);
}

/* Celular: topo compacto e grade de ponta a ponta, terminando no topo da barra de abas.
   Os !important vencem as utilities do Bootstrap do markup (pt-2, pb-4, p-2, rounded-3),
   que continuam valendo no desktop. */
@media (max-width: 640.98px) {
    /* -1.1rem desfaz o padding-top de .content (app.css) só aqui; -.25rem desfaz o px-1 lateral de .content. */
    .agenda-shell {
        margin-top: -1.1rem;
        margin-inline: -.25rem;
        width: auto;
        max-width: none; /* 576-640px: .container travava em 540px */
        padding-top: 6px !important;
        padding-inline: .5rem !important;
    }

    /* 576px+: .content passa a px-sm-2 (.5rem). */
    @media (min-width: 576px) {
        .agenda-shell {
            margin-inline: -.5rem;
        }
    }

    .agenda-head,
    .agenda-view-toggle,
    .agenda-free-wrap {
        margin-bottom: 6px;
    }

    .agenda-date-label,
    .agenda-date-sub {
        line-height: 1.25;
    }

    .agenda-nav-btn {
        width: 40px;
        height: 36px;
    }

    .agenda-info-btn {
        width: 40px;
        height: 36px;
    }

    .agenda-info-dot {
        width: 30px;
        height: 30px;
    }

    .agenda-today-btn {
        height: 34px;
    }

    .agenda-view-toggle button {
        height: 34px;
    }

    .agenda-free-pill {
        min-height: 36px;
        margin-bottom: 0;
    }

    .agenda-free-chevron {
        font-size: 11px;
    }

    /* A agenda termina no topo da barra de abas, sem folga, e a página não rola (só .agenda-day-scroll):
       o margin-top acima desfaz o padding-top de .content, e o padding-bottom de main (barra + área
       segura + .75rem, MainLayout.razor.css) sai aqui -- a própria altura já desconta a barra. */
    .page main:has(.agenda-shell-fill) {
        padding-bottom: 0;
    }

    .agenda-shell-fill {
        height: calc(100dvh - var(--uc-bottom-nav-h) - env(safe-area-inset-bottom));
        padding-bottom: 0 !important;
    }

    /* Card da grade de ponta a ponta: sai do padding lateral do container; 6px à esquerda para as horas. */
    .agenda-shell-fill .agenda-day-shell {
        margin-inline: -.5rem;
        padding: 0 0 0 max(6px, env(safe-area-inset-left)) !important;
        border-radius: 0 !important;
    }
}

