/* Assistente virtual — visual moderno (escopo isolado do portal) */
#portal-bot-root,
#portal-bot-root * {
    box-sizing: border-box;
}

#portal-bot-root .portal-bot__panel,
#portal-bot-root .portal-bot__toggle,
#portal-bot-root .portal-bot__msg,
#portal-bot-root .portal-bot__typing,
#portal-bot-root .portal-bot__quick-btn,
#portal-bot-root .portal-bot__input,
#portal-bot-root .portal-bot__send,
#portal-bot-root .portal-bot__avatar,
#portal-bot-root .portal-bot__close,
#portal-bot-root .portal-bot__toggle-badge {
    border-radius: 9999px !important;
}

#portal-bot-root .portal-bot__panel {
    border-radius: 1.25rem !important;
}

#portal-bot-root .portal-bot__header {
    border-radius: 0 !important;
}

#portal-bot-root .portal-bot__input-row {
    border-radius: 0 !important;
}

#portal-bot-root .portal-bot__msg--bot {
    border-radius: 1rem 1rem 1rem 0.35rem !important;
}

#portal-bot-root .portal-bot__msg--user {
    border-radius: 1rem 1rem 0.35rem 1rem !important;
}

#portal-bot-root .portal-bot__typing-wrap {
    border-radius: 1rem !important;
}

/* Dock flutuante — botões empilhados no canto inferior direito */
.portal-float-dock {
    position: fixed;
    right: max(1rem, env(safe-area-inset-right, 0px));
    bottom: max(1rem, env(safe-area-inset-bottom, 0px));
    z-index: 95;
    display: flex;
    flex-direction: column-reverse;
    align-items: flex-end;
    gap: 0.65rem;
    pointer-events: none;
}
.portal-float-dock > * {
    pointer-events: auto;
}
.portal-float-dock__btn {
    width: 3.25rem;
    height: 3.25rem;
    flex-shrink: 0;
}
.portal-float-dock__top {
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    background: #4A90E2;
    border: 2px solid #3a78c4;
    box-shadow: 0 8px 20px rgba(74, 144, 226, 0.3);
    opacity: 0;
    pointer-events: none;
    transform: translateY(6px);
    transition: opacity 0.25s ease, transform 0.25s ease, background-color 0.2s ease;
}
.portal-float-dock__top.visible {
    opacity: 1;
    pointer-events: auto;
    transform: translateY(0);
}
.portal-float-dock__top:hover {
    background: #3a78c4;
}

/* VLibras — acima da aba de privacidade, no canto esquerdo */
div[vw] {
    z-index: 90 !important;
}
div[vw-access-button],
.vpw-access-button,
[vw-access-button] {
    left: max(1rem, env(safe-area-inset-left, 0px)) !important;
    right: auto !important;
    bottom: 4.75rem !important;
}

.portal-bot {
    position: relative;
    bottom: auto;
    right: auto;
    z-index: 1;
    font-family: 'Inter', sans-serif;
    max-width: none;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 0.55rem;
    transition: none;
}

/* Balão-convite do assistente */
.portal-bot__teaser {
    position: relative;
    width: min(17.5rem, calc(100vw - 5.5rem));
    padding: 0;
    color: #0f172a;
    background: #fff;
    border: 1px solid rgba(226, 232, 240, 0.95);
    border-radius: 1.15rem 1.15rem 0.45rem 1.15rem !important;
    box-shadow:
        0 18px 40px rgba(15, 23, 42, 0.18),
        0 0 0 1px rgba(255, 255, 255, 0.65) inset;
    opacity: 0;
    transform: translateY(10px) scale(0.94);
    pointer-events: none;
    transition: opacity 0.35s ease, transform 0.4s cubic-bezier(0.34, 1.35, 0.64, 1);
    overflow: hidden;
}

.portal-bot__teaser::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 4px;
    background: linear-gradient(180deg, #4DB8C1 0%, #4A90E2 100%);
}

.portal-bot__teaser.is-visible {
    opacity: 1;
    transform: translateY(0) scale(1);
    pointer-events: auto;
}

.portal-bot__teaser-inner {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    padding: 0.85rem 2.1rem 0.95rem 1rem;
}

.portal-bot__teaser-eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.68rem;
    font-weight: 800;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: #0f766e;
}

.portal-bot__teaser-dot {
    width: 0.5rem;
    height: 0.5rem;
    border-radius: 999px;
    background: #22c55e;
    box-shadow: 0 0 0 4px rgba(34, 197, 94, 0.18);
    animation: portalBotPulse 1.8s ease-in-out infinite;
}

@keyframes portalBotPulse {
    0%, 100% { box-shadow: 0 0 0 3px rgba(34, 197, 94, 0.16); }
    50% { box-shadow: 0 0 0 6px rgba(34, 197, 94, 0.08); }
}

.portal-bot__teaser-title {
    font-size: 0.95rem;
    font-weight: 800;
    color: #0f172a;
    line-height: 1.25;
}

.portal-bot__teaser-text {
    margin: 0;
    font-size: 0.78rem;
    font-weight: 500;
    line-height: 1.45;
    color: #64748b;
}

.portal-bot__teaser-close {
    position: absolute;
    top: 0.45rem;
    right: 0.45rem;
    width: 1.45rem;
    height: 1.45rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #94a3b8;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 999px !important;
    cursor: pointer;
    line-height: 1;
    transition: color 0.15s ease, background 0.15s ease, border-color 0.15s ease;
}

.portal-bot__teaser-close:hover {
    color: #334155;
    background: #f1f5f9;
    border-color: #cbd5e1;
}

@media (max-width: 900px) {
    .portal-bot__teaser { display: none; }
}

.portal-bot__toggle {
    position: relative;
    width: 3.5rem;
    height: 3.5rem;
    background: linear-gradient(135deg, #4DB8C1 0%, #4A90E2 55%, #7BA0CC 100%);
    color: #fff;
    border: none;
    box-shadow:
        0 10px 30px rgba(74, 144, 226, 0.35),
        0 0 0 1px rgba(255, 255, 255, 0.15) inset;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: transform 0.25s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.25s ease;
}

.portal-bot__toggle:hover {
    transform: translateY(-3px) scale(1.04);
    box-shadow:
        0 16px 40px rgba(74, 144, 226, 0.45),
        0 0 0 1px rgba(255, 255, 255, 0.2) inset;
}

.portal-bot__toggle:focus-visible {
    outline: 2px solid #4DB8C1;
    outline-offset: 3px;
}

/* Alterna entre o ícone de chat e o de fechar conforme o estado do painel */
.portal-bot__toggle-icon {
    position: absolute;
    transition: opacity 0.2s ease, transform 0.25s cubic-bezier(0.34, 1.4, 0.64, 1);
}

.portal-bot__toggle-icon--close,
.portal-bot.is-open .portal-bot__toggle-icon--open {
    opacity: 0;
    transform: rotate(-90deg) scale(0.6);
}

.portal-bot.is-open .portal-bot__toggle-icon--close {
    opacity: 1;
    transform: rotate(0) scale(1);
}

.portal-bot__header-actions {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    position: relative;
    z-index: 1;
}

.portal-bot__toggle-badge {
    position: absolute;
    top: 2px;
    right: 2px;
    width: 11px;
    height: 11px;
    background: #99CC4C;
    border: 2px solid #fff;
    animation: portal-bot-pulse 2s infinite;
}

@keyframes portal-bot-pulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.65; transform: scale(0.88); }
}

.portal-bot__panel {
    position: fixed;
    bottom: calc(6.75rem + env(safe-area-inset-bottom, 0px));
    right: max(1rem, env(safe-area-inset-right, 0px));
    left: auto;
    width: min(32rem, calc(100vw - 2rem));
    height: min(40rem, calc(100dvh - 8.5rem));
    max-height: min(40rem, calc(100dvh - 8.5rem));
    background: rgba(255, 255, 255, 0.98);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid rgba(226, 232, 240, 0.9);
    box-shadow:
        0 24px 64px rgba(15, 23, 42, 0.18),
        0 0 0 1px rgba(255, 255, 255, 0.6) inset;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    transform-origin: bottom right;
    transition: opacity 0.3s ease, transform 0.35s cubic-bezier(0.34, 1.2, 0.64, 1), visibility 0.3s;
}

@media (min-width: 641px) {
    .portal-bot__panel {
        right: max(1rem, env(safe-area-inset-right, 0px));
    }
}

.portal-bot__panel.is-hidden {
    opacity: 0;
    transform: scale(0.9) translateY(12px);
    pointer-events: none;
    visibility: hidden;
}

.portal-bot__panel:not(.is-hidden) {
    opacity: 1;
    transform: scale(1) translateY(0);
    visibility: visible;
}

.portal-bot__header {
    background: linear-gradient(125deg, #2d5432 0%, #3a6344 22%, #4d7288 45%, #52a8ad 58%, #7aa858 100%);
    color: #fff;
    padding: 1rem 1.25rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    flex-shrink: 0;
    position: relative;
    z-index: 5;
    overflow: hidden;
    box-shadow: 0 4px 16px rgba(15, 23, 42, 0.12);
}

.portal-bot__header::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.12) 0%, transparent 60%);
    pointer-events: none;
}

.portal-bot__header-info {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    min-width: 0;
    position: relative;
    z-index: 1;
}

.portal-bot__avatar {
    width: 2.5rem;
    height: 2.5rem;
    background: rgba(255, 255, 255, 0.18);
    border: 1px solid rgba(255, 255, 255, 0.35);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    color: #fff;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.12);
}

.portal-bot__title {
    font-weight: 700;
    font-size: 0.9375rem;
    line-height: 1.25;
    letter-spacing: -0.01em;
}

.portal-bot__subtitle {
    display: flex;
    align-items: center;
    gap: 0.375rem;
    font-size: 0.6875rem;
    color: rgba(255, 255, 255, 0.82);
    margin-top: 0.2rem;
}

.portal-bot__status-dot {
    width: 7px;
    height: 7px;
    background: #99CC4C;
    border-radius: 50% !important;
    box-shadow: 0 0 0 2px rgba(153, 204, 76, 0.35);
    animation: portal-bot-pulse 2.5s infinite;
}

.portal-bot__close {
    position: relative;
    z-index: 1;
    width: 2rem;
    height: 2rem;
    padding: 0;
    color: rgba(255, 255, 255, 0.85);
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.15s, color 0.15s, transform 0.15s;
}

.portal-bot__close:hover {
    color: #fff;
    background: rgba(255, 255, 255, 0.22);
    transform: scale(1.05);
}

.portal-bot__messages {
    flex: 1 1 auto;
    min-height: 0;
    min-width: 0;
    overflow-x: hidden;
    overflow-y: auto;
    padding: 1.25rem;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    background:
        radial-gradient(circle at 100% 0%, rgba(77, 184, 193, 0.06) 0%, transparent 45%),
        radial-gradient(circle at 0% 100%, rgba(74, 144, 226, 0.05) 0%, transparent 40%),
        #f8fafc;
    scroll-behavior: smooth;
}

.portal-bot__messages::-webkit-scrollbar {
    width: 5px;
}

.portal-bot__messages::-webkit-scrollbar-thumb {
    background: rgba(148, 163, 184, 0.45);
    border-radius: 999px;
}

.portal-bot__msg {
    max-width: 92%;
    min-width: 0;
    padding: 0.7rem 0.95rem;
    font-size: 0.8125rem;
    line-height: 1.55;
    word-break: break-word;
    overflow-wrap: anywhere;
    animation: portal-bot-msg-in 0.35s ease;
}

@keyframes portal-bot-msg-in {
    from { opacity: 0; transform: translateY(6px); }
    to { opacity: 1; transform: translateY(0); }
}

.portal-bot__msg--bot {
    align-self: flex-start;
    background: #fff;
    color: #334155;
    border: 1px solid rgba(226, 232, 240, 0.95);
    box-shadow: 0 2px 8px rgba(15, 23, 42, 0.05);
}

.portal-bot__msg--user {
    align-self: flex-end;
    background: linear-gradient(135deg, #4A90E2 0%, #3a78c4 100%);
    color: #fff;
    box-shadow: 0 4px 14px rgba(74, 144, 226, 0.28);
}

.portal-bot__msg strong {
    font-weight: 700;
    color: inherit;
}

.portal-bot__msg a {
    color: #2563eb;
    text-decoration: none;
    font-weight: 600;
    border-bottom: 1px solid rgba(37, 99, 235, 0.35);
    transition: border-color 0.15s;
}

.portal-bot__msg a:hover {
    border-bottom-color: #2563eb;
}

.portal-bot__msg--user a {
    color: #fff;
    border-bottom-color: rgba(255, 255, 255, 0.5);
}

.portal-bot__contacts {
    margin-top: 0.625rem;
    display: flex;
    flex-direction: column;
    gap: 0.375rem;
    min-width: 0;
    max-width: 100%;
}

.portal-bot__contact-item {
    padding: 0.5rem 0.75rem;
    background: #f1f5f9;
    border: 1px solid #e2e8f0;
    border-radius: 0.625rem !important;
    font-size: 0.8125rem;
    word-break: break-word;
    overflow-wrap: anywhere;
    line-height: 1.45;
}

.portal-bot__contact-item strong {
    display: block;
    font-size: 0.6875rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: #64748b;
    margin-bottom: 0.2rem;
}

.portal-bot__privacy-block {
    margin-top: 0.5rem;
    padding-top: 0.5rem;
    border-top: 1px dashed #e2e8f0;
}

.portal-bot__privacy-block strong {
    display: block;
    color: #1e293b;
    font-size: 0.8125rem;
    margin-bottom: 0.25rem;
}

.portal-bot__privacy-block span {
    display: block;
    color: #475569;
    line-height: 1.5;
}

.portal-bot__contact-item a {
    border-bottom: none;
}

.portal-bot__typing-wrap {
    align-self: flex-start;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.55rem 0.85rem;
    background: #fff;
    border: 1px solid #e2e8f0;
    box-shadow: 0 2px 8px rgba(15, 23, 42, 0.04);
    animation: portal-bot-msg-in 0.25s ease;
}

.portal-bot__typing {
    display: flex;
    gap: 4px;
    align-items: center;
}

.portal-bot__typing span {
    width: 7px;
    height: 7px;
    background: #4A90E2;
    border-radius: 50% !important;
    animation: portal-bot-typing 1.2s infinite;
}

.portal-bot__typing span:nth-child(2) { animation-delay: 0.15s; }
.portal-bot__typing span:nth-child(3) { animation-delay: 0.3s; }

.portal-bot__typing-label {
    font-size: 0.6875rem;
    font-weight: 600;
    color: #64748b;
    letter-spacing: 0.01em;
}

@keyframes portal-bot-typing {
    0%, 60%, 100% { transform: translateY(0); opacity: 0.35; }
    30% { transform: translateY(-5px); opacity: 1; }
}

.portal-bot__quick {
    padding: 0.625rem 1rem 0.875rem;
    background: #f8fafc;
    border-top: 1px solid rgba(226, 232, 240, 0.8);
    flex-shrink: 0;
    min-width: 0;
    overflow-x: hidden;
}

.portal-bot__quick-label {
    font-size: 0.75rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.07em;
    color: #334155;
    margin: 0 0 0.625rem;
    padding: 0.35rem 0.5rem;
    background: linear-gradient(90deg, rgba(74, 144, 226, 0.1) 0%, transparent 100%);
    border-left: 3px solid #4A90E2;
}

.portal-bot__quick-list {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    max-width: 100%;
}

.portal-bot__quick-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.75rem;
    font-weight: 700;
    padding: 0.55rem 0.9rem;
    background: #fff;
    color: #1e293b;
    border: 1.5px solid #cbd5e1;
    cursor: pointer;
    transition: background 0.15s, border-color 0.15s, color 0.15s, transform 0.15s, box-shadow 0.15s;
    white-space: nowrap;
    box-shadow: 0 2px 6px rgba(15, 23, 42, 0.06);
}

.portal-bot__quick-btn--featured {
    border-color: #93c5fd;
    background: linear-gradient(180deg, #ffffff 0%, #f0f9ff 100%);
    color: #1d4ed8;
    box-shadow: 0 3px 10px rgba(74, 144, 226, 0.15);
}

.portal-bot__quick-btn--featured:hover {
    background: linear-gradient(180deg, #eff6ff 0%, #dbeafe 100%);
    border-color: #4A90E2;
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(74, 144, 226, 0.22);
}

.portal-bot__quick-btn:hover {
    background: #eff6ff;
    border-color: #93c5fd;
    color: #1d4ed8;
    transform: translateY(-1px);
    box-shadow: 0 4px 10px rgba(74, 144, 226, 0.12);
}

.portal-bot__quick-btn--accent {
    background: linear-gradient(135deg, #ecfccb 0%, #d9f99d 100%);
    border-color: #84cc16;
    color: #365314;
    font-weight: 800;
}

.portal-bot__quick-btn--accent:hover {
    background: linear-gradient(135deg, #99CC4C 0%, #7aa858 100%);
    border-color: #65a30d;
    color: #fff;
}

.portal-bot__verify-hints {
    margin-top: 0.75rem;
    padding: 0.65rem 0.75rem;
    background: #f0f9ff;
    border: 1px solid #bae6fd;
    border-radius: 0.5rem;
    color: #0f172a;
    font-size: 0.875rem;
}

.portal-bot__verify-hints ul {
    margin: 0.35rem 0 0;
    padding-left: 1.1rem;
}

.portal-bot__verify-hints li {
    margin-bottom: 0.2rem;
}

.portal-bot__verify-tip {
    display: inline-block;
    margin-top: 0.35rem;
    padding: 0.35rem 0.55rem;
    background: #f8fafc;
    border: 1px dashed #cbd5e1;
    border-radius: 0.375rem;
    font-size: 0.8125rem;
    color: #475569;
}

.portal-bot__fin-hint {
    font-size: 0.75rem;
    font-weight: 500;
    color: #64748b;
}

.portal-bot__fin-list {
    margin: 0.65rem 0 0;
    display: flex;
    flex-direction: column;
    gap: 0.55rem;
}

.portal-bot__fin-entry {
    padding: 0.65rem 0.75rem;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 0.5rem;
    color: #334155;
}

.portal-bot__fin-entry-meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.35rem 0.5rem;
    margin-bottom: 0.45rem;
}

.portal-bot__fin-date {
    font-size: 0.8125rem;
    font-weight: 800;
    color: #2c3e50;
    white-space: nowrap;
}

.portal-bot__fin-credor {
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
    margin-bottom: 0.25rem;
}

.portal-bot__fin-credor strong {
    font-size: 0.875rem;
    line-height: 1.35;
    color: #1e293b;
    word-break: break-word;
}

.portal-bot__fin-doc {
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
    font-size: 0.75rem;
    color: #64748b;
}

.portal-bot__fin-unidade {
    font-size: 0.75rem;
    font-weight: 600;
    color: #475569;
    margin-bottom: 0.25rem;
}

.portal-bot__fin-valor {
    font-size: 0.9375rem;
    font-weight: 800;
    color: #0f172a;
    font-variant-numeric: tabular-nums;
}

.portal-bot__fin-empty {
    font-size: 0.75rem;
    color: #94a3b8;
}

.portal-bot__fin-more {
    display: inline-block;
    font-size: 0.8125rem;
    color: #64748b;
}

.portal-bot__timeline {
    margin-top: 0.75rem;
    display: flex;
    flex-direction: column;
    gap: 0.625rem;
}

.portal-bot__timeline-item {
    padding: 0.65rem 0.8rem;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-left: 3px solid #4A90E2;
    border-radius: 0.625rem !important;
}

.portal-bot__timeline-item--resposta {
    border-left-color: #99CC4C;
}

.portal-bot__timeline-item--conclusao {
    border-left-color: #2D5A27;
}

.portal-bot__timeline-date {
    font-size: 0.6875rem;
    font-weight: 700;
    color: #64748b;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    margin-bottom: 0.2rem;
}

.portal-bot__timeline-title {
    font-size: 0.8125rem;
    font-weight: 800;
    color: #1e293b;
    margin-bottom: 0.25rem;
}

.portal-bot__timeline-desc {
    font-size: 0.8125rem;
    color: #475569;
    line-height: 1.45;
    white-space: pre-wrap;
}

.portal-bot__quick-icon {
    width: 0.875rem;
    height: 0.875rem;
    flex-shrink: 0;
}

.portal-bot__input-row {
    display: flex;
    gap: 0.5rem;
    padding: 0.875rem 1rem;
    border-top: 1px solid rgba(226, 232, 240, 0.9);
    background: #fff;
    flex-shrink: 0;
}

.portal-bot.is-replying .portal-bot__input {
    opacity: 0.65;
}

.portal-bot.is-session-ended .portal-bot__input-row {
    opacity: 0.65;
    pointer-events: none;
}

.portal-bot.is-session-ended .portal-bot__header {
    box-shadow: 0 4px 16px rgba(15, 23, 42, 0.12);
}

.portal-bot__input {
    flex: 1;
    min-width: 0;
    padding: 0.625rem 1rem;
    font-size: 0.8125rem;
    border: 1px solid #e2e8f0;
    background: #f8fafc;
    outline: none;
    transition: border-color 0.15s, background 0.15s, box-shadow 0.15s;
}

.portal-bot__input:focus {
    border-color: #4A90E2;
    background: #fff;
    box-shadow: 0 0 0 3px rgba(74, 144, 226, 0.12);
}

.portal-bot__input::placeholder {
    color: #94a3b8;
}

.portal-bot__send {
    width: 2.625rem;
    height: 2.625rem;
    padding: 0;
    background: linear-gradient(135deg, #4DB8C1 0%, #4A90E2 100%);
    color: #fff;
    border: none;
    cursor: pointer;
    transition: transform 0.15s, box-shadow 0.15s, opacity 0.15s;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    box-shadow: 0 4px 12px rgba(74, 144, 226, 0.3);
}

.portal-bot__send:hover:not(:disabled) {
    transform: scale(1.05);
    box-shadow: 0 6px 16px rgba(74, 144, 226, 0.38);
}

.portal-bot__send:disabled {
    opacity: 0.45;
    cursor: not-allowed;
    transform: none;
}

.portal-bot.is-open .portal-bot__toggle-badge {
    display: none;
}

/* Com o painel aberto, o dock some — o fecho fica no cabeçalho do chat (evita sobrepor o enviar) */
.portal-float-dock:has(.portal-bot.is-open) .portal-bot__toggle,
.portal-float-dock:has(.portal-bot.is-open) .portal-float-dock__top {
    display: none !important;
}

.portal-bot.is-open .portal-bot__panel {
    bottom: max(1rem, env(safe-area-inset-bottom, 0px));
    height: min(42rem, calc(100dvh - 2rem));
    max-height: min(42rem, calc(100dvh - 2rem));
    z-index: 96;
}

@media (max-width: 640px) {
    .portal-float-dock {
        right: max(0.75rem, env(safe-area-inset-right, 0px));
        bottom: max(0.75rem, env(safe-area-inset-bottom, 0px));
    }

    .portal-bot__panel {
        width: calc(100vw - 1.5rem);
        height: calc(100dvh - 7rem);
        max-height: calc(100dvh - 7rem);
        right: max(0.75rem, env(safe-area-inset-right, 0px));
        bottom: calc(5.25rem + env(safe-area-inset-bottom, 0px));
    }

    .portal-bot.is-open .portal-bot__panel {
        bottom: max(0.75rem, env(safe-area-inset-bottom, 0px));
        height: calc(100dvh - 1.5rem);
        max-height: calc(100dvh - 1.5rem);
    }

    .portal-bot__quick-btn {
        white-space: normal;
        text-align: left;
        max-width: 100%;
    }
}

@media (prefers-reduced-motion: reduce) {
    .portal-bot__panel,
    .portal-bot__toggle,
    .portal-bot__toggle-badge,
    .portal-bot__msg,
    .portal-bot__typing-wrap,
    .portal-bot__status-dot {
        transition: none;
        animation: none;
    }
}
