/* Ajustes exclusivos da tela PesquisaIa: Vue envolvendo aside/main e sidebar mobile. */
.chat-clean-body {
    overflow: hidden;
}

/* Miolo de entrada da IA (importado de para-importar/pesquisa_ia.html) */
.ia-choice-page {
    background: #f3f6fb;
    padding: 20px 0 16px;
}

.chat-area.chat-area-empty {
    justify-content: flex-start;
}

.ia-choice-container {
    width: min(100%, 980px);
    margin: 0 auto;
    padding: 10px 0 !important;
}

.ia-choice-kicker {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 14px;
    color: var(--teal-dark);
    font-size: 11px;
    font-weight: 800;
    letter-spacing: .14em;
    text-transform: uppercase;
}

.ia-choice-title {
    margin: 0 0 12px;
    color: var(--navy);
    font-size: clamp(34px, 3.8vw, 46px);
    font-weight: 800;
    line-height: 1.08;
}

.ia-choice-intro {
    max-width: 820px;
    margin: 0 0 22px;
    color: var(--text-soft);
    font-size: 15.5px;
    line-height: 1.6;
}

.ia-choice-options {
    display: grid;
    grid-template-columns: 1.35fr 1fr 1fr;
    gap: 12px;
    margin: 0 0 18px;
}

.ia-option-card {
    min-height: 138px;
    border: 1px solid #d7e0ea;
    border-radius: 8px;
    background: #fff;
    box-shadow: 0 2px 8px rgba(5, 29, 73, .08);
    color: var(--navy);
    padding: 20px 18px;
    text-align: left;
    font-family: inherit;
    cursor: pointer;
    transition: transform .15s ease, box-shadow .15s ease, border-color .15s ease;
}

.ia-option-card:hover {
    transform: translateY(-2px);
    border-color: var(--teal);
    box-shadow: 0 8px 18px rgba(5, 29, 73, .12);
}


.ia-option-card.is-featured,
.ia-option-card.selecionado {
    background: #17395f;
    border-color: #17395f;
    color: #fff;
}

.ia-option-card.selecionado p,
.ia-option-card.selecionado h2 {
    color: #eef6ff;
}

.ia-option-card:not(.selecionado) {
    background: #fff;
    color: var(--navy);
    border-color: #d7e0ea;
}

.ia-option-badge {
    display: inline-block;
    margin-bottom: 10px;
    padding: 5px 9px;
    border-radius: 999px;
    background: #e5f7f2;
    color: var(--teal-dark);
    font-size: 10.5px;
    font-weight: 800;
    letter-spacing: .08em;
    line-height: 1;
    text-transform: uppercase;
}

.ia-option-card.is-featured .ia-option-badge {
    background: rgba(255, 255, 255, .16);
    color: #fff;
}

.ia-option-card h2 {
    margin: 0 0 8px;
    color: inherit;
    font-size: 17px;
    font-weight: 800;
    line-height: 1.25;
}

.ia-option-card p {
    margin: 0;
    color: #27415f;
    font-size: 13px;
    line-height: 1.5;
}

.ia-option-card.is-featured p {
    color: #eef6ff;
}

.ia-guided-panel {
    margin: 0 0 12px;
    padding: 18px;
    border: 1px solid #d8e1eb;
    border-radius: 8px;
    background: #fff;
    box-shadow: 0 2px 10px rgba(5, 29, 73, .05);
}

.ia-guided-head {
    display: flex;
    align-items: flex-start;
    gap: 13px;
    margin-bottom: 16px;
}

.ia-guided-icon {
    display: inline-grid;
    place-items: center;
    width: 34px;
    height: 34px;
    border-radius: 8px;
    background: #e5f7f2;
    color: var(--teal-dark);
    flex: 0 0 auto;
}

.ia-guided-head h2 {
    margin: 0 0 4px;
    color: var(--navy);
    font-size: 16px;
    font-weight: 800;
    line-height: 1.25;
}

.ia-guided-head p {
    margin: 0;
    color: #56708d;
    font-size: 12.5px;
    line-height: 1.45;
}

.ia-guided-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 10px;
}

.ia-guided-tool {
    min-height: 94px;
    padding: 15px 12px;
    border: 1px solid #d7e0ea;
    border-radius: 7px;
    background: #f7faff;
    color: var(--navy);
    text-align: left;
    font-family: inherit;
    cursor: pointer;
    transition: background .15s ease, border-color .15s ease, box-shadow .15s ease, transform .15s ease;
}

.ia-guided-tool:hover {
    transform: translateY(-1px);
    background: #fff;
    border-color: var(--teal);
    box-shadow: 0 6px 14px rgba(5, 29, 73, .08);
}

.ia-guided-tool strong {
    display: block;
    margin-bottom: 6px;
    color: var(--navy);
    font-size: 13.5px;
    font-weight: 800;
    line-height: 1.25;
}

.ia-guided-tool span {
    display: block;
    color: #27415f;
    font-size: 12px;
    line-height: 1.4;
}

.app-sidebar {
    height: 100vh;
    min-height: 0;
    overflow: hidden;
}

.history-section {
    display: flex;
    flex: 1 1 auto;
    flex-direction: column;
    min-height: 0;
    overflow: hidden;
}

.history-scroll {
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
    padding-right: 2px;
    scrollbar-width: thin;
    scrollbar-color: #1a3a66 #07162d;
}

.history-scroll > .history-list {
    margin: 0;
}

.history-scroll > ul.history-list {
    padding: 0;
    list-style: none;
}

.side-foot {
    flex: 0 0 auto;
}

.app-sidebar .user-card small {
    display: block;
    max-width: 100%;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    font-size: 12px;
    line-height: 1.2;
    padding-right: 25px;
}

.mobile-sidebar-toggle {
    display: none;
    width: 42px;
    height: 42px;
    border: 1px solid var(--border);
    border-radius: 10px;
    background: #fff;
    color: var(--navy);
    align-items: center;
    justify-content: center;
    flex-direction: column;
    gap: 5px;
    cursor: pointer;
    padding: 0;
}

.mobile-sidebar-toggle span {
    width: 18px;
    height: 2px;
    background: currentColor;
    border-radius: 2px;
}

.sidebar-backdrop {
    display: none;
}

.chat-share-button {
    min-height: 38px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 8px 12px;
    border: 1px solid var(--border);
    border-radius: 999px;
    background: #fff;
    color: var(--navy);
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
    transition: background .15s ease, border-color .15s ease, box-shadow .15s ease, color .15s ease;
}

.chat-share-button:hover:not(:disabled) {
    background: #e8f8f3;
    border-color: rgba(26, 179, 148, .45);
    color: var(--teal-dark);
    box-shadow: var(--shadow-sm);
}

.chat-share-button:disabled {
    cursor: not-allowed;
    opacity: .55;
}

.share-spinner {
    width: 14px;
    height: 14px;
    border: 2px solid rgba(11, 31, 58, .18);
    border-top-color: var(--teal-dark);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

.share-modal-content {
    border: 0;
    border-radius: 16px;
    box-shadow: var(--shadow-lg);
    overflow: hidden;
}

.share-modal-header {
    align-items: flex-start;
    border-bottom: 1px solid var(--border);
    padding: 18px 20px;
}

.share-modal-header .modal-title {
    color: var(--navy);
    font-weight: 800;
    margin: 0;
}

.share-modal-header small {
    color: var(--muted);
    display: block;
    margin-top: 2px;
}

.share-modal-body {
    padding: 18px 20px 8px;
}

.share-warning {
    display: flex;
    gap: 10px;
    align-items: flex-start;
    padding: 12px;
    border: 1px solid #f5d488;
    border-radius: 12px;
    background: #fff7e6;
    color: #6d4f00;
}

.share-warning i {
    flex: 0 0 auto;
    font-size: 18px;
    line-height: 1.3;
}

.share-warning p {
    margin: 0;
    font-size: 13.5px;
    line-height: 1.45;
}

.share-link-box {
    margin-top: 14px;
}

.share-link-input {
    width: 100%;
    min-height: 42px;
    padding: 10px 12px;
    border: 1px solid var(--border);
    border-radius: 10px;
    background: #f8fafd;
    color: var(--text-soft);
    font-size: 13px;
}

.share-modal-footer {
    justify-content: center;
    border-top: 0;
    padding: 12px 20px 20px;
}

.share-copy-button {
    min-width: 170px;
}

.share-copy-success {
    min-width: 170px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 14px;
    border-radius: 10px;
    background: #12805c;
    color: #fff;
    font-weight: 700;
}

.filter-chip-child {
    font-size: 12px;
    padding-inline: 10px;
}

.msg-actions .chip.chip-on {
    background: #e8f8f3;
    border-color: rgba(26, 179, 148, .55);
    color: var(--teal-dark);
}

.feedback-card {
    margin-top: 12px;
    padding: 12px;
    border: 1px solid var(--border);
    border-radius: 12px;
    background: #f8fafd;
}

.feedback-card__head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 8px;
    color: var(--navy);
}

.feedback-card__close {
    width: 24px;
    height: 24px;
    display: grid;
    place-items: center;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: transparent;
    color: var(--muted);
    font-size: 20px;
    line-height: 1;
    cursor: pointer;
}

.feedback-card__close:hover {
    background: rgba(11, 31, 58, .08);
    color: var(--navy);
}

.feedback-card textarea {
    width: 100%;
    min-height: 76px;
    resize: vertical;
    padding: 10px 12px;
    border: 1px solid var(--border);
    border-radius: 10px;
    background: #fff;
    color: var(--text);
    outline: none;
}

.feedback-card textarea:focus {
    border-color: rgba(26, 179, 148, .65);
    box-shadow: 0 0 0 3px rgba(26, 179, 148, .12);
}

.feedback-card__actions {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
    margin-top: 10px;
    flex-wrap: wrap;
}

.chat-area .agradecimento-feedback {
    display: block;
    width: min(100%, 860px);
    margin: 8px auto 14px;
    padding-left: 48px;
    color: var(--muted);
    font-size: 13px;
    text-align: left;
}

.chat-area .conjunto-aviso {
    width: min(100%, 720px);
    margin: 4px auto 12px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
}

.chat-area .conjunto-mensagem-de-erro {
    width: 100%;
    display: flex;
    align-items: flex-start;
    gap: 14px;
    padding: 18px 20px;
    border: 1px solid #f0c8c3;
    border-left: 4px solid var(--danger);
    border-radius: 14px;
    background: linear-gradient(180deg, #fffafa 0%, #fff 100%);
    box-shadow: 0 10px 28px rgba(91, 26, 18, .08);
    color: var(--text);
}

.chat-error-icon {
    width: 38px;
    height: 38px;
    flex: 0 0 38px;
    display: inline-grid;
    place-items: center;
    border-radius: 10px;
    background: #fdecea;
    color: var(--danger);
    font-size: 18px;
    line-height: 1;
}

.chat-error-content {
    min-width: 0;
}

.chat-error-content strong {
    display: block;
    margin: 0;
    color: var(--navy);
    font-size: 15px;
    font-weight: 800;
    line-height: 1.35;
}

.chat-error-content p {
    margin: 4px 0 0;
    color: var(--text-soft);
    font-size: 14px;
    line-height: 1.5;
}

.chat-area .iniciar-novo-topico {
    width: 100%;
    display: flex;
    justify-content: center;
}

.chat-area .btn-novo-topico {
    min-height: 38px;
    padding: 8px 16px;
    border: 1px solid #d9e2ed;
    border-radius: 10px;
    background: #fff;
    color: var(--navy);
    font-family: inherit;
    font-size: 14px;
    font-weight: 700;
    line-height: 1.2;
    box-shadow: var(--shadow-sm);
    cursor: pointer;
    transition: background .15s ease, border-color .15s ease, color .15s ease, transform .05s ease;
}

.chat-area .btn-novo-topico:hover {
    border-color: var(--teal);
    background: #f4fbf9;
    color: var(--teal-dark);
}

.chat-area .btn-novo-topico:active {
    transform: translateY(1px);
}

.composer-textarea-row {
    position: relative;
    display: flex;
    align-items: stretch;
    width: 100%;
}

.composer-textarea-row textarea {
    padding-right: 52px;
}

.composer-attachment-preview {
    width: fit-content;
    max-width: 100%;
    margin-bottom: 8px;
    cursor: pointer;
}

.composer-attachment-card {
    position: relative;
    display: flex;
    align-items: center;
    gap: 10px;
    max-width: min(100%, 360px);
    min-height: 58px;
    padding: 8px 38px 8px 8px;
    background: #f8fafd;
    border: 1px solid var(--border);
    border-radius: 12px;
    box-shadow: var(--shadow-sm);
    overflow: hidden;
}

.composer-attachment-thumb {
    width: 42px;
    height: 42px;
    flex: 0 0 42px;
    display: grid;
    place-items: center;
    border-radius: 10px;
    overflow: hidden;
    background: #e8f0fb;
    color: var(--navy);
}

.composer-attachment-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.composer-attachment-icon {
    font-size: 22px;
    line-height: 1;
}

.composer-attachment-info {
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.composer-attachment-info strong,
.file-bubble__name {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.composer-attachment-info strong {
    color: var(--navy);
    font-size: 13px;
    line-height: 1.25;
}

.composer-attachment-info small {
    color: var(--muted);
    font-size: 12px;
    line-height: 1.2;
}

.composer-attachment-remove {
    position: absolute;
    top: 7px;
    right: 7px;
    width: 22px;
    height: 22px;
    display: grid;
    place-items: center;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: #0b1930;
    color: #fff;
    font-size: 16px;
    line-height: 1;
    cursor: pointer;
}

.composer-attachment-remove:hover {
    background: var(--navy-2);
}

.composer-attachment-loading {
    position: absolute;
    inset: 0;
    display: grid;
    place-items: center;
    background: rgba(255, 255, 255, .72);
}

.anexo-enviado .file-bubble {
    max-width: min(80%, 420px);
}

@media (max-width: 500px) {
    .composer-attachment-card,
    .anexo-enviado .file-bubble {
        max-width: 100%;
    }

    .chat-area .conjunto-mensagem-de-erro {
        flex-direction: column;
        align-items: center;
        padding: 18px 16px;
        text-align: center;
    }

    .share-label {
        display: none;
    }

    .chat-share-button {
        width: 38px;
        padding: 8px;
        border-radius: 50%;
    }

    .ia-choice-title {
        font-size: 30px;
    }

    .ia-guided-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 900px) {
    .app-shell {
        grid-template-columns: 1fr;
    }

    .mobile-sidebar-toggle {
        display: inline-flex;
    }

    .app-sidebar {
        display: flex !important;
        position: fixed;
        inset: 0 auto 0 0;
        z-index: 1060;
        width: min(82vw, 320px);
        transform: translateX(-100%);
        transition: transform .24s ease;
        box-shadow: var(--shadow-lg);
    }

    .app-sidebar.is-open {
        transform: translateX(0);
    }

    .sidebar-backdrop {
        display: block;
        position: fixed;
        inset: 0;
        z-index: 1055;
        background: rgba(7, 22, 45, .48);
    }

    .app-topbar {
        padding: 12px 16px;
    }

    .ia-choice-page {
        padding: 16px 0 12px;
    }

    .ia-choice-options {
        grid-template-columns: 1fr;
        margin-bottom: 16px;
    }

    .ia-guided-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

.history-scroll::-webkit-scrollbar {
    width: 8px;
}

.history-scroll::-webkit-scrollbar-track {
    background: #07162d;
    border-radius: 999px;
}

.history-scroll::-webkit-scrollbar-thumb {
    background: #1a3a66;
    border: 2px solid #07162d;
    border-radius: 999px;
}

.history-scroll::-webkit-scrollbar-thumb:hover {
    background: #1ab394;
}
