:root {
    --mar-bg: #ffffff;
    --mar-surface: #f7f7f8;
    --mar-surface-2: #efeff1;
    --mar-border: #e4e4e7;
    --mar-text: #18181b;
    --mar-muted: #71717a;
    --mar-accent: #3c2365;
    --mar-accent-soft: #f2eef8;
    --mar-sidebar: #f4f4f5;
    --mar-radius: 16px;
    --mar-shadow: 0 14px 40px rgba(0,0,0,.08);
}

.mar-app,
.mar-app * {
    box-sizing: border-box;
}

.mar-app {
    min-height: 100vh;
    width: 100%;
    display: grid;
    grid-template-columns: 280px minmax(0, 1fr);
    background: var(--mar-bg);
    color: var(--mar-text);
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    overflow: hidden;
}

.mar-sidebar {
    background: var(--mar-sidebar);
    border-right: 1px solid var(--mar-border);
    display: flex;
    flex-direction: column;
    padding: 14px;
    min-width: 0;
    z-index: 30;
}

.mar-sidebar-top,
.mar-topbar,
.mar-profile,
.mar-topbar-left,
.mar-topbar-actions,
.mar-composer-actions,
.mar-panel-header,
.mar-admin-card {
    display: flex;
    align-items: center;
}

.mar-sidebar-top {
    justify-content: space-between;
    min-height: 44px;
}

.mar-brand {
    appearance: none;
    border: 0;
    background: transparent;
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: default;
    padding: 6px;
    color: var(--mar-text);
    font-weight: 700;
}

.mar-brand-mark,
.mar-hero-mark {
    display: grid;
    place-items: center;
    background: var(--mar-accent);
    color: #fff;
    font-weight: 800;
}

.mar-brand-mark {
    width: 30px;
    height: 30px;
    border-radius: 9px;
}

.mar-brand-text {
    font-size: 14px;
}

.mar-icon-button {
    border: 0;
    background: transparent;
    cursor: pointer;
    border-radius: 10px;
    min-width: 36px;
    min-height: 36px;
    font-size: 18px;
}

.mar-icon-button:hover {
    background: var(--mar-surface-2);
}

.mar-close-mobile,
.mar-open-mobile {
    display: none;
}

.mar-new-chat {
    margin-top: 12px;
    min-height: 44px;
    border: 1px solid var(--mar-border);
    border-radius: 12px;
    background: #fff;
    padding: 0 12px;
    display: flex;
    align-items: center;
    gap: 9px;
    cursor: pointer;
    font-weight: 650;
}

.mar-new-chat:hover {
    background: #fafafa;
}

.mar-plus {
    font-size: 20px;
    line-height: 1;
}

.mar-search-wrap {
    margin-top: 10px;
}

.mar-search {
    min-height: 42px;
    border-radius: 12px;
    background: #fff;
    border: 1px solid transparent;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 0 10px;
}

.mar-search:focus-within {
    border-color: #cfcfd4;
}

.mar-search-icon {
    color: var(--mar-muted);
    font-size: 18px;
}

.mar-search input {
    width: 100%;
    border: 0;
    outline: 0;
    background: transparent;
    font: inherit;
    font-size: 13px;
}

.mar-nav {
    margin-top: 16px;
    display: grid;
    gap: 4px;
}

.mar-nav-item {
    border: 0;
    background: transparent;
    min-height: 40px;
    border-radius: 10px;
    text-align: left;
    padding: 0 10px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 9px;
    font-weight: 600;
    color: #3f3f46;
}

.mar-nav-item:hover,
.mar-nav-item.is-active {
    background: #e9e9eb;
}

.mar-nav-dot {
    width: 7px;
    height: 7px;
    border-radius: 999px;
    background: #a1a1aa;
}

.mar-nav-item.is-active .mar-nav-dot {
    background: var(--mar-accent);
}

.mar-sidebar-label {
    margin: 20px 8px 8px;
    font-size: 11px;
    font-weight: 800;
    letter-spacing: .08em;
    text-transform: uppercase;
    color: #8b8b93;
}

.mar-history {
    display: grid;
    gap: 2px;
}

.mar-history-item {
    border: 0;
    background: transparent;
    border-radius: 9px;
    min-height: 36px;
    padding: 0 10px;
    text-align: left;
    cursor: pointer;
    color: #52525b;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.mar-history-item:hover {
    background: #e9e9eb;
}

.mar-sidebar-spacer {
    flex: 1;
}

.mar-profile {
    border-top: 1px solid var(--mar-border);
    padding-top: 12px;
    gap: 10px;
}

.mar-avatar {
    width: 34px;
    height: 34px;
    border-radius: 999px;
    display: grid;
    place-items: center;
    color: #fff;
    background: #27272a;
    font-weight: 800;
}

.mar-profile-copy {
    display: grid;
    min-width: 0;
    flex: 1;
}

.mar-profile-copy strong {
    font-size: 13px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.mar-profile-copy span {
    font-size: 11px;
    color: var(--mar-muted);
}

.mar-profile-more {
    border: 0;
    background: transparent;
    cursor: pointer;
    letter-spacing: 1px;
}

.mar-main {
    min-width: 0;
    min-height: 100vh;
    display: grid;
    grid-template-rows: auto 1fr auto;
    position: relative;
}

.mar-topbar {
    min-height: 66px;
    padding: 0 22px;
    border-bottom: 1px solid rgba(228,228,231,.85);
    justify-content: space-between;
    gap: 16px;
    background: rgba(255,255,255,.93);
    backdrop-filter: blur(12px);
}

.mar-topbar-left {
    gap: 10px;
    min-width: 0;
}

.mar-agent-name {
    font-size: 14px;
    font-weight: 800;
}

.mar-agent-subtitle {
    font-size: 11px;
    color: var(--mar-muted);
    margin-top: 1px;
}

.mar-topbar-actions {
    gap: 8px;
}

.mar-status-chip {
    border-radius: 999px;
    padding: 7px 10px;
    background: var(--mar-accent-soft);
    color: var(--mar-accent);
    font-size: 11px;
    font-weight: 800;
}

.mar-secondary-button {
    min-height: 36px;
    border-radius: 10px;
    border: 1px solid var(--mar-border);
    background: #fff;
    padding: 0 12px;
    cursor: pointer;
    font-weight: 650;
}

.mar-content {
    overflow-y: auto;
    padding: 36px 24px 140px;
}

.mar-welcome {
    width: min(760px, 100%);
    margin: 7vh auto 0;
    text-align: center;
}

.mar-hero-mark {
    width: 48px;
    height: 48px;
    border-radius: 14px;
    margin: 0 auto 18px;
    box-shadow: 0 8px 22px rgba(60,35,101,.18);
}

.mar-welcome h1 {
    margin: 0;
    font-size: clamp(25px, 4vw, 38px);
    line-height: 1.1;
    letter-spacing: -.035em;
}

.mar-welcome > p {
    width: min(610px, 100%);
    margin: 14px auto 0;
    color: var(--mar-muted);
    line-height: 1.6;
    font-size: 14px;
}

.mar-starter-grid {
    margin-top: 30px;
    display: grid;
    grid-template-columns: repeat(2, minmax(0,1fr));
    gap: 10px;
}

.mar-starter-card {
    min-height: 104px;
    border: 1px solid var(--mar-border);
    border-radius: var(--mar-radius);
    background: #fff;
    padding: 16px;
    text-align: left;
    cursor: pointer;
    transition: .18s ease;
}

.mar-starter-card:hover {
    transform: translateY(-1px);
    box-shadow: 0 10px 24px rgba(0,0,0,.05);
    border-color: #d4d4d8;
}

.mar-starter-card strong {
    display: block;
    font-size: 14px;
    margin-bottom: 6px;
}

.mar-starter-card span {
    font-size: 12px;
    color: var(--mar-muted);
    line-height: 1.45;
}

.mar-messages {
    width: min(820px,100%);
    margin: 0 auto;
    display: grid;
    gap: 20px;
}

.mar-message {
    display: flex;
    gap: 12px;
    align-items: flex-start;
}

.mar-message.is-user {
    justify-content: flex-end;
}

.mar-bubble {
    max-width: min(680px, 86%);
    border-radius: 18px;
    padding: 12px 14px;
    line-height: 1.55;
    font-size: 14px;
}

.mar-message.is-user .mar-bubble {
    background: var(--mar-surface-2);
}

.mar-message.is-agent .mar-bubble {
    background: #fff;
    border: 1px solid var(--mar-border);
}

.mar-composer-area {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    padding: 12px 24px 16px;
    background: linear-gradient(to top, #fff 72%, rgba(255,255,255,0));
}

.mar-composer {
    width: min(820px, 100%);
    margin: 0 auto;
    border: 1px solid var(--mar-border);
    border-radius: 22px;
    background: #fff;
    box-shadow: 0 12px 28px rgba(0,0,0,.07);
    padding: 10px 10px 8px 14px;
}

.mar-composer textarea {
    width: 100%;
    min-height: 30px;
    max-height: 150px;
    border: 0;
    resize: none;
    outline: 0;
    font: inherit;
    line-height: 1.45;
    padding: 3px 2px 8px;
    background: transparent;
}

.mar-attach,
.mar-send {
    width: 34px;
    height: 34px;
    border-radius: 999px;
    cursor: pointer;
    font-size: 18px;
}

.mar-attach {
    border: 1px solid var(--mar-border);
    background: #fff;
}

.mar-send {
    border: 0;
    background: #1f1f22;
    color: #fff;
}

.mar-composer-spacer {
    flex: 1;
}

.mar-composer-note {
    text-align: center;
    font-size: 10px;
    color: #99999f;
    margin-top: 7px;
}

.mar-panel {
    position: fixed;
    top: 0;
    right: 0;
    width: min(410px, 92vw);
    height: 100vh;
    background: #fff;
    border-left: 1px solid var(--mar-border);
    box-shadow: var(--mar-shadow);
    z-index: 60;
    transform: translateX(102%);
    transition: transform .22s ease;
}

.mar-panel.is-open {
    transform: translateX(0);
}

.mar-panel-header {
    justify-content: space-between;
    gap: 14px;
    min-height: 72px;
    padding: 14px 16px;
    border-bottom: 1px solid var(--mar-border);
}

.mar-panel-header > div {
    display: grid;
}

.mar-panel-header strong {
    font-size: 14px;
}

.mar-panel-header span {
    font-size: 11px;
    color: var(--mar-muted);
    margin-top: 2px;
}

.mar-panel-body {
    padding: 16px;
    display: grid;
    gap: 10px;
}

.mar-admin-card {
    align-items: flex-start;
    gap: 12px;
    padding: 14px;
    border: 1px solid var(--mar-border);
    border-radius: 14px;
}

.mar-admin-card > span {
    min-width: 34px;
    height: 34px;
    display: grid;
    place-items: center;
    border-radius: 10px;
    background: var(--mar-accent-soft);
    color: var(--mar-accent);
    font-size: 11px;
    font-weight: 900;
}

.mar-admin-card strong {
    font-size: 13px;
}

.mar-admin-card p {
    margin: 4px 0 0;
    color: var(--mar-muted);
    font-size: 12px;
    line-height: 1.45;
}

.mar-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(24,24,27,.34);
    opacity: 0;
    pointer-events: none;
    transition: .2s ease;
    z-index: 20;
}

.mar-backdrop.is-open {
    opacity: 1;
    pointer-events: auto;
}

@media (max-width: 860px) {
    .mar-app {
        display: block;
    }

    .mar-sidebar {
        position: fixed;
        inset: 0 auto 0 0;
        width: min(310px, 88vw);
        transform: translateX(-102%);
        transition: transform .22s ease;
        box-shadow: var(--mar-shadow);
    }

    .mar-sidebar.is-open {
        transform: translateX(0);
    }

    .mar-close-mobile,
    .mar-open-mobile {
        display: inline-grid;
        place-items: center;
    }

    .mar-main {
        min-height: 100vh;
    }

    .mar-topbar {
        padding: 0 14px;
    }

    .mar-content {
        padding: 26px 14px 140px;
    }

    .mar-composer-area {
        padding: 10px 12px 14px;
    }

    .mar-welcome {
        margin-top: 4vh;
    }
}

@media (max-width: 620px) {
    .mar-agent-subtitle,
    .mar-status-chip {
        display: none;
    }

    .mar-starter-grid {
        grid-template-columns: 1fr;
    }

    .mar-welcome h1 {
        font-size: 28px;
    }

    .mar-welcome > p {
        font-size: 13px;
    }

    .mar-starter-card {
        min-height: 86px;
    }

    .mar-secondary-button {
        font-size: 12px;
        padding: 0 9px;
    }
}

/* Bloco 2 */
.mar-view {
    display: none;
}

.mar-view.is-active {
    display: block;
}

.mar-history-empty {
    display: block;
    padding: 8px 10px;
    font-size: 11px;
    line-height: 1.4;
    color: var(--mar-muted);
}

.mar-section-head {
    width: min(920px, 100%);
    margin: 0 auto 22px;
}

.mar-section-head h2 {
    margin: 4px 0 6px;
    font-size: 28px;
    letter-spacing: -.025em;
}

.mar-section-head p {
    margin: 0;
    color: var(--mar-muted);
    font-size: 13px;
}

.mar-eyebrow {
    font-size: 11px;
    font-weight: 800;
    letter-spacing: .08em;
    text-transform: uppercase;
    color: var(--mar-accent);
}

.mar-agent-grid {
    width: min(920px, 100%);
    margin: 0 auto;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
}

.mar-agent-card {
    border: 1px solid var(--mar-border);
    background: #fff;
    border-radius: 16px;
    min-height: 112px;
    padding: 16px;
    display: flex;
    align-items: flex-start;
    gap: 12px;
    text-align: left;
    cursor: pointer;
    transition: .18s ease;
}

.mar-agent-card:hover,
.mar-agent-card.is-selected {
    border-color: #c8bed8;
    box-shadow: 0 10px 26px rgba(60,35,101,.08);
}

.mar-agent-card-mark {
    width: 42px;
    height: 42px;
    border-radius: 13px;
    background: var(--mar-accent-soft);
    color: var(--mar-accent);
    display: grid;
    place-items: center;
    font-weight: 900;
    flex: 0 0 auto;
}

.mar-agent-card-copy {
    min-width: 0;
    flex: 1;
}

.mar-agent-card-title {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.mar-agent-card-title strong {
    font-size: 14px;
}

.mar-agent-card p {
    margin: 7px 0 0;
    color: var(--mar-muted);
    font-size: 12px;
    line-height: 1.5;
}

.mar-agent-badge {
    border-radius: 999px;
    padding: 4px 7px;
    background: #f4effb;
    color: var(--mar-accent);
    font-size: 9px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: .04em;
}

.mar-agent-badge.is-general {
    background: #f1f1f2;
    color: #52525b;
}

.mar-loading-card,
.mar-empty-card,
.mar-error-card {
    grid-column: 1 / -1;
    border: 1px dashed var(--mar-border);
    border-radius: 14px;
    padding: 24px;
    color: var(--mar-muted);
    text-align: center;
    font-size: 13px;
}

.mar-error-card {
    color: #991b1b;
    background: #fef2f2;
    border-style: solid;
    border-color: #fecaca;
}

@media (max-width: 620px) {
    .mar-agent-grid {
        grid-template-columns: 1fr;
    }

    .mar-section-head h2 {
        font-size: 24px;
    }
}

/* Bloco 3: painel administrativo funcional */
.mar-panel.mar-panel-wide {
    width: min(620px, 96vw);
}

.mar-admin-tabs {
    display: flex;
    gap: 6px;
    padding: 10px 14px;
    border-bottom: 1px solid var(--mar-border);
    background: #fafafa;
    overflow-x: auto;
}

.mar-admin-tab {
    border: 0;
    background: transparent;
    border-radius: 10px;
    padding: 9px 12px;
    cursor: pointer;
    font-weight: 750;
    color: #5b5b64;
    white-space: nowrap;
}

.mar-admin-tab.is-active {
    color: var(--mar-accent);
    background: var(--mar-accent-soft);
}

.mar-admin-body {
    overflow-y: auto;
    max-height: calc(100vh - 126px);
}

.mar-admin-section {
    display: none;
}

.mar-admin-section.is-active {
    display: block;
}

.mar-admin-section-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 14px;
}

.mar-admin-section-head > div {
    display: grid;
}

.mar-admin-section-head strong {
    font-size: 14px;
}

.mar-admin-section-head span {
    margin-top: 3px;
    color: var(--mar-muted);
    font-size: 11px;
    line-height: 1.4;
}

.mar-small-button,
.mar-primary-button,
.mar-link-button {
    cursor: pointer;
    font: inherit;
}

.mar-small-button {
    border: 1px solid var(--mar-border);
    background: #fff;
    border-radius: 9px;
    min-height: 34px;
    padding: 0 10px;
    font-weight: 700;
}

.mar-primary-button {
    border: 0;
    border-radius: 10px;
    min-height: 40px;
    padding: 0 14px;
    background: var(--mar-accent);
    color: #fff;
    font-weight: 800;
}

.mar-admin-form-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0,1fr));
    gap: 10px;
}

.mar-field {
    display: grid;
    gap: 6px;
    margin-bottom: 10px;
}

.mar-field > span {
    font-size: 11px;
    font-weight: 800;
    color: #52525b;
}

.mar-field input,
.mar-field select,
.mar-field textarea {
    width: 100%;
    border: 1px solid var(--mar-border);
    border-radius: 10px;
    background: #fff;
    padding: 10px 11px;
    outline: 0;
    font: inherit;
    font-size: 13px;
    color: var(--mar-text);
}

.mar-field textarea {
    resize: vertical;
    line-height: 1.45;
}

.mar-field input:focus,
.mar-field select:focus,
.mar-field textarea:focus {
    border-color: #baaace;
    box-shadow: 0 0 0 3px rgba(60,35,101,.06);
}

.mar-field-full {
    grid-column: 1 / -1;
}

.mar-admin-actions {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    margin-top: 4px;
}

.mar-admin-feedback {
    font-size: 11px;
    color: #166534;
}

.mar-admin-feedback.is-error,
.mar-admin-empty.is-error {
    color: #991b1b;
}

.mar-check-row {
    display: flex;
    gap: 16px;
    flex-wrap: wrap;
    margin: 4px 0 12px;
    font-size: 12px;
}

.mar-check-row label {
    display: flex;
    align-items: center;
    gap: 6px;
}

.mar-admin-list {
    margin-top: 16px;
    display: grid;
    gap: 8px;
}

.mar-admin-list-item {
    border: 1px solid var(--mar-border);
    border-radius: 11px;
    padding: 10px 11px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.mar-admin-list-item > div {
    display: grid;
    min-width: 0;
}

.mar-admin-list-item strong {
    font-size: 12px;
}

.mar-admin-list-item span {
    margin-top: 2px;
    font-size: 10px;
    color: var(--mar-muted);
    overflow: hidden;
    text-overflow: ellipsis;
}

.mar-mini-badge {
    border-radius: 999px;
    padding: 5px 7px;
    background: var(--mar-accent-soft);
    color: var(--mar-accent) !important;
    font-weight: 800;
    flex: 0 0 auto;
}

.mar-link-button {
    border: 0;
    background: transparent;
    color: #9f1239;
    font-size: 11px;
    font-weight: 800;
}

.mar-admin-empty {
    padding: 12px;
    border-radius: 10px;
    background: #fafafa;
    color: var(--mar-muted);
    font-size: 11px;
    text-align: center;
}

@media (max-width: 620px) {
    .mar-admin-form-grid {
        grid-template-columns: 1fr;
    }

    .mar-field-full {
        grid-column: auto;
    }
}


/* Bloco 4: tema claro / escuro */
.mar-theme-toggle {
    min-height: 36px;
    border: 1px solid var(--mar-border);
    border-radius: 999px;
    background: var(--mar-bg);
    color: var(--mar-text);
    padding: 0 10px;
    display: inline-flex;
    align-items: center;
    gap: 7px;
    cursor: pointer;
    font: inherit;
    font-size: 11px;
    font-weight: 800;
}

.mar-theme-dot {
    width: 11px;
    height: 11px;
    border-radius: 999px;
    background: linear-gradient(135deg, #ffffff 50%, #202124 50%);
    border: 1px solid var(--mar-border);
}

.mar-app[data-theme="dark"] {
    --mar-bg: #212121;
    --mar-surface: #292929;
    --mar-surface-2: #303030;
    --mar-border: #424242;
    --mar-text: #f4f4f5;
    --mar-muted: #a9a9b2;
    --mar-accent: #b19ad8;
    --mar-accent-soft: #342b42;
    --mar-sidebar: #171717;
    --mar-shadow: 0 14px 40px rgba(0,0,0,.34);
    color-scheme: dark;
}

.mar-app[data-theme="dark"] .mar-sidebar,
.mar-app[data-theme="dark"] .mar-main,
.mar-app[data-theme="dark"] .mar-content {
    background: var(--mar-bg);
    color: var(--mar-text);
}

.mar-app[data-theme="dark"] .mar-sidebar {
    background: var(--mar-sidebar);
}

.mar-app[data-theme="dark"] .mar-topbar {
    background: rgba(33,33,33,.94);
    border-color: var(--mar-border);
}

.mar-app[data-theme="dark"] .mar-panel,
.mar-app[data-theme="dark"] .mar-composer,
.mar-app[data-theme="dark"] .mar-new-chat,
.mar-app[data-theme="dark"] .mar-search,
.mar-app[data-theme="dark"] .mar-starter-card,
.mar-app[data-theme="dark"] .mar-message.is-agent .mar-bubble,
.mar-app[data-theme="dark"] .mar-agent-card,
.mar-app[data-theme="dark"] .mar-secondary-button,
.mar-app[data-theme="dark"] .mar-small-button,
.mar-app[data-theme="dark"] .mar-field input,
.mar-app[data-theme="dark"] .mar-field select,
.mar-app[data-theme="dark"] .mar-field textarea,
.mar-app[data-theme="dark"] .mar-admin-list-item,
.mar-app[data-theme="dark"] .mar-theme-toggle {
    background: #262626;
    color: var(--mar-text);
    border-color: var(--mar-border);
}

.mar-app[data-theme="dark"] .mar-composer-area {
    background: linear-gradient(to top, #212121 72%, rgba(33,33,33,0));
}

.mar-app[data-theme="dark"] .mar-message.is-user .mar-bubble,
.mar-app[data-theme="dark"] .mar-nav-item:hover,
.mar-app[data-theme="dark"] .mar-nav-item.is-active,
.mar-app[data-theme="dark"] .mar-history-item:hover,
.mar-app[data-theme="dark"] .mar-icon-button:hover {
    background: #303030;
    color: var(--mar-text);
}

.mar-app[data-theme="dark"] .mar-nav-item,
.mar-app[data-theme="dark"] .mar-history-item,
.mar-app[data-theme="dark"] .mar-brand,
.mar-app[data-theme="dark"] .mar-field > span {
    color: #dedee3;
}

.mar-app[data-theme="dark"] .mar-profile,
.mar-app[data-theme="dark"] .mar-topbar,
.mar-app[data-theme="dark"] .mar-panel-header,
.mar-app[data-theme="dark"] .mar-admin-tabs {
    border-color: var(--mar-border);
}

.mar-app[data-theme="dark"] .mar-admin-tabs,
.mar-app[data-theme="dark"] .mar-admin-empty {
    background: #202020;
}

.mar-app[data-theme="dark"] .mar-admin-tab {
    color: #b8b8c0;
}

.mar-app[data-theme="dark"] .mar-admin-tab.is-active {
    color: #e6ddf5;
    background: #342b42;
}

.mar-app[data-theme="dark"] .mar-agent-badge.is-general {
    background: #343434;
    color: #d0d0d5;
}

.mar-app[data-theme="dark"] .mar-agent-card:hover,
.mar-app[data-theme="dark"] .mar-agent-card.is-selected {
    border-color: #75658d;
    box-shadow: 0 10px 26px rgba(0,0,0,.24);
}

.mar-app[data-theme="dark"] .mar-theme-dot {
    background: linear-gradient(135deg, #f4f4f5 50%, #202124 50%);
}

@media (max-width: 620px) {
    .mar-theme-toggle {
        padding: 0 9px;
    }

    .mar-theme-toggle #marThemeLabel {
        display: none;
    }
}


/* Bloco 5 */
.mar-send:disabled,
.mar-primary-button:disabled {
    opacity: .55;
    cursor: wait;
}

.mar-admin-note {
    border: 1px solid var(--mar-border);
    border-radius: 10px;
    background: var(--mar-surface);
    padding: 10px 11px;
    color: var(--mar-muted);
    font-size: 11px;
    line-height: 1.45;
    margin: 4px 0 10px;
}

.mar-app[data-theme="dark"] .mar-admin-note {
    background: #202020;
}


/* Bloco 6 */
.mar-hidden-file {
    display: none !important;
}

.mar-upload-box {
    margin-top: 12px;
    border: 1px dashed var(--mar-border);
    border-radius: 12px;
    padding: 12px;
    display: grid;
    gap: 9px;
    background: var(--mar-surface);
}

.mar-upload-box > div {
    display: grid;
    gap: 3px;
}

.mar-upload-box strong {
    font-size: 12px;
}

.mar-upload-box span {
    color: var(--mar-muted);
    font-size: 10px;
    line-height: 1.45;
}

.mar-upload-box input[type="file"] {
    width: 100%;
    font-size: 11px;
    color: var(--mar-muted);
}

.mar-app[data-theme="dark"] .mar-upload-box {
    background: #202020;
}


/* Mega Rê 1.0 - blocos 7 a 10 */
.mar-danger-button{min-height:40px;border:1px solid #fecaca;background:#fff;color:#991b1b;border-radius:10px;padding:0 12px;font-weight:750;cursor:pointer}.mar-account-grid{width:min(920px,100%);margin:0 auto;display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:12px}.mar-account-card{border:1px solid var(--mar-border);border-radius:16px;padding:18px;background:var(--mar-bg)}.mar-account-card h3{margin:6px 0 4px}.mar-account-card p{color:var(--mar-muted);font-size:12px}.mar-account-wide{grid-column:1/-1}.mar-usage-row{display:flex;justify-content:space-between;padding:8px 0;border-bottom:1px solid var(--mar-border);font-size:12px}.mar-plan-grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:10px;margin-top:12px}.mar-plan-card{border:1px solid var(--mar-border);border-radius:13px;padding:14px}.mar-plan-card h3{margin:0 0 4px}.mar-plan-card p{min-height:38px}.mar-plan-card b{display:block;margin:8px 0}.mar-plan-card button{border:0;background:var(--mar-accent);color:#fff;border-radius:9px;padding:9px 12px;cursor:pointer}.mar-message-feedback{display:flex;gap:7px;align-items:center;margin-top:5px;font-size:10px;color:var(--mar-muted)}.mar-message-feedback button{border:1px solid var(--mar-border);background:var(--mar-bg);color:var(--mar-text);border-radius:999px;padding:5px 8px;font-size:10px;cursor:pointer}.mar-agent-card-mark img{width:100%;height:100%;object-fit:cover;border-radius:inherit}.mar-metric-grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:9px}.mar-metric-card,.mar-diagnostic-card{border:1px solid var(--mar-border);border-radius:12px;padding:12px;background:var(--mar-bg);display:grid;gap:5px}.mar-metric-card span,.mar-diagnostic-card span{font-size:10px;color:var(--mar-muted);text-transform:uppercase;letter-spacing:.05em}.mar-metric-card strong{font-size:21px}.mar-diagnostic-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:8px;margin-top:14px}.mar-panel-wide{width:min(720px,98vw)!important}.mar-admin-tabs{scrollbar-width:thin}.mar-admin-tabs .mar-admin-tab{flex:0 0 auto}.mar-app[data-theme="dark"] .mar-account-card,.mar-app[data-theme="dark"] .mar-plan-card,.mar-app[data-theme="dark"] .mar-metric-card,.mar-app[data-theme="dark"] .mar-diagnostic-card,.mar-app[data-theme="dark"] .mar-message-feedback button{background:#262626;color:var(--mar-text);border-color:var(--mar-border)}
@media(max-width:700px){.mar-account-grid,.mar-metric-grid,.mar-diagnostic-grid{grid-template-columns:1fr}.mar-plan-grid{grid-template-columns:1fr}.mar-account-wide{grid-column:auto}.mar-status-chip{display:none}}


/* Mega Rê v1.1: conversas, login e inteligência */
.mar-history-filters{display:flex;gap:5px;margin:0 6px 7px}.mar-history-filters button{border:0;background:transparent;color:var(--mar-muted);font-size:10px;font-weight:750;padding:5px 7px;border-radius:7px;cursor:pointer}.mar-history-filters button.is-active{background:var(--mar-surface-2);color:var(--mar-text)}
.mar-history-row{position:relative;display:flex;align-items:center;min-width:0}.mar-history-row .mar-history-item{flex:1;min-width:0}.mar-history-more{width:30px;height:30px;border:0;border-radius:8px;background:transparent;color:var(--mar-muted);cursor:pointer;flex:0 0 auto}.mar-history-more:hover{background:var(--mar-surface-2);color:var(--mar-text)}.mar-history-menu{position:absolute;right:2px;top:32px;z-index:50;min-width:120px;padding:5px;background:var(--mar-bg);border:1px solid var(--mar-border);border-radius:10px;box-shadow:var(--mar-shadow)}.mar-history-menu[hidden]{display:none}.mar-history-menu button{display:block;width:100%;border:0;background:transparent;color:var(--mar-text);padding:8px 9px;border-radius:7px;text-align:left;font-size:11px;cursor:pointer}.mar-history-menu button:hover{background:var(--mar-surface-2)}.mar-history-menu button.is-danger{color:#b42318}
.mar-agent-template-row,.mar-intel-toolbar{display:flex;gap:9px;align-items:end;flex-wrap:wrap}.mar-agent-template-row .mar-field,.mar-intel-toolbar .mar-field{flex:1;min-width:190px;margin-bottom:0}.mar-agent-template-row{margin-bottom:10px}
.mar-theme-pills{display:flex;gap:6px;flex-wrap:wrap;margin-top:8px}.mar-theme-pill{display:inline-flex;gap:5px;align-items:center;border:1px solid var(--mar-border);border-radius:999px;padding:6px 8px;font-size:10px;background:var(--mar-bg)}.mar-theme-pill b{font-size:9px;color:var(--mar-muted)}
.mar-intel-list{display:grid;gap:10px;margin-top:12px}.mar-intel-card{border:1px solid var(--mar-border);border-radius:14px;padding:13px;background:var(--mar-bg)}.mar-intel-head{display:flex;justify-content:space-between;gap:10px;align-items:flex-start}.mar-intel-head>div{display:grid;gap:3px;min-width:0}.mar-intel-head strong{font-size:12px}.mar-intel-head span{font-size:10px;color:var(--mar-muted);overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.mar-intel-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:8px;margin-top:12px}.mar-intel-grid>div{padding:9px;border-radius:10px;background:var(--mar-surface)}.mar-intel-grid b{font-size:10px;text-transform:uppercase;letter-spacing:.04em}.mar-intel-grid p{margin:4px 0 0;font-size:11px;line-height:1.45;color:var(--mar-muted)}.mar-intel-wide{grid-column:1/-1}.mar-intel-pending{font-size:11px;color:var(--mar-muted);margin:12px 0}.mar-intel-card footer{display:flex;gap:12px;flex-wrap:wrap;border-top:1px solid var(--mar-border);padding-top:8px;margin-top:10px;color:var(--mar-muted);font-size:10px}
.mar-login-shell{min-height:70vh;display:grid;place-items:center;padding:28px 16px;background:var(--mar-surface)}.mar-login-card{width:min(430px,100%);background:var(--mar-bg);color:var(--mar-text);border:1px solid var(--mar-border);border-radius:22px;padding:26px;box-shadow:var(--mar-shadow)}.mar-login-brand{display:flex;align-items:center;gap:9px;margin-bottom:28px}.mar-login-card h2{margin:0 0 7px;font-size:27px;letter-spacing:-.03em}.mar-login-card>p{color:var(--mar-muted);font-size:13px;line-height:1.5}.mar-google-login-wrap{display:flex;justify-content:center;min-height:42px;margin:20px 0 12px}.mar-login-divider{display:flex;align-items:center;gap:10px;color:var(--mar-muted);font-size:11px;margin:10px 0}.mar-login-divider:before,.mar-login-divider:after{content:"";height:1px;background:var(--mar-border);flex:1}.mar-login-form{display:grid;gap:11px}.mar-login-form label{display:grid;gap:5px}.mar-login-form label span{font-size:11px;font-weight:750}.mar-login-form input{min-height:44px;border:1px solid var(--mar-border);border-radius:10px;background:var(--mar-bg);color:var(--mar-text);padding:0 11px;font-size:16px}.mar-login-form button,.mar-login-primary-link{min-height:44px;border:0;border-radius:10px;background:var(--mar-accent);color:#fff;padding:0 14px;font-weight:800;cursor:pointer;display:grid;place-items:center;text-decoration:none}.mar-login-form button:disabled{opacity:.6;cursor:wait}.mar-login-feedback{min-height:18px;margin-top:9px;font-size:11px;color:#166534}.mar-login-feedback.is-error{color:#b42318}.mar-login-note{border:1px solid var(--mar-border);border-radius:10px;padding:10px;font-size:11px;color:var(--mar-muted);text-align:center}.mar-login-legal{font-size:10px!important;margin-top:17px!important}.mar-login-legal a{color:var(--mar-accent)}
.mar-app[data-theme="dark"] .mar-history-menu,.mar-app[data-theme="dark"] .mar-intel-card{background:#262626}.mar-app[data-theme="dark"] .mar-intel-grid>div{background:#202020}
@media(max-width:620px){.mar-intel-grid{grid-template-columns:1fr}.mar-intel-wide{grid-column:auto}.mar-login-card{padding:20px}.mar-login-card h2{font-size:24px}}


/* =========================================================
   Mega Rê v1.2 — Login premium + onboarding privado
   ========================================================= */
.mar-login-shell{
    min-height:100vh;
    width:100vw;
    margin-left:calc(50% - 50vw);
    display:grid;
    place-items:center;
    padding:46px 22px;
    box-sizing:border-box;
    background:#000;
    color:#111827;
    overflow:hidden;
}
.mar-login-card{
    width:min(540px,100%);
    min-height:390px;
    box-sizing:border-box;
    background:#fff;
    color:#111827;
    border:1px solid rgba(255,255,255,.82);
    border-radius:28px;
    padding:42px 42px 36px;
    box-shadow:
        0 40px 100px rgba(0,0,0,.72),
        0 24px 70px rgba(60,35,101,.38),
        0 2px 0 rgba(255,255,255,.7) inset,
        0 -8px 24px rgba(60,35,101,.045) inset;
    position:relative;
}
.mar-login-card:after{
    content:"";
    position:absolute;
    left:9%;
    right:9%;
    bottom:-25px;
    height:35px;
    border-radius:50%;
    background:rgba(60,35,101,.24);
    filter:blur(22px);
    z-index:-1;
}
.mar-login-brand{
    display:flex;
    align-items:center;
    gap:11px;
    margin-bottom:34px;
}
.mar-login-brand .mar-brand-mark{
    width:42px;
    height:42px;
    border-radius:12px;
    display:grid;
    place-items:center;
    background:#3C2365;
    color:#fff;
    font-size:18px;
    font-weight:900;
    box-shadow:0 10px 24px rgba(60,35,101,.22);
}
.mar-login-brand strong{font-size:19px;color:#111827}
.mar-login-card h2{
    margin:0 0 9px;
    font-size:31px;
    line-height:1.12;
    letter-spacing:-.035em;
    color:#3C2365;
}
.mar-login-card>p,
.mar-login-opening p{
    color:#667085;
    font-size:14px;
    line-height:1.55;
}
.mar-google-login-wrap{
    display:flex;
    justify-content:center;
    align-items:center;
    min-height:48px;
    margin:28px 0 16px;
    padding:5px;
    border-radius:999px;
    box-shadow:0 8px 28px rgba(60,35,101,.12);
}
.mar-login-feedback{
    min-height:20px;
    margin-top:12px;
    text-align:center;
    font-size:12px;
    color:#3C2365;
    font-weight:700;
}
.mar-login-feedback.is-error{color:#b42318}
.mar-login-note{
    border:1px solid #e5e7eb;
    background:#fafafa;
    border-radius:13px;
    padding:12px;
    font-size:12px;
    color:#667085;
    text-align:center;
}
.mar-login-legal{
    font-size:10.5px!important;
    margin-top:36px!important;
    color:#667085!important;
}
.mar-login-legal a{color:#3C2365;font-weight:700}
.mar-login-opening{
    display:grid;
    justify-items:start;
    align-content:center;
    min-height:230px;
}
.mar-login-opening h2{color:#3C2365}
.mar-login-opening-dot{
    width:16px;
    height:16px;
    border-radius:50%;
    background:#3C2365;
    box-shadow:0 0 0 8px rgba(60,35,101,.10);
    margin-bottom:24px;
    animation:marLoginPulse 1.15s ease-in-out infinite alternate;
}
@keyframes marLoginPulse{from{transform:scale(.9);opacity:.65}to{transform:scale(1.08);opacity:1}}

.mar-onboarding{
    position:absolute;
    inset:0;
    z-index:120;
    display:grid;
    place-items:center;
    padding:24px;
}
.mar-onboarding.is-hidden{display:none}
.mar-onboarding-backdrop{
    position:absolute;
    inset:0;
    background:rgba(0,0,0,.82);
    backdrop-filter:blur(8px);
}
.mar-onboarding-card{
    position:relative;
    z-index:1;
    width:min(520px,100%);
    background:#fff;
    color:#111827;
    border-radius:26px;
    padding:34px;
    border:1px solid rgba(255,255,255,.8);
    box-shadow:0 38px 100px rgba(0,0,0,.60),0 20px 60px rgba(60,35,101,.32);
}
.mar-onboarding-brand{
    display:flex;
    align-items:center;
    gap:10px;
    margin-bottom:26px;
}
.mar-onboarding-brand strong{font-size:17px}
.mar-onboarding-kicker{
    display:inline-block;
    color:#3C2365;
    background:rgba(60,35,101,.08);
    border-radius:999px;
    padding:6px 9px;
    font-size:10px;
    font-weight:850;
    letter-spacing:.03em;
    text-transform:uppercase;
}
.mar-onboarding-card h2{
    margin:14px 0 10px;
    color:#3C2365;
    font-size:29px;
    line-height:1.16;
    letter-spacing:-.03em;
}
.mar-onboarding-card>p{
    margin:0 0 24px;
    color:#5f6775;
    font-size:14px;
    line-height:1.6;
}
.mar-onboarding-field{
    display:grid;
    gap:7px;
}
.mar-onboarding-field span{
    font-size:11px;
    font-weight:850;
    color:#344054;
}
.mar-onboarding-field input,
.mar-private-profile-form input{
    width:100%;
    box-sizing:border-box;
    min-height:48px;
    padding:0 13px;
    border:1px solid #d7dce3;
    border-radius:12px;
    background:#fff;
    color:#111827;
    font-size:16px;
    outline:none;
}
.mar-onboarding-field input:focus,
.mar-private-profile-form input:focus{
    border-color:#3C2365;
    box-shadow:0 0 0 3px rgba(60,35,101,.10);
}
.mar-onboarding-save{
    width:100%;
    min-height:50px;
    border:0;
    border-radius:12px;
    margin-top:13px;
    background:#3C2365;
    color:#fff;
    font-size:14px;
    font-weight:850;
    cursor:pointer;
    box-shadow:0 12px 28px rgba(60,35,101,.22);
}
.mar-onboarding-save:disabled{opacity:.6;cursor:wait}
.mar-onboarding-feedback{
    min-height:18px;
    margin-top:9px;
    color:#b42318;
    font-size:11px;
}
.mar-onboarding-card small{
    display:block;
    margin-top:12px;
    color:#7a8493;
    font-size:10px;
    line-height:1.45;
}
.mar-private-profile-card{
    border:1px solid var(--mar-border);
    border-radius:16px;
    background:var(--mar-bg);
    padding:16px;
    margin-bottom:14px;
    display:grid;
    gap:12px;
}
.mar-private-profile-card>div:first-child{
    display:grid;
    gap:4px;
}
.mar-private-profile-card strong{font-size:13px}
.mar-private-profile-card span{font-size:10px;color:var(--mar-muted);line-height:1.45}
.mar-private-profile-form{
    display:grid;
    grid-template-columns:minmax(0,1fr) auto;
    gap:8px;
    align-items:center;
}
.mar-account-feedback{
    min-height:15px;
    font-size:10px;
    color:#166534;
}
.mar-app[data-theme="dark"] .mar-private-profile-card{
    background:#202020;
}
.mar-app[data-theme="dark"] .mar-private-profile-form input{
    background:#171717;
    color:#fff;
    border-color:#3b3b3b;
}

@media(max-width:620px){
    .mar-login-shell{
        padding:30px 16px;
        align-items:center;
    }
    .mar-login-card{
        width:100%;
        min-height:430px;
        padding:34px 24px 32px;
        border-radius:24px;
    }
    .mar-login-card h2{font-size:27px}
    .mar-login-brand{margin-bottom:38px}
    .mar-google-login-wrap{margin-top:32px}
    .mar-login-legal{margin-top:44px!important}
    .mar-onboarding{
        padding:16px;
    }
    .mar-onboarding-card{
        padding:28px 22px;
        border-radius:22px;
    }
    .mar-onboarding-card h2{font-size:25px}
    .mar-private-profile-form{grid-template-columns:1fr}
}

@media(min-width:900px){
    .mar-login-card{
        width:min(590px,100%);
        min-height:420px;
        padding:48px 50px 40px;
    }
}


/* Mega Rê v1.2.1 — correção do login: sem redirecionamento em loop */
.mar-login-connected{
    display:grid;
    align-content:center;
    min-height:230px;
}
.mar-login-connected-badge{
    display:inline-flex;
    width:max-content;
    align-items:center;
    min-height:28px;
    padding:0 10px;
    border-radius:999px;
    background:rgba(60,35,101,.08);
    color:#3C2365;
    font-size:10px;
    font-weight:850;
    letter-spacing:.04em;
    text-transform:uppercase;
    margin-bottom:16px;
}
.mar-login-connected h2{
    color:#3C2365;
    margin-bottom:8px;
}
.mar-login-connected p{
    color:#667085;
    font-size:14px;
    margin:0 0 24px;
}
.mar-login-enter-button{
    display:flex;
    align-items:center;
    justify-content:center;
    width:100%;
    min-height:52px;
    box-sizing:border-box;
    border-radius:13px;
    background:#3C2365;
    color:#fff!important;
    text-decoration:none!important;
    font-size:15px;
    font-weight:850;
    box-shadow:0 14px 30px rgba(60,35,101,.22);
}
.mar-login-enter-button:hover{
    filter:brightness(1.06);
}


/* =========================================================
   Mega Rê v1.2.2 — refinamento visual do login
   ========================================================= */

/* Moldura lilás externa, preservando o botão oficial branco do Google. */
.mar-google-login-wrap{
    width:100%;
    max-width:380px;
    box-sizing:border-box;
    margin-left:auto;
    margin-right:auto;
    padding:9px 10px;
    border-radius:999px;
    background:rgba(60,35,101,.16);
    box-shadow:
        0 12px 30px rgba(60,35,101,.18),
        0 2px 0 rgba(255,255,255,.55) inset;
    display:flex;
    align-items:center;
    justify-content:center;
    overflow:hidden;
}

/* O Google cria um elemento interno. Centralizamos o bloco sem alterar a marca oficial. */
.mar-google-login-wrap > div{
    margin-left:auto!important;
    margin-right:auto!important;
    flex:0 0 auto;
}

/* Texto legal ligeiramente maior para leitura melhor. */
.mar-login-legal{
    font-size:11.5px!important;
    line-height:1.55!important;
}

/* Mobile: mantém a altura atual, mas cria mais respiro nas laterais. */
@media(max-width:620px){
    .mar-login-shell{
        padding-top:30px;
        padding-bottom:30px;
        padding-left:26px;
        padding-right:26px;
    }

    .mar-login-card{
        width:100%;
        min-height:430px; /* mantém a altura aprovada */
        padding-top:34px;
        padding-bottom:32px;
        padding-left:24px;
        padding-right:24px;
    }

    .mar-google-login-wrap{
        width:100%;
        max-width:100%;
        margin-top:32px;
        padding:8px 9px;
    }

    .mar-login-legal{
        font-size:11px!important;
    }
}


/* =========================================================
   Mega Rê v1.2.3 — acabamento do botão Google
   ========================================================= */

.mar-google-login-wrap{
    background:#3C2365;
    padding:7px;
    box-shadow:
        0 16px 34px rgba(60,35,101,.28),
        0 2px 0 rgba(255,255,255,.20) inset;
}

/* Cria um miolo branco arredondado para reforçar o efeito 3D. */
.mar-google-login-wrap > div{
    width:100%!important;
    max-width:100%;
    box-sizing:border-box;
    display:flex!important;
    align-items:center;
    justify-content:center;
    background:#fff;
    border-radius:999px!important;
    overflow:hidden!important;
    padding:3px;
}

/* Garante arredondamento nos elementos que o Google injeta. */
.mar-google-login-wrap > div > div,
.mar-google-login-wrap iframe{
    border-radius:999px!important;
    overflow:hidden!important;
}

.mar-google-login-wrap iframe{
    display:block;
    margin:0 auto;
}

@media(max-width:620px){
    .mar-google-login-wrap{
        padding:6px;
    }

    .mar-google-login-wrap > div{
        padding:2px;
    }
}


/* =========================================================
   Mega Rê v1.2.4 — seletor de conta móvel + composição central
   ========================================================= */

/* Centraliza a assinatura da marca e dá mais presença visual. */
.mar-login-brand{
    justify-content:center;
    text-align:center;
    margin-left:auto;
    margin-right:auto;
    margin-bottom:38px;
}
.mar-login-brand .mar-brand-mark{
    width:48px;
    height:48px;
    border-radius:14px;
    font-size:20px;
}
.mar-login-brand strong{
    font-size:22px;
    letter-spacing:-.015em;
}

/* O texto explicativo passa para baixo do botão, como solicitado. */
.mar-login-google-copy{
    margin:15px 0 0!important;
    color:#667085!important;
    font-size:14px!important;
    line-height:1.5!important;
    text-align:center;
}

/* Mantém o conjunto oficial do Google centralizado. */
.mar-google-login-wrap{
    margin-top:18px;
}
.mar-google-login-wrap > div{
    justify-content:center!important;
}
.mar-google-login-wrap iframe{
    margin-left:auto!important;
    margin-right:auto!important;
}

@media(max-width:620px){
    .mar-login-brand{
        margin-bottom:36px;
    }
    .mar-login-brand .mar-brand-mark{
        width:46px;
        height:46px;
    }
    .mar-login-brand strong{
        font-size:21px;
    }
    .mar-google-login-wrap{
        margin-top:12px;
    }
    .mar-login-google-copy{
        margin-top:14px!important;
        font-size:13.5px!important;
    }
}


/* =========================================================
   Mega Rê v1.2.5 — login minimalista escuro
   ========================================================= */

/* Fundo inspirado no canvas escuro do ChatGPT, sem card branco. */
.mar-login-shell{
    background:#212121;
    min-height:100vh;
    padding:42px 24px;
    align-items:center;
    color:#fff;
}

/* Remove completamente a aparência de "popup branco". */
.mar-login-card{
    width:min(560px,100%);
    min-height:0;
    padding:28px 18px 24px;
    background:transparent;
    border:0;
    border-radius:0;
    box-shadow:none;
    color:#fff;
}
.mar-login-card:after{
    display:none!important;
}

/* Marca centralizada, maior e invertida para o fundo escuro. */
.mar-login-brand{
    justify-content:center;
    text-align:center;
    gap:13px;
    margin:0 auto 34px;
}
.mar-login-brand .mar-brand-mark{
    width:56px;
    height:56px;
    border-radius:16px;
    background:#fff;
    color:#3C2365;
    font-size:22px;
    font-weight:900;
    box-shadow:0 12px 30px rgba(0,0,0,.25);
}
.mar-login-brand strong{
    color:#fff;
    font-size:27px;
    font-weight:800;
    letter-spacing:-.02em;
}

/* Google: moldura branca, base roxa e botão oficial preservado. */
.mar-google-login-wrap{
    width:min(430px,100%);
    max-width:430px;
    margin:0 auto;
    padding:6px;
    border:2px solid #fff;
    border-radius:999px;
    background:#3C2365;
    box-shadow:
        0 18px 42px rgba(0,0,0,.34),
        0 8px 26px rgba(60,35,101,.26);
    display:flex;
    align-items:center;
    justify-content:center;
    overflow:hidden;
}

/* Mantém o componente oficial centralizado dentro da base. */
.mar-google-login-wrap > div{
    width:100%!important;
    max-width:100%;
    margin:0 auto!important;
    padding:0!important;
    background:transparent!important;
    border-radius:999px!important;
    display:flex!important;
    align-items:center;
    justify-content:center!important;
    overflow:hidden!important;
}
.mar-google-login-wrap > div > div,
.mar-google-login-wrap iframe{
    border-radius:999px!important;
    overflow:hidden!important;
}
.mar-google-login-wrap iframe{
    display:block;
    margin:0 auto!important;
}

/* Texto auxiliar abaixo do botão. */
.mar-login-google-copy{
    margin:18px auto 0!important;
    color:#e7e7e7!important;
    font-size:14px!important;
    line-height:1.5!important;
    text-align:center;
}

/* Feedback visível no fundo escuro. */
.mar-login-feedback{
    color:#e7dcf6;
}
.mar-login-feedback.is-error{
    color:#ff9b92;
}

/* Termos no rodapé, fora de qualquer card. */
.mar-login-legal{
    max-width:460px;
    margin:54px auto 0!important;
    color:#d7d7d7!important;
    font-size:11.5px!important;
    line-height:1.6!important;
    text-align:center;
}
.mar-login-legal a{
    color:#fff!important;
    text-decoration:underline;
    text-underline-offset:2px;
}

/* Estado de usuário já conectado também sem card branco. */
.mar-login-connected{
    justify-items:center;
    text-align:center;
    color:#fff;
}
.mar-login-connected-badge{
    background:#fff;
    color:#3C2365;
}
.mar-login-connected h2{
    color:#fff;
}
.mar-login-connected p{
    color:#d7d7d7;
}
.mar-login-enter-button{
    max-width:430px;
    border:2px solid #fff;
    background:#3C2365;
    color:#fff!important;
    border-radius:999px;
}

/* Evita qualquer sobra de estilos claros antigos. */
.mar-login-note{
    color:#e7e7e7;
    background:rgba(255,255,255,.06);
    border-color:rgba(255,255,255,.18);
}

@media(max-width:620px){
    .mar-login-shell{
        padding:38px 24px;
    }

    .mar-login-card{
        width:100%;
        min-height:0;
        padding:22px 0 20px;
    }

    .mar-login-brand{
        margin-bottom:31px;
    }

    .mar-login-brand .mar-brand-mark{
        width:54px;
        height:54px;
        border-radius:15px;
        font-size:21px;
    }

    .mar-login-brand strong{
        font-size:25px;
    }

    .mar-google-login-wrap{
        width:min(390px,100%);
        padding:5px;
    }

    .mar-login-google-copy{
        margin-top:17px!important;
        font-size:13.5px!important;
    }

    .mar-login-legal{
        margin-top:52px!important;
        padding:0 5px;
        font-size:11px!important;
    }
}

@media(min-width:900px){
    .mar-login-card{
        width:min(620px,100%);
        min-height:0;
        padding:34px 24px 28px;
    }

    .mar-login-brand .mar-brand-mark{
        width:60px;
        height:60px;
        font-size:23px;
    }

    .mar-login-brand strong{
        font-size:29px;
    }

    .mar-google-login-wrap{
        width:440px;
        max-width:440px;
    }
}


/* =========================================================
   Mega Rê v1.2.6 — seletor explícito de conta Google
   ========================================================= */
.mar-google-chooser-button{
    width:min(430px,100%);
    min-height:58px;
    box-sizing:border-box;
    margin:0 auto;
    padding:6px 18px;
    border:2px solid #fff;
    border-radius:999px;
    background:#3C2365;
    color:#fff!important;
    text-decoration:none!important;
    display:grid;
    grid-template-columns:38px 1fr 38px;
    align-items:center;
    gap:8px;
    font-size:16px;
    font-weight:700;
    box-shadow:0 18px 42px rgba(0,0,0,.34),0 8px 26px rgba(60,35,101,.26);
}
.mar-google-chooser-button:hover{filter:brightness(1.05)}
.mar-google-chooser-button:focus-visible{outline:3px solid rgba(255,255,255,.8);outline-offset:4px}
.mar-google-chooser-button > span:last-child{grid-column:2;text-align:center;white-space:nowrap}
.mar-google-g{
    grid-column:1;
    width:32px;height:32px;border-radius:50%;
    display:grid;place-items:center;
    background:#fff;
    color:#4285F4;
    font-size:20px;
    font-weight:900;
    font-family:Arial,sans-serif;
}
@media(max-width:620px){
    .mar-google-chooser-button{
        width:min(390px,100%);
        min-height:56px;
        grid-template-columns:34px 1fr 34px;
        padding:5px 14px;
        font-size:15.5px;
    }
    .mar-google-g{width:30px;height:30px;font-size:19px}
}


/* =========================================================
   Mega Rê v1.2.7 — roxo integral + seletor de conta prioritário
   ========================================================= */
.mar-login-shell{
    min-height:100vh;
    background:#3C2365;
    color:#fff;
    padding:28px 22px;
    align-items:stretch;
}

.mar-login-card{
    width:min(620px,100%);
    min-height:calc(100vh - 56px);
    margin:0 auto;
    padding:0 18px 8px;
    background:transparent;
    border:0;
    border-radius:0;
    box-shadow:none;
    display:flex;
    flex-direction:column;
    color:#fff;
}
.mar-login-card:after{display:none!important}

.mar-login-main{
    flex:1 1 auto;
    display:flex;
    flex-direction:column;
    justify-content:center;
    align-items:center;
    width:100%;
    min-width:0;
    padding:28px 0 20px;
    box-sizing:border-box;
}

.mar-login-brand{
    justify-content:center;
    text-align:center;
    gap:13px;
    margin:0 auto 38px;
}
.mar-login-brand .mar-brand-mark{
    width:58px;
    height:58px;
    border-radius:16px;
    background:#fff;
    color:#3C2365;
    font-size:22px;
    box-shadow:0 14px 32px rgba(0,0,0,.20);
}
.mar-login-brand strong{
    color:#fff;
    font-size:28px;
    font-weight:850;
    letter-spacing:-.025em;
}

/* Botão próprio: inicia OAuth com prompt=select_account. */
.mar-google-chooser-button{
    width:min(440px,100%);
    min-height:62px;
    box-sizing:border-box;
    margin:0 auto;
    padding:8px 19px;
    border:0;
    border-radius:999px;
    background:#fff;
    color:#2f2f33!important;
    text-decoration:none!important;
    display:grid;
    grid-template-columns:38px minmax(0,1fr) 22px;
    align-items:center;
    gap:8px;
    font-size:16.5px;
    font-weight:700;
    box-shadow:
        0 18px 36px rgba(17,10,31,.30),
        0 5px 14px rgba(17,10,31,.20),
        0 1px 0 rgba(255,255,255,.85) inset;
    transition:transform .16s ease,box-shadow .16s ease;
}
.mar-google-chooser-button:hover{
    filter:none;
    transform:translateY(-1px);
    box-shadow:0 21px 42px rgba(17,10,31,.34),0 6px 16px rgba(17,10,31,.20);
}
.mar-google-chooser-button:active{transform:translateY(1px)}
.mar-google-chooser-button:focus-visible{outline:3px solid rgba(255,255,255,.72);outline-offset:4px}

.mar-google-g{
    grid-column:1;
    width:31px;
    height:31px;
    border-radius:50%;
    display:grid;
    place-items:center;
    background:#fff;
}
.mar-google-g svg{width:23px;height:23px;display:block}
.mar-google-chooser-label{
    grid-column:2;
    min-width:0;
    text-align:center;
    white-space:nowrap;
    transform:translateX(-5px);
}
.mar-google-chooser-balance{grid-column:3;width:22px;height:1px}

.mar-login-google-copy{
    margin:19px auto 0!important;
    color:rgba(255,255,255,.90)!important;
    font-size:14px!important;
    line-height:1.5!important;
    text-align:center;
}
.mar-login-feedback{
    color:#fff;
    margin-top:12px;
}
.mar-login-feedback.is-error{color:#ffd6d1}

/* Rodapé real da tela. */
.mar-login-legal{
    flex:0 0 auto;
    width:min(500px,100%);
    margin:0 auto!important;
    padding:18px 8px 8px;
    box-sizing:border-box;
    color:rgba(255,255,255,.88)!important;
    font-size:12.5px!important;
    line-height:1.62!important;
    text-align:center;
}
.mar-login-legal a{
    color:#fff!important;
    font-weight:750;
    text-decoration:underline;
    text-underline-offset:2px;
}

.mar-login-note{
    color:#fff;
    background:rgba(255,255,255,.10);
    border:1px solid rgba(255,255,255,.25);
}

.mar-login-connected{
    justify-items:center;
    text-align:center;
    color:#fff;
}
.mar-login-connected-badge{background:#fff;color:#3C2365}
.mar-login-connected h2{color:#fff}
.mar-login-connected p{color:rgba(255,255,255,.85)}
.mar-login-enter-button{
    max-width:440px;
    border:0;
    background:#fff;
    color:#3C2365!important;
    border-radius:999px;
    box-shadow:0 18px 36px rgba(17,10,31,.28);
}

/* Se a configuração OAuth ainda não estiver completa, o fallback continua legível. */
.mar-google-login-wrap{
    width:min(440px,100%);
    max-width:440px;
    background:transparent;
    border:0;
    padding:0;
    box-shadow:none;
}

@media(max-width:620px){
    .mar-login-shell{
        padding:18px 22px 14px;
    }
    .mar-login-card{
        width:100%;
        min-height:calc(100vh - 32px);
        padding:0 2px 4px;
    }
    .mar-login-main{
        padding:34px 0 18px;
    }
    .mar-login-brand{
        margin-bottom:34px;
    }
    .mar-login-brand .mar-brand-mark{
        width:55px;
        height:55px;
        border-radius:15px;
        font-size:21px;
    }
    .mar-login-brand strong{font-size:26px}

    .mar-google-chooser-button{
        width:min(390px,100%);
        min-height:60px;
        padding:7px 15px;
        grid-template-columns:34px minmax(0,1fr) 16px;
        gap:7px;
        font-size:16px;
    }
    .mar-google-g{width:30px;height:30px}
    .mar-google-g svg{width:22px;height:22px}
    .mar-google-chooser-label{
        transform:translateX(-8px);
    }
    .mar-google-chooser-balance{width:16px}

    .mar-login-google-copy{
        margin-top:18px!important;
        font-size:14px!important;
    }
    .mar-login-legal{
        padding:20px 8px 5px;
        font-size:13px!important;
        line-height:1.62!important;
    }
}

@media(min-width:900px){
    .mar-login-shell{padding:32px 24px}
    .mar-login-card{min-height:calc(100vh - 64px)}
    .mar-login-main{padding-top:36px}
    .mar-login-brand .mar-brand-mark{width:62px;height:62px;font-size:23px}
    .mar-login-brand strong{font-size:30px}
    .mar-google-chooser-button{width:450px;max-width:450px}
}


/* =========================================================
   Mega Rê v1.2.8 — volta ao fundo preto + ajustes mobile
   ========================================================= */
.mar-login-shell{
    background:#000;
    min-height:100svh;
}
.mar-login-card{
    min-height:calc(100svh - 56px);
}
.mar-login-main{
    padding:20px 0 10px;
}
.mar-login-brand{
    margin:0 auto 28px;
}

/* Botão volta a ter aro roxo em volta do branco. */
.mar-google-chooser-button{
    background:#fff;
    border:6px solid #3C2365;
    box-shadow:
        0 20px 34px rgba(0,0,0,.36),
        0 6px 18px rgba(60,35,101,.24),
        0 1px 0 rgba(255,255,255,.9) inset;
}
.mar-google-chooser-label{
    transform:translateX(-8px);
}

/* Texto auxiliar mais agrupado com o botão. */
.mar-login-google-copy{
    margin:12px auto 0!important;
}

/* Rodapé mais visível e estável. */
.mar-login-legal{
    margin-top:auto!important;
    padding:12px 8px 8px;
    color:rgba(255,255,255,.92)!important;
}

/* Estado conectada segue coerente com o preto. */
.mar-login-enter-button{
    border:6px solid #3C2365;
    box-shadow:0 20px 34px rgba(0,0,0,.34),0 6px 18px rgba(60,35,101,.22);
}

@media(max-width:620px){
    .mar-login-shell{
        padding:10px 18px 6px;
        min-height:100svh;
    }
    .mar-login-card{
        min-height:calc(100svh - 16px);
        padding:0 2px 0;
    }
    .mar-login-main{
        justify-content:flex-start;
        padding:16px 0 6px;
    }
    .mar-login-brand{
        margin-bottom:24px;
    }
    .mar-google-chooser-button{
        min-height:58px;
        padding:6px 14px;
        border-width:5px;
    }
    .mar-google-chooser-label{
        transform:translateX(-14px);
    }
    .mar-login-google-copy{
        margin-top:10px!important;
    }
    .mar-login-legal{
        padding:10px 10px 4px;
        font-size:13.5px!important;
        line-height:1.58!important;
    }
}

/* =========================================================
   Mega Rê v1.3.0 — Eu e Meu Negócio, Meus Materiais e painel profissional
   ========================================================= */
.mar-nav-subitem{padding-left:34px!important;font-size:12px!important;opacity:.92}
.mar-nav-lock{margin-left:auto;font-size:11px;opacity:.8}
.mar-feature-lock{
    border:1px solid var(--mar-border);border-radius:16px;padding:18px 20px;margin:0 0 18px;
    background:color-mix(in srgb,var(--mar-accent) 7%,var(--mar-bg));
}
.mar-feature-lock strong{display:block;font-size:14px;margin-bottom:5px}.mar-feature-lock p{margin:0;color:var(--mar-muted);font-size:12px;line-height:1.5}
.is-feature-disabled{opacity:.55;filter:saturate(.65)}
.mar-personal-context-layout{display:grid;grid-template-columns:minmax(0,1fr) 300px;gap:20px;align-items:start;max-width:1050px}
.mar-context-form{display:grid;gap:14px}.mar-context-block{border:1px solid var(--mar-border);background:var(--mar-surface);border-radius:18px;padding:18px;display:grid;gap:12px}.mar-context-block h3{margin:0;font-size:15px}.mar-context-consent{display:flex;gap:9px;align-items:flex-start;font-size:11px;line-height:1.5;color:var(--mar-muted);padding:4px}.mar-context-consent input{margin-top:2px}
.mar-context-summary{position:sticky;top:16px;border:1px solid var(--mar-border);background:var(--mar-surface);border-radius:18px;padding:18px;box-shadow:0 12px 28px rgba(0,0,0,.06)}.mar-context-summary h3{margin:4px 0 14px;font-size:16px}.mar-context-summary-row{display:grid;gap:3px;padding:10px 0;border-top:1px solid var(--mar-border)}.mar-context-summary-row:first-child{border-top:0}.mar-context-summary-row span{font-size:10px;color:var(--mar-muted)}.mar-context-summary-row strong{font-size:12px;line-height:1.45}
.mar-user-material-upload{max-width:760px}.mar-material-grid{display:grid;gap:10px;max-width:860px;margin-top:16px}.mar-material-card{display:flex;justify-content:space-between;gap:14px;align-items:center;border:1px solid var(--mar-border);background:var(--mar-surface);border-radius:15px;padding:14px 16px}.mar-material-card>div{display:grid;gap:3px;min-width:0}.mar-material-card strong{font-size:13px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.mar-material-card span,.mar-material-card small{font-size:10px;color:var(--mar-muted);line-height:1.4}.mar-small-button.is-danger{color:#b42318}
.mar-voice-input{border:0;background:transparent;border-radius:10px;width:34px;height:34px;display:grid;place-items:center;cursor:pointer;font-size:15px}.mar-voice-input:hover{background:var(--mar-hover)}.mar-voice-input.is-listening{background:rgba(180,35,24,.12);color:#b42318}
.mar-owner-agent-card{border:1px solid var(--mar-border);background:var(--mar-surface);border-radius:18px;padding:18px;margin-bottom:14px}.mar-owner-head{display:flex;justify-content:space-between;gap:12px;align-items:flex-start}.mar-owner-head>div{display:grid;gap:4px}.mar-owner-head strong{font-size:15px}.mar-owner-head span{font-size:11px;color:var(--mar-muted)}.mar-owner-access-form{display:grid;grid-template-columns:minmax(0,1fr) auto;gap:8px;margin:16px 0}.mar-owner-access-form input{border:1px solid var(--mar-border);background:var(--mar-bg);color:var(--mar-text);border-radius:12px;padding:0 12px;min-height:42px}.mar-owner-access-list{display:grid;gap:8px}
.mar-audience-grid{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:10px;margin-top:12px}.mar-audience-card,.mar-audience-total{border:1px solid var(--mar-border);border-radius:14px;padding:12px;background:var(--mar-bg);display:grid;gap:7px}.mar-audience-card>strong,.mar-audience-total span{font-size:11px}.mar-audience-card span{display:flex;justify-content:space-between;gap:8px;font-size:10px;color:var(--mar-muted)}.mar-audience-total strong{font-size:26px}.mar-audience-card small{font-size:10px;color:var(--mar-muted)}
.mar-app[data-theme="dark"] .mar-context-block,.mar-app[data-theme="dark"] .mar-context-summary,.mar-app[data-theme="dark"] .mar-material-card,.mar-app[data-theme="dark"] .mar-owner-agent-card{background:#202020}

@media(max-width:820px){
    .mar-personal-context-layout{grid-template-columns:1fr}.mar-context-summary{position:static;order:-1}.mar-audience-grid{grid-template-columns:1fr 1fr}
}
@media(max-width:620px){
    .mar-nav-subitem{padding-left:28px!important}.mar-context-block{padding:15px;border-radius:15px}.mar-context-summary{padding:15px}.mar-material-card{align-items:flex-start}.mar-owner-access-form{grid-template-columns:1fr}.mar-audience-grid{grid-template-columns:1fr}.mar-context-consent{font-size:11.5px}
}
.mar-hero-mark img{width:100%;height:100%;object-fit:cover;border-radius:inherit;display:block}

/* =========================================================
   Mega Rê v1.4.0 — experiência de conversa familiar + mobile
   ========================================================= */

/* Identidade visual */
.mar-brand-mark-image,
.mar-hero-mark-image{
    background:transparent!important;
    overflow:hidden;
}
.mar-brand-mark-image img,
.mar-hero-mark-image img,
.mar-login-brand .mar-brand-mark img{
    width:100%;
    height:100%;
    object-fit:contain;
    display:block;
}
.mar-brand-mark-image{
    width:34px;
    height:38px;
    border-radius:0;
}
.mar-hero-mark-image{
    width:64px;
    height:76px;
    border-radius:0;
    box-shadow:none;
}
.mar-login-brand .mar-brand-mark.mar-brand-mark-image{
    background:#fff!important;
    padding:5px;
}

/* Abertura curta no celular, inspirada no comportamento de apps de chat. */
.mar-mobile-splash{
    display:none;
}
@media(max-width:860px){
    .mar-mobile-splash{
        position:fixed;
        inset:0;
        z-index:9999;
        background:#000;
        color:#fff;
        align-items:center;
        justify-content:center;
        flex-direction:column;
        gap:12px;
        opacity:0;
        visibility:hidden;
        transition:opacity .25s ease,visibility .25s ease;
    }
    .mar-mobile-splash.is-visible{
        display:flex;
        opacity:1;
        visibility:visible;
    }
    .mar-splash-logo{
        width:94px;
        height:112px;
        display:grid;
        place-items:center;
    }
    .mar-splash-logo img{width:100%;height:100%;object-fit:contain;display:block}
    .mar-splash-name{font-size:20px;font-weight:800;letter-spacing:-.02em}
}

/* Sem título/frase central: a conversa fica mais limpa. */
.mar-welcome-minimal{
    margin-top:2vh;
}
.mar-welcome-minimal > h1,
.mar-welcome-minimal > p{
    display:none!important;
}
.mar-welcome-minimal .mar-hero-mark{
    margin-bottom:22px;
}

/* Cor roxa oficial também no modo escuro, sem rosado/lilás. */
.mar-app[data-theme="dark"]{
    --mar-accent:#3C2365;
    --mar-accent-soft:#2b203d;
}
.mar-app[data-theme="dark"] .mar-nav-item.is-active .mar-nav-dot,
.mar-app[data-theme="dark"] .mar-theme-dot{
    background:#3C2365;
}
.mar-theme-dot{
    background:#3C2365!important;
    border-color:rgba(60,35,101,.5)!important;
}

/* O texto Claro/Escuro permanece visível também no celular. */
@media(max-width:620px){
    .mar-theme-toggle #marThemeLabel{
        display:inline!important;
    }
    .mar-theme-toggle{
        padding:0 10px!important;
        gap:6px;
        min-width:78px;
        justify-content:center;
    }
}

/* Altura real da viewport. Evita o campo de conversa ficar escondido pelo teclado. */
html.mar-app-page,
body.mar-app-page{
    overflow:hidden!important;
    overscroll-behavior:none;
}
.mar-app{
    height:var(--mar-app-height,100dvh);
    min-height:var(--mar-app-height,100dvh);
}
.mar-main{
    height:100%;
    min-height:0!important;
    grid-template-rows:auto minmax(0,1fr) auto;
}
.mar-content{
    min-height:0;
    padding-bottom:20px;
    overscroll-behavior:contain;
}

/* Campo de conversa no estilo de mensageiro: fundo separado, arredondado e familiar. */
.mar-composer-area{
    position:relative!important;
    left:auto!important;
    right:auto!important;
    bottom:auto!important;
    flex:0 0 auto;
    padding:10px 18px max(10px,env(safe-area-inset-bottom));
    background:var(--mar-bg);
    border-top:1px solid var(--mar-border);
    z-index:18;
}
.mar-composer{
    width:min(900px,100%);
    margin:0 auto;
    padding:0;
    border:0;
    border-radius:26px;
    background:var(--mar-surface-2);
    box-shadow:0 7px 22px rgba(0,0,0,.10);
    overflow:hidden;
}
.mar-composer-input-row{
    display:flex;
    align-items:flex-end;
    gap:4px;
    min-height:54px;
    padding:7px 7px 7px 9px;
}
.mar-composer textarea{
    flex:1 1 auto;
    min-width:0;
    min-height:40px;
    max-height:132px;
    padding:10px 7px 8px;
    color:var(--mar-text);
    font-size:15px;
    line-height:1.4;
}
.mar-composer textarea::placeholder{
    color:var(--mar-muted);
    opacity:.92;
}
.mar-composer-icon,
.mar-round-action{
    flex:0 0 auto;
    width:38px;
    height:38px;
    border:0;
    border-radius:999px;
    display:grid;
    place-items:center;
    cursor:pointer;
    transition:transform .15s ease,background .15s ease,opacity .15s ease;
}
.mar-composer-icon{
    background:transparent;
    color:var(--mar-muted);
}
.mar-composer-icon:hover{background:color-mix(in srgb,var(--mar-accent) 10%,transparent);color:var(--mar-accent)}
.mar-composer-icon svg,
.mar-round-action svg,
.mar-record-delete svg,
.mar-record-finish svg{
    width:21px;
    height:21px;
    fill:none;
    stroke:currentColor;
    stroke-width:1.9;
    stroke-linecap:round;
    stroke-linejoin:round;
}
.mar-round-action{
    background:#fff;
    color:#111;
    box-shadow:0 2px 7px rgba(0,0,0,.13);
}
.mar-round-action:hover{transform:translateY(-1px)}
.mar-round-action:disabled,.mar-composer-icon:disabled{opacity:.42;cursor:not-allowed;transform:none}
.mar-send[hidden],.mar-voice-input[hidden]{display:none!important}
.mar-send{background:#fff;color:#111}
.mar-voice-input{font-size:0}

.mar-composer-note{
    margin-top:6px;
    text-align:center;
    font-size:10.5px;
    line-height:1.35;
    color:var(--mar-muted);
}

/* Gravação: cronômetro, gráfico, pausar, excluir e finalizar a transcrição. */
.mar-voice-recorder{
    min-height:62px;
    padding:7px 8px;
    display:grid;
    grid-template-columns:38px 45px minmax(90px,1fr) minmax(105px,160px) 42px;
    align-items:center;
    gap:8px;
}
.mar-voice-recorder[hidden]{display:none!important}
.mar-record-delete,
.mar-record-finish{
    width:38px;
    height:38px;
    border:0;
    border-radius:999px;
    display:grid;
    place-items:center;
    cursor:pointer;
}
.mar-record-delete{background:rgba(180,35,24,.15);color:#d92d20}
.mar-record-finish{background:#fff;color:#111;box-shadow:0 2px 7px rgba(0,0,0,.13)}
.mar-record-time{font-size:13px;font-variant-numeric:tabular-nums;color:var(--mar-text);text-align:center}
.mar-waveform{
    height:34px;
    min-width:0;
    display:flex;
    align-items:center;
    justify-content:center;
    gap:2px;
    overflow:hidden;
}
.mar-waveform span{
    width:2px;
    min-height:3px;
    height:6px;
    border-radius:999px;
    background:var(--mar-muted);
    transition:height .06s linear,opacity .12s ease;
    opacity:.82;
}
.mar-record-pause{
    min-height:38px;
    border:0;
    border-radius:999px;
    padding:0 14px;
    background:color-mix(in srgb,var(--mar-text) 11%,transparent);
    color:var(--mar-text);
    display:inline-flex;
    align-items:center;
    justify-content:center;
    gap:7px;
    cursor:pointer;
    font-size:12px;
    font-weight:700;
}
.mar-record-pause.is-paused{background:color-mix(in srgb,var(--mar-accent) 18%,transparent);color:var(--mar-accent)}

/* Modo escuro: preto no fundo e caixa de conversa cinza-escuro, como solicitado. */
.mar-app[data-theme="dark"] .mar-composer-area{
    background:#000;
    border-color:#242424;
}
.mar-app[data-theme="dark"] .mar-composer{
    background:#202426;
    border:1px solid #2f3437;
    box-shadow:0 8px 24px rgba(0,0,0,.32);
}
.mar-app[data-theme="dark"] .mar-composer textarea{color:#f5f5f5}
.mar-app[data-theme="dark"] .mar-composer-icon{color:#aeb5ba}
.mar-app[data-theme="dark"] .mar-round-action,
.mar-app[data-theme="dark"] .mar-record-finish{background:#fff;color:#111}
.mar-app[data-theme="dark"] .mar-record-pause{background:#303538;color:#f3f4f4}
.mar-app[data-theme="dark"] .mar-composer-note{color:#a4a8ab}

@media(max-width:860px){
    .mar-app{
        display:block;
        height:var(--mar-app-height,100dvh)!important;
        min-height:var(--mar-app-height,100dvh)!important;
    }
    .mar-main{
        height:100%;
        min-height:0!important;
    }
    .mar-content{
        padding:18px 12px 12px;
        min-height:0;
    }
    .mar-composer-area{
        padding:7px 8px max(7px,env(safe-area-inset-bottom));
    }
    .mar-composer{
        width:100%;
        border-radius:24px;
    }
    .mar-composer-input-row{
        min-height:52px;
        padding:6px 6px 6px 7px;
        gap:2px;
    }
    .mar-composer textarea{
        font-size:16px; /* evita zoom automático no iPhone */
        min-height:38px;
        padding:9px 5px 7px;
    }
    .mar-composer-icon,.mar-round-action{width:36px;height:36px}
    .mar-composer-icon svg,.mar-round-action svg{width:20px;height:20px}
    .mar-composer-note{font-size:10.5px;margin-top:5px;padding:0 4px}
    .mar-voice-recorder{
        min-height:56px;
        grid-template-columns:36px 39px minmax(65px,1fr) 94px 38px;
        gap:5px;
        padding:6px;
    }
    .mar-record-delete,.mar-record-finish{width:36px;height:36px}
    .mar-record-pause{padding:0 9px;font-size:11px;gap:5px}
    .mar-waveform{gap:1.5px}
    .mar-waveform span{width:2px}
    .mar-welcome-minimal{margin-top:0}
    .mar-welcome-minimal .mar-hero-mark{display:none}
}

@media(max-width:430px){
    .mar-composer-icon,.mar-round-action{width:34px;height:34px}
    .mar-composer-input-row{gap:1px}
    .mar-voice-recorder{grid-template-columns:34px 36px minmax(52px,1fr) 82px 36px;gap:4px}
    .mar-record-pause{padding:0 7px}
    .mar-record-pause #marVoicePauseLabel{font-size:10px}
}

/* Navegação usa o roxo oficial como acento visual. */
.mar-nav-item.is-active{
    color:#3C2365;
}
.mar-nav-item.is-active .mar-nav-dot{
    background:#3C2365!important;
}
.mar-app[data-theme="dark"] .mar-nav-item.is-active{
    color:#fff;
    box-shadow:inset 3px 0 0 #3C2365;
}


/* =========================================================
   Mega Rê v1.5.0 — acabamento do chat + áudio real
   ========================================================= */

/* Tema escuro: fundo principal 100% preto. */
.mar-app[data-theme="dark"]{
    --mar-bg:#000000;
    --mar-surface:#101010;
    --mar-surface-2:#202426;
    --mar-border:#242424;
    --mar-sidebar:#0a0a0a;
    --mar-accent:#3C2365;
    --mar-accent-soft:rgba(60,35,101,.24);
}
.mar-app[data-theme="dark"] .mar-main,
.mar-app[data-theme="dark"] .mar-content,
.mar-app[data-theme="dark"] .mar-view,
.mar-app[data-theme="dark"] #marChatView{
    background:#000!important;
}
.mar-app[data-theme="dark"] .mar-topbar{
    background:#000!important;
    border-color:#202020!important;
}
.mar-app[data-theme="dark"] .mar-sidebar{background:#0a0a0a!important}
.mar-app[data-theme="dark"] .mar-message.is-agent .mar-bubble{background:#121212!important;border-color:#242424!important}
.mar-app[data-theme="dark"] .mar-message.is-user .mar-bubble{background:#202426!important}

/* Remove qualquer rosado/lilás antigo e usa o roxo oficial. */
.mar-nav-item.is-active,
.mar-nav-item:hover,
.mar-history-item:hover,
.mar-theme-toggle:hover,
.mar-agent-card.is-selected,
.mar-agent-card:hover{
    border-color:#3C2365;
}
.mar-app[data-theme="dark"] .mar-nav-item.is-active,
.mar-app[data-theme="dark"] .mar-nav-item:hover{
    background:rgba(60,35,101,.26)!important;
    color:#fff!important;
    box-shadow:inset 3px 0 0 #3C2365;
}
.mar-app[data-theme="dark"] .mar-admin-tab.is-active{
    color:#fff!important;
    background:#3C2365!important;
}
.mar-agent-badge{background:rgba(60,35,101,.12);color:#3C2365}
.mar-app[data-theme="dark"] .mar-agent-badge{background:rgba(60,35,101,.32);color:#fff}
.mar-theme-dot{background:#3C2365!important}

/* Campo de conversa: apenas a caixa é um preto/cinza mais claro. */
.mar-app[data-theme="dark"] .mar-composer-area{background:#000!important}
.mar-app[data-theme="dark"] .mar-composer{
    background:#202426!important;
    border:1px solid #303538!important;
    box-shadow:0 7px 24px rgba(0,0,0,.38)!important;
}
.mar-app[data-theme="dark"] .mar-composer textarea{background:transparent!important;color:#f5f5f5!important}
.mar-composer,.mar-composer-input-row,.mar-composer textarea{box-sizing:border-box}
.mar-voice-input{align-items:center!important;justify-items:center!important;padding:0!important}
.mar-voice-input svg{display:block;margin:auto;transform:translateY(-.4px)}

/* Prévia da gravação, sem caixa branca. */
.mar-audio-preview{
    display:flex;
    align-items:center;
    gap:9px;
    padding:7px 10px 9px;
    border-top:1px solid var(--mar-border);
    color:var(--mar-muted);
    font-size:11px;
}
.mar-audio-preview[hidden]{display:none!important}
.mar-audio-preview-play{
    width:31px;height:31px;flex:0 0 31px;border:0;border-radius:999px;
    display:grid;place-items:center;background:#3C2365;color:#fff;cursor:pointer;font-weight:800;
}
.mar-audio-preview span{flex:1;min-width:0}
.mar-audio-preview-clear{border:0;background:transparent;color:var(--mar-muted);font-size:11px;font-weight:700;cursor:pointer;padding:6px}
.mar-app[data-theme="dark"] .mar-audio-preview{border-color:#303538;color:#c5c7ca}
.mar-app[data-theme="dark"] .mar-audio-preview-clear{color:#b7b9bc}

/* O gráfico fica reto sem fala; o JavaScript só cria picos com áudio real. */
.mar-waveform span{height:4px;min-height:4px;transition:height .045s linear,opacity .08s linear}

/* Login de quem já está autenticado: somente logo por 2 s, sem mensagem intermediária. */
.mar-login-shell.is-authenticated{
    min-height:100svh!important;
    background:#000!important;
    color:#fff!important;
}
.mar-login-shell.is-authenticated .mar-login-card{
    min-height:100svh!important;
    width:100%!important;
    max-width:none!important;
    padding:0!important;
    border:0!important;
    border-radius:0!important;
    background:#000!important;
    box-shadow:none!important;
    display:grid!important;
    place-items:center!important;
}
.mar-login-shell.is-authenticated .mar-login-main{padding:0!important;min-height:100svh;display:grid!important;place-items:center!important}
.mar-login-shell.is-authenticated .mar-login-brand{margin:0!important;display:flex!important;flex-direction:column;gap:10px}
.mar-login-shell.is-authenticated .mar-login-brand .mar-brand-mark{width:92px!important;height:108px!important;background:transparent!important;padding:0!important}
.mar-login-shell.is-authenticated .mar-login-brand strong{font-size:20px!important;color:#fff!important}
.mar-login-auto-enter:empty{display:none}

@media(max-width:620px){
    .mar-composer-area{padding-left:7px!important;padding-right:7px!important}
    .mar-composer-input-row{gap:2px!important}
    .mar-composer-icon,.mar-round-action{width:36px!important;height:36px!important;min-width:36px!important}
    .mar-voice-input svg{width:19px!important;height:19px!important}
    .mar-composer-note{font-size:10.5px!important}
    .mar-theme-toggle #marThemeLabel{display:inline!important}
    .mar-audio-preview{padding-left:8px;padding-right:8px}
}


/* Correção específica do foco móvel: sem retângulo branco do navegador/tema. */
.mar-composer textarea,
.mar-composer textarea:focus,
.mar-composer textarea:focus-visible{
    border:0!important;
    outline:0!important;
    box-shadow:none!important;
    background:transparent!important;
    -webkit-appearance:none!important;
    appearance:none!important;
}
.mar-open-mobile,
.mar-close-mobile{
    color:#3C2365!important;
}


/* =========================================================
   Mega Rê v1.5.1 — interação móvel, splash e layout desktop
   ========================================================= */

/* O núcleo Mega Rê usa sempre o roxo oficial. */
.mar-app{
    --mar-accent:#3C2365;
}
.mar-new-chat,
.mar-new-chat span,
.mar-open-mobile,
.mar-close-mobile,
.mar-nav-item.is-active,
.mar-history-filters .is-active{
    color:#3C2365!important;
}
.mar-nav-item.is-active .mar-nav-dot,
.mar-theme-dot{
    background:#3C2365!important;
}

/* Logo pequeno ao lado do nome apenas na experiência móvel. */
.mar-topbar-logo{
    display:none;
    width:28px;
    height:34px;
    flex:0 0 28px;
    overflow:hidden;
}
.mar-topbar-logo img{
    width:100%;
    height:100%;
    object-fit:contain;
    display:block;
}

/* Splash: somente o símbolo, exatamente no centro da tela. */
@media(max-width:860px){
    .mar-mobile-splash,
    .mar-mobile-splash.is-visible{
        position:fixed!important;
        inset:0!important;
        width:100vw!important;
        height:100dvh!important;
        z-index:999999!important;
        background:#000!important;
        display:grid!important;
        place-items:center!important;
        padding:0!important;
        margin:0!important;
    }
    .mar-mobile-splash{
        opacity:0;
        visibility:hidden;
        pointer-events:none;
        transition:opacity .12s ease,visibility .12s ease;
    }
    .mar-mobile-splash.is-visible{
        opacity:1!important;
        visibility:visible!important;
        pointer-events:auto;
    }
    .mar-mobile-splash.is-done{display:none!important}
    .mar-splash-logo{
        position:absolute!important;
        left:50%!important;
        top:50%!important;
        transform:translate(-50%,-50%)!important;
        width:116px!important;
        height:138px!important;
        margin:0!important;
        padding:0!important;
        display:grid!important;
        place-items:center!important;
    }
    .mar-splash-logo img{
        width:100%!important;
        height:100%!important;
        object-fit:contain!important;
        display:block!important;
        margin:0!important;
    }
    .mar-splash-name{display:none!important}
    .mar-topbar-logo{display:block}
    .mar-topbar-left{gap:8px!important}
}

/* O campo fica realmente interativo desde a abertura, mesmo antes da resposta da IA. */
.mar-composer textarea:not(:disabled){
    cursor:text!important;
    opacity:1!important;
}
.mar-composer-icon:not(:disabled),
.mar-round-action:not(:disabled){
    opacity:1!important;
    pointer-events:auto!important;
}

/* Desktop: mantém o perfil/ADM dentro da altura visível, inclusive com barra do WordPress. */
.mar-app{
    height:100dvh;
    min-height:0;
}
.admin-bar .mar-app{
    height:calc(100dvh - 32px);
}
.mar-sidebar{
    height:100%;
    min-height:0;
    overflow:hidden;
}
.mar-history{
    min-height:0;
    overflow-y:auto;
}
.mar-sidebar-spacer{
    min-height:12px;
}
.mar-profile{
    flex:0 0 auto;
    padding-bottom:8px;
    margin-bottom:0;
}
@media(max-width:782px){
    .admin-bar .mar-app{height:calc(100dvh - 46px)}
}

/* Fundo escuro verdadeiramente preto e caixa de conversa destacada apenas pelo cinza. */
.mar-app[data-theme="dark"],
.mar-app[data-theme="dark"] .mar-main,
.mar-app[data-theme="dark"] .mar-content,
.mar-app[data-theme="dark"] .mar-view,
.mar-app[data-theme="dark"] #marChatView,
.mar-app[data-theme="dark"] .mar-composer-area{
    background:#000!important;
}
.mar-app[data-theme="dark"] .mar-composer{
    background:#202426!important;
}

/* No celular, elimina qualquer símbolo central depois da abertura. */
@media(max-width:860px){
    .mar-welcome-minimal .mar-hero-mark{display:none!important}
    .mar-welcome-minimal{min-height:0!important;margin:0!important;padding:0!important}
    .mar-main{height:100%!important;min-height:0!important}
    .mar-content{min-height:0!important}
    .mar-composer-area{position:relative;z-index:15}
}


/* =========================================================
   Mega Rê v1.5.2 — rotas separadas para Login e Aplicativo
   ========================================================= */
.mar-login-shell{
    position:fixed!important;
    inset:0!important;
    width:100vw!important;
    height:100svh!important;
    min-height:100svh!important;
    z-index:2147483000!important;
    box-sizing:border-box!important;
}
.mar-route-guard{
    position:fixed;
    inset:0;
    z-index:2147482999;
    display:grid;
    place-items:center;
    background:#000;
    color:#fff;
    font:600 14px/1.4 system-ui,-apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif;
}


/* =========================================================
   Mega Rê v1.6.6 — restauração visual estável
   Base visual restaurada da v1.5.2 + isolamento do tema/Elementor
   ========================================================= */

/* Mantém a paleta aprovada e impede que estilos globais do tema vazem para o app. */
.mar-app{
    --mar-accent:#3C2365!important;
    font-family:Inter,ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif!important;
}
.mar-app button,
.mar-app input,
.mar-app textarea,
.mar-app select,
.mar-app a{
    font-family:inherit!important;
    box-shadow:none;
}
.mar-app button:focus,
.mar-app button:focus-visible,
.mar-app input:focus,
.mar-app input:focus-visible,
.mar-app textarea:focus,
.mar-app textarea:focus-visible,
.mar-app select:focus,
.mar-app select:focus-visible{
    outline:none!important;
}

/* Navegação volta ao visual compacto aprovado. */
.mar-app .mar-nav-item{
    border:0!important;
    box-shadow:none!important;
}
.mar-app .mar-nav-item.is-active,
.mar-app .mar-nav-item:hover{
    box-shadow:none!important;
}
.mar-app .mar-new-chat{
    box-shadow:none!important;
}
.mar-app .mar-open-mobile,
.mar-app .mar-close-mobile,
.mar-app .mar-icon-button{
    border:0!important;
    box-shadow:none!important;
}
.mar-app .mar-theme-toggle{
    box-shadow:none!important;
}
.mar-app .mar-composer-icon{
    border:0!important;
    box-shadow:none!important;
}
.mar-app .mar-round-action{
    box-shadow:none!important;
}

/* Eu e Meu Negócio continua como pasta e Meus Materiais como subpasta. */
.mar-nav-group{display:grid;gap:2px}
.mar-nav-parent{width:100%}
.mar-nav-label{min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.mar-nav-chevron{margin-left:auto;font-size:18px;line-height:1;transition:transform .18s ease;opacity:.72}
.mar-nav-group.is-open .mar-nav-chevron{transform:rotate(90deg)}
.mar-nav-submenu[hidden]{display:none!important}
.mar-nav-submenu{display:grid;position:relative;margin:0 0 2px 18px;padding-left:11px;border-left:1px solid rgba(60,35,101,.28)}
.mar-nav-subitem{padding-left:9px!important;font-size:13.5px!important;min-height:36px!important}
.mar-subtree-line{display:none}

/* Aumenta leitura sem transformar o menu em blocos gigantes. */
.mar-sidebar{padding:14px!important}
.mar-brand-text{font-size:15px!important}
.mar-nav-item{font-size:15px!important;min-height:40px!important}
.mar-search input{font-size:13.5px!important}
.mar-profile-copy strong{font-size:13.5px!important}
.mar-profile-copy span{font-size:11.5px!important}
.mar-section-head h2{font-size:28px!important}
.mar-section-head p{font-size:14px!important;line-height:1.55}
.mar-context-block h3{font-size:16px!important}
.mar-field>span{font-size:12.5px!important}
.mar-field input,.mar-field select,.mar-field textarea{font-size:14.5px!important}
.mar-admin-tabs .mar-admin-tab{font-size:13px!important}
.mar-admin-section-head strong{font-size:16px!important}
.mar-admin-section-head span{font-size:12px!important;line-height:1.5}
.mar-admin-list-item strong{font-size:13.5px!important}
.mar-admin-list-item span{font-size:11.5px!important}

/* No desktop, a marca principal fica na lateral para evitar repetição. */
@media(min-width:861px){
    .mar-topbar-left>.mar-topbar-logo,
    .mar-topbar-left>div{display:none!important}
    .mar-topbar{min-height:54px!important}
}

/* App ocupa a viewport no frontend, sem substituir o template do Elementor. */
.mar-app.mar-fullscreen-app{
    position:fixed!important;
    inset:0!important;
    width:100vw!important;
    height:100dvh!important;
    min-height:100dvh!important;
    max-width:none!important;
    margin:0!important;
    z-index:2147482000!important;
    box-sizing:border-box!important;
}
body:has(.mar-app.mar-fullscreen-app),
html:has(.mar-app.mar-fullscreen-app){
    margin:0!important;
    padding:0!important;
    overflow:hidden!important;
}

/* Limpa o chrome do tema somente nas páginas Mega Rê, mantendo the_content() para o Elementor. */
html:has(body.mar-mega-app-page),
html:has(body.mar-mega-login-page),
body.mar-mega-app-page,
body.mar-mega-login-page{
    margin:0!important;
    padding:0!important;
    width:100%!important;
    min-height:100%!important;
}
body.mar-mega-app-page .site-header,
body.mar-mega-app-page .site-footer,
body.mar-mega-login-page .site-header,
body.mar-mega-login-page .site-footer,
body.mar-mega-app-page header#masthead,
body.mar-mega-app-page footer#colophon,
body.mar-mega-login-page header#masthead,
body.mar-mega-login-page footer#colophon{
    display:none!important;
}
body.mar-mega-app-page main,
body.mar-mega-login-page main,
body.mar-mega-app-page .site-main,
body.mar-mega-login-page .site-main,
body.mar-mega-app-page .entry-content,
body.mar-mega-login-page .entry-content{
    margin:0!important;
    padding:0!important;
    max-width:none!important;
    width:100%!important;
}

/* Login permanece com o símbolo sozinho e botão oficial Google centralizado. */
.mar-login-main{
    justify-content:center!important;
    transform:translateY(1vh);
}
.mar-login-brand{
    margin:0 auto 24px!important;
    gap:0!important;
}
.mar-login-brand .mar-brand-mark.mar-brand-mark-image{
    width:66px!important;
    height:78px!important;
    background:transparent!important;
    border:0!important;
    border-radius:0!important;
    padding:0!important;
    box-shadow:none!important;
    overflow:visible!important;
}
.mar-login-brand .mar-brand-mark img{
    width:100%!important;
    height:100%!important;
    object-fit:contain!important;
    border:0!important;
    border-radius:0!important;
}
.mar-login-brand strong{display:none!important}
.mar-google-login-wrap{
    width:min(560px,calc(100vw - 44px))!important;
    max-width:560px!important;
    min-height:62px!important;
    margin:0 auto!important;
    padding:6px!important;
    border:0!important;
    border-radius:999px!important;
    background:#3C2365!important;
    box-shadow:0 14px 34px rgba(0,0,0,.30)!important;
    display:flex!important;
    align-items:center!important;
    justify-content:center!important;
    box-sizing:border-box!important;
    overflow:hidden!important;
}
.mar-google-login-wrap>div{
    width:100%!important;
    max-width:100%!important;
    margin:0 auto!important;
    padding:0!important;
    background:#fff!important;
    border-radius:999px!important;
    display:flex!important;
    align-items:center!important;
    justify-content:center!important;
    overflow:hidden!important;
}
.mar-google-login-wrap iframe{display:block!important;margin:0 auto!important;border-radius:999px!important}
.mar-login-google-copy{margin-top:12px!important}

@media(max-width:860px){
    .mar-nav-item{font-size:15.5px!important}
    .mar-nav-subitem{font-size:13.5px!important}
    .mar-field input,.mar-field select,.mar-field textarea{font-size:16px!important}
}
@media(max-width:620px){
    .mar-login-main{transform:translateY(1vh);padding-left:18px!important;padding-right:18px!important}
    .mar-login-brand{margin-bottom:22px!important}
    .mar-login-brand .mar-brand-mark.mar-brand-mark-image{width:62px!important;height:73px!important}
    .mar-google-login-wrap{width:min(360px,calc(100vw - 36px))!important;min-height:58px!important;padding:5px!important}
    .mar-login-google-copy{margin-top:11px!important;font-size:14px!important}
}


/* =========================================================
   Mega Rê v1.6.8 — editor isolado + microfone no modo claro
   ========================================================= */
.mar-app[data-theme="light"] .mar-voice-input{
    background:#3C2365!important;
    color:#FFFFFF!important;
    border:0!important;
    border-radius:999px!important;
    box-shadow:0 4px 12px rgba(60,35,101,.22)!important;
}
.mar-app[data-theme="light"] .mar-voice-input:hover{
    background:#3C2365!important;
    color:#FFFFFF!important;
    filter:brightness(1.06);
}
.mar-app[data-theme="light"] .mar-voice-input svg{
    color:#FFFFFF!important;
    stroke:#FFFFFF!important;
}


/* =========================================================
   Mega Rê v1.6.9 — pré-visualização real dentro do Elementor
   ========================================================= */
.mar-app.mar-elementor-edit{
    position:relative!important;
    inset:auto!important;
    width:100%!important;
    height:calc(100vh - 8px)!important;
    min-height:720px!important;
    max-width:none!important;
    margin:0!important;
    z-index:1!important;
    overflow:hidden!important;
}
.mar-app.mar-elementor-edit .mar-panel{
    z-index:90!important;
}
.mar-app.mar-elementor-edit .mar-backdrop{
    position:absolute!important;
    z-index:80!important;
}
.mar-login-editor-preview{
    position:relative!important;
    width:100%!important;
    min-height:calc(100vh - 8px)!important;
    height:calc(100vh - 8px)!important;
    margin:0!important;
    overflow:hidden!important;
}
/* Dentro do editor o login é visual; evita autenticar/redirecionar dentro do iframe. */
.mar-login-editor-preview .mar-google-login-wrap{
    pointer-events:none!important;
}


/* =========================================================
   Mega Rê v1.7.0 — editor Elementor igual ao preview aprovado
   ========================================================= */
/* No editor, o aplicativo permanece dentro do canvas do Elementor. */
.mar-app.mar-elementor-edit{
    position:relative!important;
    inset:auto!important;
    width:100%!important;
    height:calc(100vh - 8px)!important;
    min-height:760px!important;
    max-width:none!important;
    margin:0!important;
    z-index:1!important;
    overflow:hidden!important;
}

/* Administração visível dentro do canvas, sem cobrir o painel esquerdo do Elementor. */
.mar-app.mar-elementor-edit .mar-panel.mar-elementor-admin-panel{
    position:absolute!important;
    top:54px!important;
    right:0!important;
    bottom:0!important;
    left:280px!important;
    width:auto!important;
    height:auto!important;
    max-width:none!important;
    transform:none!important;
    border-left:1px solid var(--mar-border)!important;
    box-shadow:none!important;
    z-index:45!important;
    overflow:hidden!important;
}
.mar-app.mar-elementor-edit .mar-panel.mar-elementor-admin-panel .mar-panel-body{
    height:calc(100% - 126px)!important;
    max-height:none!important;
    overflow:auto!important;
}
.mar-app.mar-elementor-edit .mar-panel.mar-elementor-admin-panel .mar-panel-header{
    min-height:64px!important;
}
.mar-app.mar-elementor-edit .mar-backdrop{
    display:none!important;
}
.mar-app.mar-elementor-edit .mar-panel.mar-elementor-admin-panel #marClosePanel{
    display:none!important;
}

/* Login real dentro do canvas do Elementor, sem tentar autenticar no editor. */
.mar-login-editor-preview{
    position:relative!important;
    inset:auto!important;
    width:100%!important;
    height:calc(100vh - 8px)!important;
    min-height:760px!important;
    margin:0!important;
    overflow:hidden!important;
    background:#000!important;
}
.mar-login-editor-preview .mar-login-card{
    min-height:100%!important;
}

/* Proteção extra contra estilos do tema/Elementor invadindo o aplicativo. */
.mar-app button,
.mar-app input,
.mar-app select,
.mar-app textarea,
.mar-login-shell button,
.mar-login-shell input{
    font-family:inherit!important;
}
.mar-app button:focus,
.mar-app input:focus,
.mar-app select:focus,
.mar-app textarea:focus{
    outline-color:#3C2365!important;
}

@media(max-width:860px){
    .mar-app.mar-elementor-edit .mar-panel.mar-elementor-admin-panel{
        left:0!important;
        top:54px!important;
    }
}

/* Mega Rê v1.9.0 — abertura de 1 segundo, logo menor e zoom suave */
@keyframes marSplashZoomIn{
  0%{transform:translate(-50%,-50%) scale(.72);opacity:.25}
  68%{transform:translate(-50%,-50%) scale(1.035);opacity:1}
  100%{transform:translate(-50%,-50%) scale(1);opacity:1}
}
@media(max-width:860px){
  .mar-splash-logo{
    width:98px!important;
    height:116px!important;
    left:50%!important;
    top:50%!important;
    transform:translate(-50%,-50%) scale(.72)!important;
  }
  .mar-mobile-splash.is-visible .mar-splash-logo{
    animation:marSplashZoomIn .82s cubic-bezier(.2,.72,.25,1) both!important;
  }
}


/* =========================================================
   Mega Rê v1.9.1 — splash mobile realmente central + login compacto
   ========================================================= */
@media(max-width:860px){
  body>.mar-mobile-splash,
  body>.mar-mobile-splash.is-visible{
    position:fixed!important;
    inset:0!important;
    width:100vw!important;
    height:100svh!important;
    min-height:100svh!important;
    padding:0!important;
    margin:0!important;
    display:grid!important;
    place-items:center!important;
    background:#000!important;
    z-index:2147483000!important;
  }
  body>.mar-mobile-splash .mar-splash-logo{
    position:relative!important;
    inset:auto!important;
    left:auto!important;
    top:auto!important;
    width:86px!important;
    height:102px!important;
    margin:0!important;
    transform:scale(.72)!important;
  }
  body>.mar-mobile-splash.is-visible .mar-splash-logo{
    animation:marSplashZoomInBody .82s cubic-bezier(.2,.72,.25,1) both!important;
  }
}
@keyframes marSplashZoomInBody{
  0%{transform:scale(.72);opacity:.22}
  68%{transform:scale(1.035);opacity:1}
  100%{transform:scale(1);opacity:1}
}
@media(max-width:620px){
  .mar-login-main{
    width:100%!important;
    max-width:100%!important;
    padding-left:24px!important;
    padding-right:24px!important;
    transform:none!important;
  }
  .mar-login-brand{
    margin-bottom:20px!important;
  }
  .mar-login-brand .mar-brand-mark.mar-brand-mark-image{
    width:58px!important;
    height:69px!important;
  }
  .mar-google-login-wrap{
    width:min(330px,calc(100vw - 56px))!important;
    max-width:330px!important;
    min-height:56px!important;
    padding:5px!important;
    margin-left:auto!important;
    margin-right:auto!important;
  }
  .mar-login-google-copy{
    text-align:center!important;
    font-size:14px!important;
  }
}


/* v2.0.0 — experiências exclusivas de agentes premium */
.mar-app.mar-client-private-mode #marPersonalNavGroup,
.mar-app.mar-client-private-mode .mar-nav-item[data-section="owner"],
.mar-app.mar-client-private-mode .mar-admin-only{
    display:none !important;
}
.mar-app.mar-single-exclusive-agent .mar-nav-item[data-section="agents"]{
    display:none !important;
}
.mar-app.mar-client-private-mode .mar-brand-mark-image img,
.mar-app.mar-client-private-mode .mar-topbar-logo img{
    width:100%;
    height:100%;
    object-fit:contain;
}
.mar-app.mar-client-private-mode .mar-brand-text{
    max-width:150px;
    overflow:hidden;
    text-overflow:ellipsis;
    white-space:nowrap;
}
.mar-app.mar-client-private-mode .mar-agent-subtitle{
    max-width:min(58vw,520px);
    overflow:hidden;
    text-overflow:ellipsis;
    white-space:nowrap;
}
#marAgentMaterialsView .mar-material-list{
    display:grid;
    gap:12px;
    max-width:900px;
}


/* v2.1.0 — editor visual de agentes premium + preview responsivo */
.mar-agent-logo-field{display:grid;gap:8px}.mar-agent-logo-upload{display:flex;align-items:center;gap:14px;border:1px dashed var(--mar-border);border-radius:14px;padding:14px;background:var(--mar-surface)}.mar-agent-logo-preview{width:84px;height:84px;border-radius:14px;border:1px solid var(--mar-border);background:var(--mar-bg);display:grid;place-items:center;overflow:hidden;flex:0 0 auto}.mar-agent-logo-preview img{width:100%;height:100%;object-fit:contain}.mar-agent-logo-upload>div:last-child{display:grid;gap:7px}.mar-agent-logo-upload small{font-size:10px;line-height:1.45;color:var(--mar-muted)}
.mar-agent-preview-card{margin-top:18px;border:1px solid var(--mar-border);border-radius:16px;overflow:hidden;background:var(--mar-bg)}.mar-agent-preview-head{display:flex;align-items:center;justify-content:space-between;gap:12px;padding:14px 16px;border-bottom:1px solid var(--mar-border)}.mar-agent-preview-head>div:first-child{display:grid;gap:3px}.mar-agent-preview-head strong{font-size:13px}.mar-agent-preview-head span{font-size:10px;color:var(--mar-muted)}.mar-agent-preview-head>div:last-child{display:flex;gap:6px}.mar-agent-preview-stage{min-height:520px;background:var(--mar-surface);display:grid;place-items:center;padding:18px}.mar-agent-preview-device{--agent-brand:#3C2365;--agent-bg:#000;--agent-sidebar:#0D0D0D;--agent-composer:#202124;--agent-surface:#18181B;--agent-active:#3C2365;width:min(390px,100%);height:520px;border-radius:24px;background:var(--agent-bg);color:#fff;overflow:hidden;box-shadow:0 18px 48px rgba(0,0,0,.22);display:flex;flex-direction:column}.mar-agent-preview-device.is-desktop{width:min(920px,100%);border-radius:12px}.mar-agent-preview-top{min-height:56px;display:flex;align-items:center;gap:10px;padding:0 13px;background:var(--agent-bg);border-bottom:1px solid rgba(255,255,255,.09)}.mar-agent-preview-logo{width:34px;height:34px;border-radius:9px;display:grid;place-items:center;overflow:hidden;background:transparent}.mar-agent-preview-logo img{width:100%;height:100%;object-fit:contain}.mar-agent-preview-top strong{font-size:14px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.mar-agent-preview-body{display:flex;flex:1;min-height:0}.mar-agent-preview-body aside{display:none;width:190px;background:var(--agent-sidebar);padding:12px 9px}.mar-agent-preview-device.is-desktop .mar-agent-preview-body aside{display:grid;align-content:start;gap:5px}.mar-agent-preview-body aside>*{padding:9px;border-radius:8px;font-size:11px}.mar-agent-preview-body aside b{background:var(--agent-active)}.mar-agent-preview-body main{flex:1;display:flex;flex-direction:column;min-width:0;padding:14px;background:var(--agent-bg)}.mar-agent-preview-welcome{max-width:540px;width:100%;margin:20px auto 0;background:var(--agent-surface);border-radius:14px;padding:14px}.mar-agent-preview-welcome strong{font-size:14px}.mar-agent-preview-welcome p{font-size:11px;line-height:1.45;color:#c0c0c6;margin:6px 0 0}.mar-agent-preview-spacer{flex:1}.mar-agent-preview-composer{min-height:54px;border-radius:28px;background:var(--agent-composer);display:flex;align-items:center;gap:9px;padding:0 11px;color:#b7b7bd}.mar-agent-preview-composer em{font-style:normal;font-size:11px;flex:1}.mar-agent-preview-composer b{width:36px;height:36px;border-radius:50%;display:grid;place-items:center;background:var(--agent-brand)}.mar-agent-preview-body main>small{text-align:center;color:#888;font-size:9px;padding-top:6px}.mar-agent-preview-head .mar-small-button.is-active{background:var(--mar-accent);color:#fff;border-color:var(--mar-accent)}
.mar-app.mar-client-private-mode .mar-nav-item.is-active{background:var(--mar-agent-active-bg,var(--mar-accent-soft))!important}.mar-app.mar-client-private-mode .mar-composer{background:var(--mar-surface-2)!important}.mar-app.mar-client-private-mode .mar-welcome,.mar-app.mar-client-private-mode .mar-starter-card{background:var(--mar-surface)!important}
@media(max-width:620px){.mar-agent-logo-upload{align-items:flex-start}.mar-agent-preview-stage{padding:12px}.mar-agent-preview-device{height:480px}.mar-agent-preview-head{align-items:flex-start;flex-direction:column}.mar-agent-preview-head>div:last-child{width:100%}}

/* v2.3.0 — memória inteligente, conversas fixadas e controles do agente */
.mar-memory-toolbar{display:grid;grid-template-columns:minmax(240px,360px) 1fr;gap:16px;align-items:end;margin:0 0 18px}.mar-memory-cycle,.mar-memory-summary-card,.mar-memory-note,.mar-memory-group{border:1px solid var(--mar-border,#303036);background:var(--mar-surface,#18181b);border-radius:16px;padding:16px}.mar-memory-cycle{display:flex;flex-direction:column;gap:5px}.mar-memory-cycle span,.mar-memory-dates,.mar-memory-note p{color:var(--mar-muted,#aaaab1);font-size:13px;line-height:1.55}.mar-memory-summary-card{margin-bottom:14px}.mar-memory-summary-card h3{margin:5px 0 10px}.mar-memory-summary-card #marMemorySummary{white-space:pre-wrap;line-height:1.6}.mar-memory-dates{display:flex;gap:18px;flex-wrap:wrap;margin-top:14px}.mar-memory-note{margin-bottom:16px}.mar-memory-note p{margin:8px 0 0}.mar-memory-groups{display:grid;gap:14px}.mar-memory-group h3{margin:0 0 12px;font-size:16px}.mar-memory-item{display:flex;gap:16px;align-items:flex-start;justify-content:space-between;padding:13px 0;border-top:1px solid var(--mar-border,#303036)}.mar-memory-item:first-of-type{border-top:0}.mar-memory-item-copy{min-width:0;flex:1}.mar-memory-item-copy strong{display:block;margin-bottom:5px}.mar-memory-item-copy p{margin:0;white-space:pre-wrap;line-height:1.55;color:var(--mar-muted,#b6b6bc)}.mar-memory-actions,.mar-inline-actions{display:flex;gap:8px;flex-wrap:wrap}.mar-history-row.is-pinned .mar-history-item{font-weight:700}.mar-history-pin{display:inline-block;margin-right:7px;color:var(--mar-accent,#3C2365);font-size:18px;line-height:0}.mar-message-feedback button{min-width:34px;min-height:30px;font-size:16px;line-height:1}.mar-agent-link-row{display:grid;grid-template-columns:minmax(0,1fr) auto auto;gap:8px}.mar-agent-link-field small{display:block;margin-top:6px}.mar-agent-trash-box{margin-top:18px;padding-top:16px;border-top:1px solid var(--mar-border,#d9d9dd)}
@media(max-width:720px){.mar-memory-toolbar{grid-template-columns:1fr}.mar-memory-item{flex-direction:column}.mar-agent-link-row{grid-template-columns:1fr 1fr}.mar-agent-link-row input{grid-column:1/-1}.mar-memory-dates{flex-direction:column;gap:5px}}
.mar-exclusive-memory-nav{display:none!important}.mar-app.mar-client-private-mode .mar-exclusive-memory-nav{display:flex!important}
.mar-memory-summary-actions{margin-top:12px}

/* v2.5.0 — final do link exclusivo editável, sem alterar o slug interno do agente */
.mar-agent-custom-link-row{display:grid;grid-template-columns:auto minmax(0,1fr);align-items:stretch}
.mar-agent-share-prefix{display:flex;align-items:center;padding:0 12px;border:1px solid var(--mar-border,#d9d9dd);border-right:0;border-radius:10px 0 0 10px;background:var(--mar-surface,#f5f5f7);color:var(--mar-muted,#666);white-space:nowrap;font-size:13px;overflow:auto;max-width:100%}
.mar-agent-custom-link-row input{border-radius:0 10px 10px 0!important}
.mar-app[data-theme="dark"] .mar-agent-share-prefix,.mar-wp-admin.is-dark-admin .mar-agent-share-prefix{background:#141417;color:#bdbdc5;border-color:#303036}
@media(max-width:720px){.mar-agent-custom-link-row{grid-template-columns:1fr}.mar-agent-share-prefix{border-right:1px solid var(--mar-border,#d9d9dd);border-bottom:0;border-radius:10px 10px 0 0;min-height:42px}.mar-agent-custom-link-row input{border-radius:0 0 10px 10px!important}}

/* =========================================================
   Mega Rê v2.5.1 — entrada direta de agente + splash central
   ========================================================= */
body.mar-direct-agent-entry > .mar-mobile-splash,
body.mar-direct-agent-entry > .mar-mobile-splash.is-visible{
    position:fixed!important;
    inset:0!important;
    width:100vw!important;
    height:100dvh!important;
    min-height:100dvh!important;
    padding:0!important;
    margin:0!important;
    background:#000!important;
    z-index:2147483000!important;
    place-items:center!important;
}
body.mar-direct-agent-entry > .mar-mobile-splash{
    display:grid!important;
    opacity:0;
    visibility:hidden;
    pointer-events:none;
    transition:opacity .12s ease,visibility .12s ease;
}
body.mar-direct-agent-entry > .mar-mobile-splash.is-visible{
    opacity:1!important;
    visibility:visible!important;
    pointer-events:auto!important;
}
body.mar-direct-agent-entry > .mar-mobile-splash.is-done{
    display:none!important;
}
body.mar-direct-agent-entry > .mar-mobile-splash .mar-splash-logo{
    position:relative!important;
    inset:auto!important;
    left:auto!important;
    top:auto!important;
    width:82px!important;
    height:98px!important;
    margin:0!important;
    transform:scale(.72)!important;
}
body.mar-direct-agent-entry > .mar-mobile-splash.is-visible .mar-splash-logo{
    animation:marSplashZoomInBody .82s cubic-bezier(.2,.72,.25,1) both!important;
}

@media(max-width:860px){
    body > .mar-mobile-splash,
    body > .mar-mobile-splash.is-visible,
    body.mar-direct-agent-entry > .mar-mobile-splash,
    body.mar-direct-agent-entry > .mar-mobile-splash.is-visible{
        inset:auto 0 auto 0!important;
        top:var(--mar-visual-viewport-top,0px)!important;
        width:100vw!important;
        height:var(--mar-visual-viewport-height,100dvh)!important;
        min-height:var(--mar-visual-viewport-height,100dvh)!important;
        padding:0!important;
        margin:0!important;
        display:grid!important;
        place-items:center!important;
        background:#000!important;
    }
    body > .mar-mobile-splash .mar-splash-logo,
    body.mar-direct-agent-entry > .mar-mobile-splash .mar-splash-logo{
        position:relative!important;
        inset:auto!important;
        left:auto!important;
        top:auto!important;
        width:64px!important;
        height:76px!important;
        margin:0!important;
        padding:0!important;
    }
}


/* =========================================================
   Mega Rê v2.5.2 — agente direto fiel ao preview aprovado
   ========================================================= */
.mar-onboarding-card .mar-onboarding-field input{
    border:1px solid #d7dce3!important;
    outline:0!important;
    box-shadow:none!important;
    accent-color:#3C2365!important;
}
.mar-onboarding-card .mar-onboarding-field input:focus,
.mar-onboarding-card .mar-onboarding-field input:focus-visible{
    border-color:#3C2365!important;
    outline:0!important;
    box-shadow:0 0 0 3px rgba(60,35,101,.10)!important;
}
.mar-onboarding-card .mar-onboarding-save{
    appearance:none!important;
    -webkit-appearance:none!important;
    border:0!important;
    background:#3C2365!important;
    color:#fff!important;
    box-shadow:0 12px 28px rgba(60,35,101,.22)!important;
    outline:0!important;
}
.mar-onboarding-card .mar-onboarding-save:hover,
.mar-onboarding-card .mar-onboarding-save:focus,
.mar-onboarding-card .mar-onboarding-save:focus-visible{
    background:#3C2365!important;
    color:#fff!important;
    border:0!important;
    outline:0!important;
    box-shadow:0 12px 28px rgba(60,35,101,.22)!important;
}
.mar-onboarding-card .mar-onboarding-kicker,
.mar-onboarding-card h2{color:#3C2365!important}

.mar-error-card{
    color:#3C2365!important;
    background:#f2eef8!important;
    border:1px solid #3C2365!important;
}
.mar-app[data-theme="dark"] .mar-error-card,
.mar-app.mar-direct-agent-mode .mar-error-card{
    color:#fff!important;
    background:#18181f!important;
    border-color:#3C2365!important;
}

.mar-app.mar-direct-agent-mode{
    --mar-accent:#3C2365!important;
    --mar-agent-active-bg:#3C2365!important;
    --mar-bg:#000!important;
    --mar-sidebar:#0D0D0D!important;
    --mar-surface:#18181B!important;
    --mar-surface-2:#202124!important;
    --mar-text:#fff!important;
    --mar-muted:#b7b7bd!important;
    --mar-border:#26262b!important;
    width:100%!important;
    min-height:var(--mar-app-height,100dvh)!important;
    height:var(--mar-app-height,100dvh)!important;
    grid-template-columns:250px minmax(0,1fr)!important;
    background:#000!important;
    color:#fff!important;
}
.mar-app.mar-direct-agent-mode .mar-sidebar{
    width:250px!important;
    padding:0 11px 14px!important;
    background:#0D0D0D!important;
    border-right:1px solid #26262b!important;
    color:#fff!important;
}
.mar-app.mar-direct-agent-mode .mar-sidebar-top{
    min-height:66px!important;
    height:66px!important;
    margin:0 -11px 6px!important;
    padding:0 18px!important;
    border-bottom:1px solid #232328!important;
    justify-content:flex-start!important;
}
.mar-app.mar-direct-agent-mode .mar-brand{
    padding:0!important;
    gap:11px!important;
    color:#fff!important;
    background:transparent!important;
    border:0!important;
    box-shadow:none!important;
}
.mar-app.mar-direct-agent-mode .mar-brand-mark{
    width:38px!important;
    height:38px!important;
    min-width:38px!important;
    border-radius:0!important;
    background:transparent!important;
    box-shadow:none!important;
}
.mar-app.mar-direct-agent-mode .mar-brand-mark img{
    width:100%!important;
    height:100%!important;
    object-fit:contain!important;
}
.mar-app.mar-direct-agent-mode .mar-brand-text{
    font-size:16px!important;
    font-weight:800!important;
    color:#fff!important;
}
.mar-app.mar-direct-agent-mode .mar-close-mobile{margin-left:auto!important;color:#fff!important}
.mar-app.mar-direct-agent-mode .mar-new-chat{
    margin:8px 4px 8px!important;
    min-height:44px!important;
    border:0!important;
    border-radius:9px!important;
    background:#3C2365!important;
    color:#fff!important;
    box-shadow:none!important;
    font-size:12px!important;
    font-weight:800!important;
}
.mar-app.mar-direct-agent-mode .mar-new-chat:hover,
.mar-app.mar-direct-agent-mode .mar-new-chat:focus{background:#3C2365!important;color:#fff!important;outline:0!important}
.mar-app.mar-direct-agent-mode .mar-search,
.mar-app.mar-direct-agent-mode .mar-nav,
.mar-app.mar-direct-agent-mode .mar-sidebar-label,
.mar-app.mar-direct-agent-mode .mar-history-filters,
.mar-app.mar-direct-agent-mode .mar-profile{display:none!important}
.mar-direct-agent-nav{
    display:grid!important;
    gap:5px!important;
    padding:0 4px!important;
    margin:3px 0 0!important;
}
.mar-direct-agent-nav button{
    appearance:none!important;
    width:100%!important;
    min-height:40px!important;
    border:0!important;
    border-radius:8px!important;
    background:transparent!important;
    color:#fff!important;
    text-align:left!important;
    padding:0 10px!important;
    font-size:12px!important;
    font-weight:650!important;
    cursor:pointer!important;
    box-shadow:none!important;
}
.mar-direct-agent-nav button:hover,
.mar-direct-agent-nav button:focus{background:#18181f!important;color:#fff!important;outline:0!important}
.mar-app.mar-direct-agent-mode .mar-history{
    display:none!important;
    margin:2px 4px 8px!important;
    padding:4px 0!important;
    max-height:240px!important;
    overflow:auto!important;
}
.mar-app.mar-direct-agent-mode.mar-direct-history-open .mar-history{display:grid!important}
.mar-app.mar-direct-agent-mode .mar-history-item{color:#e5e5ea!important;font-size:11px!important}
.mar-app.mar-direct-agent-mode .mar-history-item:hover{background:#18181f!important}
.mar-app.mar-direct-agent-mode .mar-history-empty{color:#9c9ca5!important;font-size:10px!important}

.mar-app.mar-direct-agent-mode .mar-main{
    min-height:0!important;
    height:var(--mar-app-height,100dvh)!important;
    grid-template-rows:66px 1fr auto!important;
    background:#000!important;
}
.mar-app.mar-direct-agent-mode .mar-topbar{
    min-height:66px!important;
    height:66px!important;
    padding:0 18px!important;
    background:#000!important;
    border-bottom:1px solid #232328!important;
    backdrop-filter:none!important;
}
.mar-app.mar-direct-agent-mode .mar-topbar-left{gap:11px!important}
.mar-app.mar-direct-agent-mode .mar-topbar-logo{
    display:grid!important;
    width:38px!important;
    height:38px!important;
    place-items:center!important;
}
.mar-app.mar-direct-agent-mode .mar-topbar-logo img{width:100%!important;height:100%!important;object-fit:contain!important}
.mar-app.mar-direct-agent-mode .mar-agent-name{font-size:16px!important;color:#fff!important;font-weight:800!important}
.mar-app.mar-direct-agent-mode .mar-agent-subtitle,
.mar-app.mar-direct-agent-mode .mar-topbar-actions{display:none!important}
.mar-app.mar-direct-agent-mode .mar-content{
    min-height:0!important;
    overflow-y:auto!important;
    padding:18px 16px 120px!important;
    background:#000!important;
}
.mar-app.mar-direct-agent-mode .mar-welcome-minimal{
    display:block!important;
    width:min(680px,82%)!important;
    margin:22px auto 0!important;
    padding:18px!important;
    text-align:left!important;
    background:#18181B!important;
    border:0!important;
    border-radius:17px!important;
    box-shadow:none!important;
}
.mar-app.mar-direct-agent-mode .mar-welcome-minimal .mar-hero-mark{display:none!important}
.mar-app.mar-direct-agent-mode .mar-welcome-minimal h1{
    display:block!important;
    margin:0!important;
    color:#fff!important;
    font-size:16px!important;
    line-height:1.25!important;
    letter-spacing:0!important;
    font-weight:800!important;
}
.mar-app.mar-direct-agent-mode .mar-welcome-minimal>p{
    display:block!important;
    width:100%!important;
    margin:8px 0 0!important;
    color:#f0f0f4!important;
    font-size:12px!important;
    line-height:1.5!important;
}
.mar-app.mar-direct-agent-mode .mar-starter-grid{margin-top:12px!important;gap:8px!important}
.mar-app.mar-direct-agent-mode .mar-starter-card{background:#18181B!important;color:#fff!important;border-color:#2a2a31!important}
.mar-app.mar-direct-agent-mode .mar-messages{width:min(820px,96%)!important}
.mar-app.mar-direct-agent-mode .mar-message.is-user .mar-bubble{background:#2a2a31!important;color:#fff!important}
.mar-app.mar-direct-agent-mode .mar-message.is-agent .mar-bubble{background:#18181B!important;color:#fff!important;border-color:#2a2a31!important}
.mar-app.mar-direct-agent-mode .mar-composer-area{
    padding:10px 16px 12px!important;
    background:linear-gradient(to top,#000 76%,rgba(0,0,0,0))!important;
}
.mar-app.mar-direct-agent-mode .mar-composer{
    width:min(820px,96%)!important;
    min-height:64px!important;
    border:0!important;
    border-radius:999px!important;
    background:#23242a!important;
    box-shadow:none!important;
    padding:8px 11px 7px 16px!important;
}
.mar-app.mar-direct-agent-mode .mar-composer textarea,
.mar-app.mar-direct-agent-mode .mar-composer textarea:focus,
.mar-app.mar-direct-agent-mode .mar-composer textarea:focus-visible{
    color:#fff!important;
    background:transparent!important;
    border:0!important;
    outline:0!important;
    box-shadow:none!important;
}
.mar-app.mar-direct-agent-mode .mar-composer textarea::placeholder{color:#d7d7dc!important;opacity:1!important}
.mar-app.mar-direct-agent-mode .mar-composer-icon,
.mar-app.mar-direct-agent-mode .mar-send,
.mar-app.mar-direct-agent-mode .mar-voice-input{
    border-color:transparent!important;
    box-shadow:none!important;
    outline:0!important;
}
.mar-app.mar-direct-agent-mode .mar-send,
.mar-app.mar-direct-agent-mode .mar-voice-input{background:#3C2365!important;color:#fff!important}
.mar-app.mar-direct-agent-mode .mar-composer-note{color:#8b8b94!important;font-size:9px!important;margin-top:7px!important}

@media(max-width:860px){
    .mar-app.mar-direct-agent-mode{
        display:block!important;
        width:100%!important;
        min-height:var(--mar-app-height,100dvh)!important;
        height:var(--mar-app-height,100dvh)!important;
    }
    .mar-app.mar-direct-agent-mode .mar-sidebar{
        position:fixed!important;
        inset:0 auto 0 0!important;
        width:min(310px,88vw)!important;
        height:var(--mar-app-height,100dvh)!important;
        z-index:60!important;
        transform:translateX(-102%)!important;
    }
    .mar-app.mar-direct-agent-mode .mar-sidebar.is-open{transform:translateX(0)!important}
    .mar-app.mar-direct-agent-mode .mar-main{height:var(--mar-app-height,100dvh)!important;grid-template-rows:60px 1fr auto!important}
    .mar-app.mar-direct-agent-mode .mar-topbar{height:60px!important;min-height:60px!important;padding:0 13px!important}
    .mar-app.mar-direct-agent-mode .mar-open-mobile{display:grid!important;place-items:center!important;color:#fff!important}
    .mar-app.mar-direct-agent-mode .mar-topbar-logo{width:31px!important;height:31px!important}
    .mar-app.mar-direct-agent-mode .mar-agent-name{font-size:14px!important}
    .mar-app.mar-direct-agent-mode .mar-content{padding:14px 10px 108px!important}
    .mar-app.mar-direct-agent-mode .mar-welcome-minimal{width:100%!important;margin:10px auto 0!important;border-radius:14px!important;padding:14px!important}
    .mar-app.mar-direct-agent-mode .mar-welcome-minimal h1{font-size:14px!important}
    .mar-app.mar-direct-agent-mode .mar-welcome-minimal>p{font-size:11px!important;line-height:1.45!important}
    .mar-app.mar-direct-agent-mode .mar-composer-area{padding:8px 10px 9px!important}
    .mar-app.mar-direct-agent-mode .mar-composer{width:100%!important;min-height:58px!important;padding:7px 10px 6px 13px!important}
    .mar-app.mar-direct-agent-mode .mar-composer-note{font-size:8px!important;margin-top:6px!important}
}


/* =========================================================
   Mega Rê v2.5.4 — link exclusivo fiel ao preview aprovado
   Estrutura: cabeçalho do agente em largura total + menu lateral
   abaixo dele no desktop; cabeçalho compacto + menu recolhido no celular.
   ========================================================= */
.mar-app.mar-direct-agent-mode.mar-direct-agent-ready{
    display:grid!important;
    grid-template-columns:250px minmax(0,1fr)!important;
    grid-template-rows:66px minmax(0,1fr)!important;
    grid-template-areas:
        "agent-header agent-header"
        "agent-sidebar agent-main"!important;
    width:100vw!important;
    height:var(--mar-app-height,100dvh)!important;
    min-height:var(--mar-app-height,100dvh)!important;
    overflow:hidden!important;
    background:#000!important;
}
.mar-app.mar-direct-agent-mode.mar-direct-agent-ready > .mar-topbar{
    grid-area:agent-header!important;
    position:relative!important;
    inset:auto!important;
    width:100%!important;
    height:66px!important;
    min-height:66px!important;
    padding:0 18px!important;
    display:flex!important;
    align-items:center!important;
    justify-content:flex-start!important;
    background:#000!important;
    border:0!important;
    border-bottom:1px solid #232328!important;
    backdrop-filter:none!important;
    z-index:45!important;
}
.mar-app.mar-direct-agent-mode.mar-direct-agent-ready > .mar-topbar .mar-topbar-left{
    display:flex!important;
    align-items:center!important;
    gap:11px!important;
    min-width:0!important;
}
.mar-app.mar-direct-agent-mode.mar-direct-agent-ready > .mar-topbar .mar-topbar-left>div{
    display:block!important;
    min-width:0!important;
}
.mar-app.mar-direct-agent-mode.mar-direct-agent-ready > .mar-topbar .mar-topbar-logo{
    display:grid!important;
    width:38px!important;
    height:38px!important;
    min-width:38px!important;
    place-items:center!important;
}
.mar-app.mar-direct-agent-mode.mar-direct-agent-ready > .mar-topbar .mar-topbar-logo img{
    width:100%!important;
    height:100%!important;
    object-fit:contain!important;
}
.mar-app.mar-direct-agent-mode.mar-direct-agent-ready > .mar-topbar .mar-agent-name{
    display:block!important;
    max-width:min(64vw,520px)!important;
    overflow:hidden!important;
    text-overflow:ellipsis!important;
    white-space:nowrap!important;
    color:#fff!important;
    font-size:16px!important;
    line-height:1.2!important;
    font-weight:800!important;
}
.mar-app.mar-direct-agent-mode.mar-direct-agent-ready > .mar-topbar .mar-agent-subtitle,
.mar-app.mar-direct-agent-mode.mar-direct-agent-ready > .mar-topbar .mar-topbar-actions{
    display:none!important;
}
.mar-app.mar-direct-agent-mode.mar-direct-agent-ready > .mar-topbar .mar-open-mobile{
    display:none!important;
}

.mar-app.mar-direct-agent-mode.mar-direct-agent-ready > .mar-sidebar{
    grid-area:agent-sidebar!important;
    position:relative!important;
    inset:auto!important;
    transform:none!important;
    width:250px!important;
    height:auto!important;
    min-height:0!important;
    padding:14px 11px!important;
    overflow-y:auto!important;
    background:#0D0D0D!important;
    border:0!important;
    border-right:1px solid #26262b!important;
    z-index:30!important;
}
.mar-app.mar-direct-agent-mode.mar-direct-agent-ready > .mar-sidebar .mar-sidebar-top{
    display:none!important;
}
.mar-app.mar-direct-agent-mode.mar-direct-agent-ready > .mar-sidebar .mar-new-chat{
    margin:0 4px 8px!important;
    width:calc(100% - 8px)!important;
    min-height:44px!important;
    justify-content:flex-start!important;
    padding:0 11px!important;
    border:0!important;
    border-radius:9px!important;
    background:#3C2365!important;
    color:#fff!important;
    font-size:12px!important;
    font-weight:800!important;
}
.mar-app.mar-direct-agent-mode.mar-direct-agent-ready > .mar-sidebar .mar-new-chat>span:first-child{
    display:none!important;
}
.mar-app.mar-direct-agent-mode.mar-direct-agent-ready .mar-direct-agent-nav{
    display:grid!important;
    gap:5px!important;
    padding:0 4px!important;
    margin:3px 0 0!important;
}
.mar-app.mar-direct-agent-mode.mar-direct-agent-ready .mar-direct-agent-nav button{
    min-height:40px!important;
    padding:0 10px!important;
    border:0!important;
    border-radius:8px!important;
    background:transparent!important;
    color:#fff!important;
    text-align:left!important;
    font-size:12px!important;
    font-weight:650!important;
}
.mar-app.mar-direct-agent-mode.mar-direct-agent-ready .mar-direct-agent-nav button:hover,
.mar-app.mar-direct-agent-mode.mar-direct-agent-ready .mar-direct-agent-nav button:focus{
    background:#18181f!important;
    color:#fff!important;
}
.mar-app.mar-direct-agent-mode.mar-direct-agent-ready > .mar-sidebar .mar-history{
    margin:2px 4px 8px!important;
}

.mar-app.mar-direct-agent-mode.mar-direct-agent-ready > .mar-main{
    grid-area:agent-main!important;
    position:relative!important;
    width:100%!important;
    height:auto!important;
    min-height:0!important;
    display:grid!important;
    grid-template-rows:minmax(0,1fr) auto!important;
    overflow:hidden!important;
    background:#000!important;
}
.mar-app.mar-direct-agent-mode.mar-direct-agent-ready > .mar-main > .mar-content{
    min-height:0!important;
    overflow-y:auto!important;
    padding:18px 16px 24px!important;
    background:#000!important;
}
.mar-app.mar-direct-agent-mode.mar-direct-agent-ready .mar-welcome-minimal{
    width:min(680px,82%)!important;
    margin:22px auto 0!important;
    padding:18px!important;
    text-align:left!important;
    background:#18181B!important;
    border:0!important;
    border-radius:17px!important;
    box-shadow:none!important;
}
.mar-app.mar-direct-agent-mode.mar-direct-agent-ready .mar-welcome-minimal h1{
    display:block!important;
    margin:0!important;
    color:#fff!important;
    font-size:16px!important;
    line-height:1.25!important;
    font-weight:800!important;
}
.mar-app.mar-direct-agent-mode.mar-direct-agent-ready .mar-welcome-minimal>p{
    display:block!important;
    width:100%!important;
    margin:8px 0 0!important;
    color:#f0f0f4!important;
    font-size:12px!important;
    line-height:1.5!important;
}
.mar-app.mar-direct-agent-mode.mar-direct-agent-ready > .mar-main > .mar-composer-area{
    position:relative!important;
    left:auto!important;
    right:auto!important;
    bottom:auto!important;
    z-index:15!important;
    padding:10px 16px 12px!important;
    background:#000!important;
}
.mar-app.mar-direct-agent-mode.mar-direct-agent-ready .mar-composer{
    width:min(820px,96%)!important;
    min-height:64px!important;
    margin:0 auto!important;
    padding:8px 11px 7px 16px!important;
    border:0!important;
    border-radius:999px!important;
    background:#23242a!important;
    box-shadow:none!important;
}
.mar-app.mar-direct-agent-mode.mar-direct-agent-ready .mar-composer-note{
    text-align:center!important;
    color:#8b8b94!important;
    font-size:9px!important;
    margin-top:7px!important;
}
.mar-app.mar-direct-agent-mode.mar-direct-agent-ready > .mar-backdrop{
    z-index:55!important;
}

@media(max-width:860px){
    .mar-app.mar-direct-agent-mode.mar-direct-agent-ready{
        grid-template-columns:1fr!important;
        grid-template-rows:60px minmax(0,1fr)!important;
        grid-template-areas:
            "agent-header"
            "agent-main"!important;
    }
    .mar-app.mar-direct-agent-mode.mar-direct-agent-ready > .mar-topbar{
        height:60px!important;
        min-height:60px!important;
        padding:0 10px!important;
    }
    .mar-app.mar-direct-agent-mode.mar-direct-agent-ready > .mar-topbar .mar-topbar-left{
        width:100%!important;
        gap:8px!important;
    }
    .mar-app.mar-direct-agent-mode.mar-direct-agent-ready > .mar-topbar .mar-open-mobile{
        display:grid!important;
        place-items:center!important;
        width:32px!important;
        height:32px!important;
        min-width:32px!important;
        margin:0 1px 0 0!important;
        padding:0!important;
        color:#fff!important;
        background:transparent!important;
        font-size:18px!important;
    }
    .mar-app.mar-direct-agent-mode.mar-direct-agent-ready > .mar-topbar .mar-topbar-logo{
        width:31px!important;
        height:31px!important;
        min-width:31px!important;
    }
    .mar-app.mar-direct-agent-mode.mar-direct-agent-ready > .mar-topbar .mar-agent-name{
        max-width:calc(100vw - 95px)!important;
        font-size:14px!important;
    }
    .mar-app.mar-direct-agent-mode.mar-direct-agent-ready > .mar-sidebar{
        display:flex!important;
        position:fixed!important;
        inset:60px auto 0 0!important;
        width:min(310px,88vw)!important;
        height:calc(var(--mar-app-height,100dvh) - 60px)!important;
        padding:14px 11px!important;
        transform:translateX(-102%)!important;
        transition:transform .18s ease!important;
        box-shadow:18px 0 50px rgba(0,0,0,.38)!important;
        z-index:60!important;
    }
    .mar-app.mar-direct-agent-mode.mar-direct-agent-ready > .mar-sidebar.is-open{
        transform:translateX(0)!important;
    }
    .mar-app.mar-direct-agent-mode.mar-direct-agent-ready > .mar-main{
        height:auto!important;
        min-height:0!important;
    }
    .mar-app.mar-direct-agent-mode.mar-direct-agent-ready > .mar-main > .mar-content{
        padding:14px 10px 18px!important;
    }
    .mar-app.mar-direct-agent-mode.mar-direct-agent-ready .mar-welcome-minimal{
        width:100%!important;
        margin:10px auto 0!important;
        padding:14px!important;
        border-radius:14px!important;
    }
    .mar-app.mar-direct-agent-mode.mar-direct-agent-ready .mar-welcome-minimal h1{
        font-size:14px!important;
    }
    .mar-app.mar-direct-agent-mode.mar-direct-agent-ready .mar-welcome-minimal>p{
        font-size:11px!important;
        line-height:1.45!important;
    }
    .mar-app.mar-direct-agent-mode.mar-direct-agent-ready > .mar-main > .mar-composer-area{
        padding:8px 10px 9px!important;
    }
    .mar-app.mar-direct-agent-mode.mar-direct-agent-ready .mar-composer{
        width:100%!important;
        min-height:58px!important;
        padding:7px 10px 6px 13px!important;
    }
    .mar-app.mar-direct-agent-mode.mar-direct-agent-ready .mar-composer-note{
        font-size:8px!important;
        margin-top:6px!important;
    }
}

/* ================================================================
   Mega Rê v2.5.5 — fluxo e visual idênticos ao preview aprovado
   ================================================================ */

/* Acesso/Admin: lista automática de quem entrou pelo link. */
.mar-auto-access-note{
    display:flex!important;
    flex-direction:column!important;
    gap:5px!important;
    margin:14px 0 16px!important;
    padding:14px 15px!important;
    border:1px solid #e2e2e8!important;
    border-radius:12px!important;
    background:#f8f7fb!important;
    color:#24242d!important;
}
.mar-auto-access-note strong{color:#3C2365!important;font-size:13px!important}
.mar-auto-access-note span{color:#666672!important;font-size:12px!important;line-height:1.5!important}
.mar-access-table{
    margin-top:12px!important;
    border:1px solid #e2e2e8!important;
    border-radius:12px!important;
    overflow:hidden!important;
    background:#fff!important;
}
.mar-access-head,.mar-access-row{
    display:grid!important;
    grid-template-columns:1.05fr 1.45fr .75fr .7fr!important;
    gap:12px!important;
    align-items:center!important;
    min-height:48px!important;
    padding:10px 12px!important;
}
.mar-access-head{
    background:#f7f7fa!important;
    color:#4f4f5a!important;
    font-size:11px!important;
    font-weight:800!important;
}
.mar-access-row{border-top:1px solid #ececf0!important;color:#25252c!important;font-size:11px!important}
.mar-access-row strong{font-size:12px!important;color:#1f1f26!important}
.mar-access-row>span{min-width:0!important;overflow:hidden!important;text-overflow:ellipsis!important}
.mar-access-pill{display:inline-flex!important;width:max-content!important;padding:5px 8px!important;border-radius:999px!important;font-size:10px!important;font-weight:800!important}
.mar-access-pill.is-active{background:#eee9f5!important;color:#3C2365!important}
.mar-access-pill.is-inactive{background:#f1f1f3!important;color:#666672!important}
@media(max-width:760px){
    .mar-access-head{display:none!important}
    .mar-access-row{grid-template-columns:1fr!important;gap:5px!important;padding:12px!important}
    .mar-access-row>span{white-space:normal!important}
}

/* Onboarding idêntico ao preview: branco, limpo e roxo da paleta. */
.mar-onboarding{padding:22px!important;background:rgba(0,0,0,.76)!important}
.mar-onboarding-card{
    width:min(680px,92vw)!important;
    max-width:680px!important;
    padding:28px 32px!important;
    border:0!important;
    border-radius:18px!important;
    background:#fff!important;
    color:#191923!important;
    box-shadow:0 18px 60px rgba(0,0,0,.40)!important;
}
.mar-onboarding-brand{gap:10px!important;color:#191923!important}
.mar-onboarding-brand .mar-brand-mark{width:42px!important;height:48px!important;min-width:42px!important;background:transparent!important;border:0!important;box-shadow:none!important}
.mar-onboarding-brand .mar-brand-mark img{width:100%!important;height:100%!important;object-fit:contain!important}
.mar-onboarding-kicker{
    display:inline-flex!important;
    margin-top:24px!important;
    padding:7px 11px!important;
    border-radius:999px!important;
    background:#f0edf5!important;
    color:#3C2365!important;
    font-size:10px!important;
    font-weight:900!important;
    letter-spacing:.01em!important;
}
.mar-onboarding-card h2{
    margin:22px 0 8px!important;
    color:#3C2365!important;
    font-size:27px!important;
    line-height:1.1!important;
    font-weight:700!important;
}
.mar-onboarding-card>p{margin:0!important;color:#626272!important;font-size:13px!important;line-height:1.55!important}
.mar-onboarding-field{margin-top:24px!important;gap:7px!important}
.mar-onboarding-field span{color:#25252d!important;font-size:11px!important;font-weight:800!important}
.mar-onboarding-card .mar-onboarding-field input{
    width:100%!important;
    min-height:50px!important;
    margin:0!important;
    padding:13px 14px!important;
    border:1px solid #d4d4db!important;
    border-radius:10px!important;
    background:#fff!important;
    color:#191923!important;
    font-size:16px!important;
    box-shadow:none!important;
    outline:0!important;
}
.mar-onboarding-card .mar-onboarding-field input:focus,
.mar-onboarding-card .mar-onboarding-field input:focus-visible{
    border-color:#3C2365!important;
    box-shadow:0 0 0 3px rgba(60,35,101,.12)!important;
}
.mar-onboarding-card .mar-onboarding-save{
    margin-top:14px!important;
    padding:12px 18px!important;
    border:0!important;
    border-radius:10px!important;
    background:#3C2365!important;
    color:#fff!important;
    font-weight:800!important;
    box-shadow:none!important;
}
.mar-onboarding-card small{display:block!important;margin-top:28px!important;color:#858594!important;font-size:10px!important}
.mar-onboarding-feedback{color:#3C2365!important}
@media(max-width:600px){
    .mar-onboarding{padding:12px!important}
    .mar-onboarding-card{width:100%!important;padding:22px 19px!important}
    .mar-onboarding-card h2{font-size:24px!important}
    .mar-onboarding-card>p{font-size:12px!important}
}

/* Link exclusivo: estrutura do preview aprovado. */
.mar-app.mar-direct-agent-mode.mar-direct-agent-ready{
    display:grid!important;
    grid-template-columns:250px minmax(0,1fr)!important;
    grid-template-rows:64px minmax(0,1fr)!important;
    grid-template-areas:"agent-header agent-header" "agent-sidebar agent-main"!important;
    width:100vw!important;
    height:var(--mar-app-height,100dvh)!important;
    min-height:var(--mar-app-height,100dvh)!important;
    overflow:hidden!important;
    background:#000!important;
    color:#fff!important;
}
.mar-app.mar-direct-agent-mode.mar-direct-agent-ready>.mar-topbar{
    grid-area:agent-header!important;
    position:relative!important;
    inset:auto!important;
    width:100%!important;
    height:64px!important;
    min-height:64px!important;
    padding:0 18px!important;
    display:flex!important;
    align-items:center!important;
    justify-content:flex-start!important;
    background:#000!important;
    border:0!important;
    border-bottom:1px solid #25252a!important;
    z-index:45!important;
}
.mar-app.mar-direct-agent-mode.mar-direct-agent-ready>.mar-topbar .mar-topbar-left{display:flex!important;align-items:center!important;gap:10px!important;width:100%!important;min-width:0!important}
.mar-app.mar-direct-agent-mode.mar-direct-agent-ready>.mar-topbar .mar-topbar-logo{display:grid!important;width:34px!important;height:34px!important;min-width:34px!important;place-items:center!important}
.mar-app.mar-direct-agent-mode.mar-direct-agent-ready>.mar-topbar .mar-topbar-logo img{width:100%!important;height:100%!important;object-fit:contain!important}
.mar-app.mar-direct-agent-mode.mar-direct-agent-ready>.mar-topbar .mar-agent-name{display:block!important;color:#fff!important;font-size:14px!important;font-weight:800!important;line-height:1.2!important;white-space:nowrap!important;overflow:hidden!important;text-overflow:ellipsis!important}
.mar-app.mar-direct-agent-mode.mar-direct-agent-ready>.mar-topbar .mar-agent-subtitle,
.mar-app.mar-direct-agent-mode.mar-direct-agent-ready>.mar-topbar .mar-topbar-actions{display:none!important}
.mar-app.mar-direct-agent-mode.mar-direct-agent-ready>.mar-topbar .mar-open-mobile{display:none!important}

.mar-app.mar-direct-agent-mode.mar-direct-agent-ready>.mar-sidebar{
    grid-area:agent-sidebar!important;
    position:relative!important;
    inset:auto!important;
    transform:none!important;
    width:250px!important;
    height:auto!important;
    min-height:0!important;
    padding:14px 10px!important;
    overflow-y:auto!important;
    background:#0D0D0F!important;
    border:0!important;
    border-right:1px solid #26262b!important;
    box-shadow:none!important;
    z-index:30!important;
}
.mar-app.mar-direct-agent-mode.mar-direct-agent-ready>.mar-sidebar .mar-sidebar-top,
.mar-app.mar-direct-agent-mode.mar-direct-agent-ready>.mar-sidebar .mar-search,
.mar-app.mar-direct-agent-mode.mar-direct-agent-ready>.mar-sidebar>.mar-nav,
.mar-app.mar-direct-agent-mode.mar-direct-agent-ready>.mar-sidebar .mar-sidebar-label,
.mar-app.mar-direct-agent-mode.mar-direct-agent-ready>.mar-sidebar .mar-history-filters,
.mar-app.mar-direct-agent-mode.mar-direct-agent-ready>.mar-sidebar .mar-profile,
.mar-app.mar-direct-agent-mode.mar-direct-agent-ready>.mar-sidebar .mar-sidebar-spacer{display:none!important}
.mar-app.mar-direct-agent-mode.mar-direct-agent-ready>.mar-sidebar .mar-new-chat{
    width:100%!important;
    min-height:44px!important;
    margin:0 0 7px!important;
    padding:0 10px!important;
    justify-content:flex-start!important;
    border:0!important;
    border-radius:9px!important;
    background:#3C2365!important;
    color:#fff!important;
    font-size:11px!important;
    font-weight:800!important;
    box-shadow:none!important;
}
.mar-app.mar-direct-agent-mode.mar-direct-agent-ready>.mar-sidebar .mar-new-chat>span:first-child{display:none!important}
.mar-app.mar-direct-agent-mode.mar-direct-agent-ready .mar-direct-agent-nav{display:grid!important;gap:7px!important;padding:0!important;margin:0!important}
.mar-app.mar-direct-agent-mode.mar-direct-agent-ready .mar-direct-agent-nav button{
    width:100%!important;
    min-height:40px!important;
    padding:0 10px!important;
    border:0!important;
    border-radius:9px!important;
    background:transparent!important;
    color:#fff!important;
    text-align:left!important;
    font-size:11px!important;
    font-weight:700!important;
    box-shadow:none!important;
}
.mar-app.mar-direct-agent-mode.mar-direct-agent-ready .mar-direct-agent-nav button:hover,
.mar-app.mar-direct-agent-mode.mar-direct-agent-ready .mar-direct-agent-nav button:focus{background:#19191e!important;color:#fff!important}
.mar-app.mar-direct-agent-mode.mar-direct-agent-ready>.mar-sidebar .mar-history{display:none!important;margin:4px 0!important;max-height:250px!important}
.mar-app.mar-direct-agent-mode.mar-direct-agent-ready.mar-direct-history-open>.mar-sidebar .mar-history{display:grid!important}

.mar-app.mar-direct-agent-mode.mar-direct-agent-ready>.mar-main{
    grid-area:agent-main!important;
    position:relative!important;
    width:100%!important;
    height:auto!important;
    min-height:0!important;
    display:grid!important;
    grid-template-rows:minmax(0,1fr) auto!important;
    background:#000!important;
    overflow:hidden!important;
}
.mar-app.mar-direct-agent-mode.mar-direct-agent-ready>.mar-main>.mar-content{
    min-height:0!important;
    overflow-y:auto!important;
    padding:17px 15px 24px!important;
    background:#000!important;
}
.mar-app.mar-direct-agent-mode.mar-direct-agent-ready .mar-welcome-minimal{
    width:min(690px,82%)!important;
    margin:18px auto 0!important;
    padding:17px!important;
    border:0!important;
    border-radius:16px!important;
    background:#1A1A1F!important;
    color:#fff!important;
    box-shadow:none!important;
    text-align:left!important;
}
.mar-app.mar-direct-agent-mode.mar-direct-agent-ready .mar-welcome-minimal h1{display:block!important;margin:0!important;color:#fff!important;font-size:15px!important;font-weight:800!important;line-height:1.25!important}
.mar-app.mar-direct-agent-mode.mar-direct-agent-ready .mar-welcome-minimal>p{display:block!important;width:100%!important;margin:7px 0 0!important;color:#f0f0f4!important;font-size:11px!important;line-height:1.5!important}
.mar-app.mar-direct-agent-mode.mar-direct-agent-ready .mar-starter-grid{display:none!important}
.mar-app.mar-direct-agent-mode.mar-direct-agent-ready .mar-messages{width:min(820px,96%)!important;margin:16px auto 0!important}

.mar-app.mar-direct-agent-mode.mar-direct-agent-ready>.mar-main>.mar-composer-area{
    position:relative!important;
    inset:auto!important;
    padding:10px 15px 12px!important;
    background:linear-gradient(to top,#000 72%,rgba(0,0,0,0))!important;
    z-index:20!important;
}
.mar-app.mar-direct-agent-mode.mar-direct-agent-ready .mar-composer{
    display:block!important;
    width:min(825px,96%)!important;
    min-height:60px!important;
    margin:0 auto!important;
    padding:0!important;
    border:0!important;
    border-radius:999px!important;
    background:#23242A!important;
    box-shadow:none!important;
    overflow:visible!important;
}
.mar-app.mar-direct-agent-mode.mar-direct-agent-ready .mar-composer-input-row{
    display:flex!important;
    align-items:center!important;
    gap:6px!important;
    width:100%!important;
    min-height:60px!important;
    padding:7px 9px 7px 12px!important;
}
.mar-app.mar-direct-agent-mode.mar-direct-agent-ready .mar-composer-icon,
.mar-app.mar-direct-agent-mode.mar-direct-agent-ready .mar-round-action{
    display:grid!important;
    place-items:center!important;
    flex:0 0 auto!important;
    width:34px!important;
    height:34px!important;
    min-width:34px!important;
    padding:0!important;
    border:0!important;
    border-radius:50%!important;
    box-shadow:none!important;
    outline:0!important;
}
.mar-app.mar-direct-agent-mode.mar-direct-agent-ready .mar-composer-icon{background:transparent!important;color:#d9d9df!important;opacity:1!important}
.mar-app.mar-direct-agent-mode.mar-direct-agent-ready .mar-composer-icon:disabled{opacity:.45!important}
.mar-app.mar-direct-agent-mode.mar-direct-agent-ready .mar-composer-icon svg,
.mar-app.mar-direct-agent-mode.mar-direct-agent-ready .mar-round-action svg{width:17px!important;height:17px!important}
.mar-app.mar-direct-agent-mode.mar-direct-agent-ready .mar-composer textarea,
.mar-app.mar-direct-agent-mode.mar-direct-agent-ready .mar-composer textarea:focus,
.mar-app.mar-direct-agent-mode.mar-direct-agent-ready .mar-composer textarea:focus-visible{
    display:block!important;
    flex:1 1 auto!important;
    width:auto!important;
    min-width:0!important;
    min-height:28px!important;
    max-height:90px!important;
    height:auto!important;
    padding:5px 3px!important;
    border:0!important;
    outline:0!important;
    background:transparent!important;
    color:#fff!important;
    box-shadow:none!important;
    font-size:11px!important;
    line-height:1.45!important;
}
.mar-app.mar-direct-agent-mode.mar-direct-agent-ready .mar-composer textarea::placeholder{color:#d7d7dc!important;opacity:1!important}
.mar-app.mar-direct-agent-mode.mar-direct-agent-ready .mar-send,
.mar-app.mar-direct-agent-mode.mar-direct-agent-ready .mar-voice-input{background:#3C2365!important;color:#fff!important;opacity:1!important}
.mar-app.mar-direct-agent-mode.mar-direct-agent-ready .mar-send[hidden],
.mar-app.mar-direct-agent-mode.mar-direct-agent-ready .mar-voice-input[hidden]{display:none!important}
.mar-app.mar-direct-agent-mode.mar-direct-agent-ready .mar-composer-note{text-align:center!important;color:#777781!important;font-size:8px!important;margin-top:6px!important}
.mar-app.mar-direct-agent-mode.mar-direct-agent-ready .mar-hidden-file{display:none!important}

/* Atualização puxando a tela para baixo. */
.mar-pull-refresh{
    position:fixed!important;
    top:max(8px,env(safe-area-inset-top))!important;
    left:50%!important;
    z-index:99999!important;
    transform:translate(-50%,-60px)!important;
    padding:8px 12px!important;
    border:1px solid #34343d!important;
    border-radius:999px!important;
    background:#17171d!important;
    color:#fff!important;
    font-size:9px!important;
    font-weight:800!important;
    opacity:0!important;
    pointer-events:none!important;
    transition:transform .18s ease,opacity .18s ease!important;
}
.mar-pull-refresh.is-visible{transform:translate(-50%,0)!important;opacity:1!important}
.mar-pull-refresh.is-armed{background:#3C2365!important;border-color:#3C2365!important}
.mar-pull-refresh.is-loading{background:#3C2365!important;border-color:#3C2365!important}

@media(max-width:860px){
    .mar-app.mar-direct-agent-mode.mar-direct-agent-ready{
        grid-template-columns:1fr!important;
        grid-template-rows:58px minmax(0,1fr)!important;
        grid-template-areas:"agent-header" "agent-main"!important;
    }
    .mar-app.mar-direct-agent-mode.mar-direct-agent-ready>.mar-topbar{
        height:58px!important;
        min-height:58px!important;
        padding:0 10px!important;
    }
    .mar-app.mar-direct-agent-mode.mar-direct-agent-ready>.mar-topbar .mar-topbar-left{gap:8px!important}
    .mar-app.mar-direct-agent-mode.mar-direct-agent-ready>.mar-topbar .mar-open-mobile{
        display:grid!important;
        place-items:center!important;
        width:32px!important;
        height:32px!important;
        min-width:32px!important;
        margin:0!important;
        padding:0!important;
        background:transparent!important;
        color:#fff!important;
        font-size:18px!important;
    }
    .mar-app.mar-direct-agent-mode.mar-direct-agent-ready>.mar-topbar .mar-topbar-logo{width:27px!important;height:27px!important;min-width:27px!important}
    .mar-app.mar-direct-agent-mode.mar-direct-agent-ready>.mar-topbar .mar-agent-name{max-width:calc(100vw - 88px)!important;font-size:12px!important}
    .mar-app.mar-direct-agent-mode.mar-direct-agent-ready>.mar-sidebar{
        display:flex!important;
        flex-direction:column!important;
        position:fixed!important;
        inset:58px auto 0 0!important;
        width:min(270px,78vw)!important;
        height:calc(var(--mar-app-height,100dvh) - 58px)!important;
        padding:14px 10px!important;
        transform:translateX(-104%)!important;
        transition:transform .20s ease!important;
        box-shadow:12px 0 35px rgba(0,0,0,.35)!important;
        z-index:60!important;
    }
    .mar-app.mar-direct-agent-mode.mar-direct-agent-ready>.mar-sidebar.is-open{transform:translateX(0)!important}
    .mar-app.mar-direct-agent-mode.mar-direct-agent-ready>.mar-main{height:auto!important;min-height:0!important}
    .mar-app.mar-direct-agent-mode.mar-direct-agent-ready>.mar-main>.mar-content{padding:11px 9px 18px!important}
    .mar-app.mar-direct-agent-mode.mar-direct-agent-ready .mar-welcome-minimal{width:100%!important;margin:7px auto 0!important;padding:13px!important;border-radius:13px!important}
    .mar-app.mar-direct-agent-mode.mar-direct-agent-ready .mar-welcome-minimal h1{font-size:13px!important}
    .mar-app.mar-direct-agent-mode.mar-direct-agent-ready .mar-welcome-minimal>p{font-size:9px!important;line-height:1.45!important}
    .mar-app.mar-direct-agent-mode.mar-direct-agent-ready>.mar-main>.mar-composer-area{padding:8px 7px 10px!important}
    .mar-app.mar-direct-agent-mode.mar-direct-agent-ready .mar-composer{width:100%!important;min-height:55px!important}
    .mar-app.mar-direct-agent-mode.mar-direct-agent-ready .mar-composer-input-row{min-height:55px!important;padding:5px 6px 5px 9px!important;gap:4px!important}
    .mar-app.mar-direct-agent-mode.mar-direct-agent-ready .mar-composer-icon,
    .mar-app.mar-direct-agent-mode.mar-direct-agent-ready .mar-round-action{width:31px!important;height:31px!important;min-width:31px!important}
    .mar-app.mar-direct-agent-mode.mar-direct-agent-ready .mar-composer-icon svg,
    .mar-app.mar-direct-agent-mode.mar-direct-agent-ready .mar-round-action svg{width:15px!important;height:15px!important}
    .mar-app.mar-direct-agent-mode.mar-direct-agent-ready .mar-composer textarea{font-size:9px!important}
    .mar-app.mar-direct-agent-mode.mar-direct-agent-ready .mar-composer-note{font-size:6.8px!important;margin-top:5px!important}
}

.mar-app.mar-direct-agent-mode.mar-direct-agent-ready .mar-direct-section-card{
    width:min(700px,92%)!important;
    margin:8px auto!important;
    padding:15px!important;
    border:1px solid #292930!important;
    border-radius:14px!important;
    background:#17171c!important;
    color:#fff!important;
}
.mar-app.mar-direct-agent-mode.mar-direct-agent-ready .mar-direct-section-card h2{margin:0 0 10px!important;font-size:15px!important;color:#fff!important}
.mar-app.mar-direct-agent-mode.mar-direct-agent-ready .mar-direct-history-list{display:grid!important;gap:0!important}
.mar-app.mar-direct-agent-mode.mar-direct-agent-ready .mar-direct-history-item{
    display:flex!important;flex-direction:column!important;gap:4px!important;width:100%!important;padding:11px 0!important;border:0!important;border-top:1px solid #292930!important;background:transparent!important;color:#fff!important;text-align:left!important;cursor:pointer!important
}
.mar-app.mar-direct-agent-mode.mar-direct-agent-ready .mar-direct-history-item:first-child{border-top:0!important}
.mar-app.mar-direct-agent-mode.mar-direct-agent-ready .mar-direct-history-item strong{font-size:11px!important;color:#fff!important}
.mar-app.mar-direct-agent-mode.mar-direct-agent-ready .mar-direct-history-item span{font-size:9px!important;color:#9b9ba5!important}
.mar-app.mar-direct-agent-mode.mar-direct-agent-ready #marAgentMaterialsView .mar-section-head,
.mar-app.mar-direct-agent-mode.mar-direct-agent-ready #marAccountView .mar-section-head{width:min(700px,92%)!important;margin:8px auto 12px!important;padding:15px!important;border:1px solid #292930!important;border-radius:14px!important;background:#17171c!important;color:#fff!important}
.mar-app.mar-direct-agent-mode.mar-direct-agent-ready #marAgentMaterialsView .mar-section-head .mar-eyebrow,
.mar-app.mar-direct-agent-mode.mar-direct-agent-ready #marAccountView .mar-section-head .mar-eyebrow{display:none!important}
.mar-app.mar-direct-agent-mode.mar-direct-agent-ready #marAgentMaterialsView .mar-section-head h2,
.mar-app.mar-direct-agent-mode.mar-direct-agent-ready #marAccountView .mar-section-head h2{margin:0 0 6px!important;color:#fff!important;font-size:15px!important}
.mar-app.mar-direct-agent-mode.mar-direct-agent-ready #marAgentMaterialsView .mar-section-head p,
.mar-app.mar-direct-agent-mode.mar-direct-agent-ready #marAccountView .mar-section-head p{margin:0!important;color:#a7a7b0!important;font-size:10px!important}
@media(max-width:860px){
    .mar-app.mar-direct-agent-mode.mar-direct-agent-ready .mar-direct-section-card,
    .mar-app.mar-direct-agent-mode.mar-direct-agent-ready #marAgentMaterialsView .mar-section-head,
    .mar-app.mar-direct-agent-mode.mar-direct-agent-ready #marAccountView .mar-section-head{width:100%!important;margin:7px auto!important;padding:13px!important}
}


/* ================================================================
   Mega Rê v2.5.8 — sidebar personalizada + controles + pin por agente
   ================================================================ */
.mar-app.mar-direct-agent-mode.mar-direct-agent-ready{
    --mar-pin-color:var(--mar-agent-active-bg,#3C2365);
}
.mar-app.mar-direct-agent-mode.mar-direct-agent-ready>.mar-sidebar{
    display:flex!important;flex-direction:column!important;overflow:hidden!important;
}
.mar-app.mar-direct-agent-mode.mar-direct-agent-ready>.mar-sidebar .mar-sidebar-label{
    display:block!important;margin:16px 8px 7px!important;font-size:9px!important;color:#8d8d97!important;font-weight:900!important;letter-spacing:.05em!important;text-transform:uppercase!important;
}
.mar-app.mar-direct-agent-mode.mar-direct-agent-ready>.mar-sidebar .mar-history-filters{display:none!important}
.mar-app.mar-direct-agent-mode.mar-direct-agent-ready>.mar-sidebar .mar-history{
    display:grid!important;gap:4px!important;margin:0!important;padding:0 1px 4px 0!important;max-height:none!important;overflow:auto!important;min-height:0!important;flex:1 1 auto!important;
}
.mar-app.mar-direct-agent-mode.mar-direct-agent-ready .mar-history-row{position:relative!important;border-radius:9px!important;min-height:47px!important;background:transparent!important;border:1px solid transparent!important;padding:0!important}
.mar-app.mar-direct-agent-mode.mar-direct-agent-ready .mar-history-row:hover{background:#17171c!important;border-color:#24242c!important}
.mar-app.mar-direct-agent-mode.mar-direct-agent-ready .mar-history-item{display:flex!important;align-items:center!important;gap:6px!important;width:100%!important;min-height:47px!important;padding:7px 48px 7px 8px!important;background:transparent!important;color:#fff!important;border:0!important}
.mar-app.mar-direct-agent-mode.mar-direct-agent-ready .mar-history-item:hover{background:transparent!important}
.mar-app.mar-direct-agent-mode.mar-direct-agent-ready .mar-history-copy{display:grid!important;gap:3px!important;min-width:0!important;overflow:hidden!important}
.mar-app.mar-direct-agent-mode.mar-direct-agent-ready .mar-history-copy strong{font-size:10px!important;color:#fff!important;white-space:nowrap!important;overflow:hidden!important;text-overflow:ellipsis!important}
.mar-app.mar-direct-agent-mode.mar-direct-agent-ready .mar-history-copy small{font-size:8.5px!important;color:#8f8f98!important;white-space:nowrap!important;overflow:hidden!important;text-overflow:ellipsis!important}
.mar-app.mar-direct-agent-mode.mar-direct-agent-ready .mar-history-more{position:absolute!important;right:5px!important;top:8px!important;width:30px!important;height:30px!important;border-radius:7px!important;color:#aaaab2!important}
.mar-app.mar-direct-agent-mode.mar-direct-agent-ready .mar-history-menu{right:6px!important;top:39px!important;z-index:80!important}
.mar-app.mar-direct-agent-mode.mar-direct-agent-ready .mar-history-pin{display:grid!important;place-items:center!important;flex:0 0 18px!important;width:18px!important;height:18px!important;margin:0!important;color:var(--mar-pin-color)!important;line-height:1!important}
.mar-app.mar-direct-agent-mode.mar-direct-agent-ready .mar-history-pin[hidden]{display:none!important}
.mar-app.mar-direct-agent-mode.mar-direct-agent-ready .mar-history-pin svg{width:15px!important;height:15px!important;fill:currentColor!important;stroke:none!important}
.mar-app.mar-direct-agent-mode.mar-direct-agent-ready>.mar-sidebar .mar-sidebar-spacer{display:none!important}
.mar-app.mar-direct-agent-mode.mar-direct-agent-ready>.mar-sidebar .mar-profile{display:flex!important;position:relative!important;margin-top:auto!important;border-top:1px solid #292930!important;padding:9px!important;gap:9px!important;align-items:center!important;border-radius:10px!important;cursor:pointer!important;color:#fff!important}
.mar-app.mar-direct-agent-mode.mar-direct-agent-ready>.mar-sidebar .mar-profile:hover{background:#19191e!important}
.mar-app.mar-direct-agent-mode.mar-direct-agent-ready>.mar-sidebar .mar-profile .mar-avatar{width:32px!important;height:32px!important;min-width:32px!important}
.mar-app.mar-direct-agent-mode.mar-direct-agent-ready>.mar-sidebar .mar-profile-copy strong{font-size:10px!important;color:#fff!important}
.mar-app.mar-direct-agent-mode.mar-direct-agent-ready>.mar-sidebar .mar-profile-copy span{font-size:8.5px!important;color:#94949d!important;white-space:nowrap!important;overflow:hidden!important;text-overflow:ellipsis!important}
.mar-direct-user-popover{position:absolute!important;left:16px!important;bottom:66px!important;width:calc(250px - 32px)!important;z-index:95!important;padding:11px!important;border:1px solid #34343d!important;border-radius:12px!important;background:#1a1a1f!important;color:#fff!important;box-shadow:0 16px 38px rgba(0,0,0,.45)!important}
.mar-direct-user-popover[hidden]{display:none!important}
.mar-direct-user-popover>strong{display:block!important;font-size:11px!important}
.mar-direct-user-popover>span{display:block!important;margin-top:3px!important;color:#a4a4ad!important;font-size:8.5px!important;white-space:nowrap!important;overflow:hidden!important;text-overflow:ellipsis!important}
.mar-direct-user-popover label{display:block!important;margin-top:10px!important}.mar-direct-user-popover small{display:block!important;margin-bottom:5px!important;color:#c8c8ce!important;font-size:8.5px!important}
.mar-direct-user-popover input{width:100%!important;padding:8px!important;border:1px solid #34343c!important;border-radius:8px!important;background:#111116!important;color:#fff!important;outline:0!important;font-size:10px!important}
.mar-direct-user-popover input:focus{border-color:var(--mar-agent-active-bg,#3C2365)!important;box-shadow:0 0 0 2px color-mix(in srgb,var(--mar-agent-active-bg,#3C2365) 24%,transparent)!important}
.mar-direct-user-popover button{width:100%!important;margin-top:7px!important;padding:8px!important;border:0!important;border-radius:8px!important;background:var(--mar-agent-active-bg,#3C2365)!important;color:#fff!important;font-size:9px!important;font-weight:800!important}
.mar-app.mar-direct-agent-mode.mar-direct-agent-ready .mar-direct-agent-nav{margin-bottom:0!important}
.mar-app.mar-direct-agent-mode.mar-direct-agent-ready .mar-direct-agent-nav button{font-weight:800!important}
.mar-app.mar-direct-agent-mode.mar-direct-agent-ready #marMemoryView .mar-section-head h2{font-size:20px!important}
.mar-app.mar-direct-agent-mode.mar-direct-agent-ready #marMemoryView .mar-memory-toolbar{grid-template-columns:1fr!important}
.mar-app.mar-direct-agent-mode.mar-direct-agent-ready #marMemoryView #marMemoryAgentSelect{display:none!important}

/* Barra de conversa fiel ao preview aprovado. */
.mar-app.mar-direct-agent-mode.mar-direct-agent-ready .mar-composer-icon,
.mar-app.mar-direct-agent-mode.mar-direct-agent-ready .mar-round-action{width:36px!important;height:36px!important;min-width:36px!important}
.mar-app.mar-direct-agent-mode.mar-direct-agent-ready .mar-composer-icon svg,
.mar-app.mar-direct-agent-mode.mar-direct-agent-ready .mar-round-action svg{display:block!important;width:18px!important;height:18px!important;margin:auto!important;transform:none!important;transform-origin:center!important}
.mar-app.mar-direct-agent-mode.mar-direct-agent-ready .mar-camera{margin-left:-2px!important}
.mar-app.mar-direct-agent-mode.mar-direct-agent-ready .mar-camera svg{width:18px!important;height:18px!important;transform:scale(1.10)!important}
.mar-app.mar-direct-agent-mode.mar-direct-agent-ready .mar-send,
.mar-app.mar-direct-agent-mode.mar-direct-agent-ready .mar-voice-input{background:var(--mar-agent-active-bg,#3C2365)!important;color:#fff!important;display:grid!important;place-items:center!important;padding:0!important}
.mar-app.mar-direct-agent-mode.mar-direct-agent-ready .mar-send[hidden],
.mar-app.mar-direct-agent-mode.mar-direct-agent-ready .mar-voice-input[hidden]{display:none!important}
.mar-app.mar-direct-agent-mode.mar-direct-agent-ready .mar-send svg{width:17px!important;height:17px!important;max-width:17px!important;max-height:17px!important;margin:auto!important;transform:none!important;position:static!important}

@media(max-width:860px){
  .mar-direct-user-popover{left:13px!important;bottom:66px!important;width:calc(min(270px,78vw) - 26px)!important}
  .mar-app.mar-direct-agent-mode.mar-direct-agent-ready .mar-composer-icon,
  .mar-app.mar-direct-agent-mode.mar-direct-agent-ready .mar-round-action{width:33px!important;height:33px!important;min-width:33px!important}
  .mar-app.mar-direct-agent-mode.mar-direct-agent-ready .mar-composer-icon svg,
  .mar-app.mar-direct-agent-mode.mar-direct-agent-ready .mar-round-action svg{width:17px!important;height:17px!important}
  .mar-app.mar-direct-agent-mode.mar-direct-agent-ready .mar-camera svg{width:17px!important;height:17px!important;transform:scale(1.10)!important}
  .mar-app.mar-direct-agent-mode.mar-direct-agent-ready .mar-send svg{width:16px!important;height:16px!important;max-width:16px!important;max-height:16px!important}
}


/* ================================================================
   Mega Rê v2.6.0 — experiência aprovada do link exclusivo
   Sidebar: Nova conversa + Fixados + Recentes + Configurações + Usuário.
   Conversa: margens responsivas, resposta limpa, ações discretas, claro/escuro.
   ================================================================ */
.mar-app.mar-direct-agent-mode.mar-direct-agent-ready{--mar-direct-font-scale:1;}
.mar-app.mar-direct-agent-mode.mar-direct-agent-ready[data-direct-font="small"]{--mar-direct-font-scale:.88}
.mar-app.mar-direct-agent-mode.mar-direct-agent-ready[data-direct-font="large"]{--mar-direct-font-scale:1.16}

.mar-app.mar-direct-agent-mode.mar-direct-agent-ready[data-theme="dark"]{background:var(--mar-bg,#000)!important;color:#fff!important}
.mar-app.mar-direct-agent-mode.mar-direct-agent-ready[data-theme="dark"]>.mar-topbar,
.mar-app.mar-direct-agent-mode.mar-direct-agent-ready[data-theme="dark"]>.mar-main,
.mar-app.mar-direct-agent-mode.mar-direct-agent-ready[data-theme="dark"]>.mar-main>.mar-content,
.mar-app.mar-direct-agent-mode.mar-direct-agent-ready[data-theme="dark"]>.mar-main>.mar-composer-area{background:var(--mar-bg,#000)!important;color:#fff!important}
.mar-app.mar-direct-agent-mode.mar-direct-agent-ready[data-theme="dark"]>.mar-sidebar{background:var(--mar-sidebar,#0d0d0f)!important;color:#fff!important}
.mar-app.mar-direct-agent-mode.mar-direct-agent-ready[data-theme="light"]{background:#f6f6f8!important;color:#181820!important}
.mar-app.mar-direct-agent-mode.mar-direct-agent-ready[data-theme="light"]>.mar-topbar,
.mar-app.mar-direct-agent-mode.mar-direct-agent-ready[data-theme="light"]>.mar-main,
.mar-app.mar-direct-agent-mode.mar-direct-agent-ready[data-theme="light"]>.mar-main>.mar-content,
.mar-app.mar-direct-agent-mode.mar-direct-agent-ready[data-theme="light"]>.mar-main>.mar-composer-area{background:#f6f6f8!important;color:#181820!important}
.mar-app.mar-direct-agent-mode.mar-direct-agent-ready[data-theme="light"]>.mar-sidebar{background:#f0f0f3!important;color:#181820!important;border-color:#d9d9df!important}
.mar-app.mar-direct-agent-mode.mar-direct-agent-ready[data-theme="light"]>.mar-topbar{border-color:#d9d9df!important}
.mar-app.mar-direct-agent-mode.mar-direct-agent-ready[data-theme="light"] .mar-agent-name,
.mar-app.mar-direct-agent-mode.mar-direct-agent-ready[data-theme="light"] .mar-profile,
.mar-app.mar-direct-agent-mode.mar-direct-agent-ready[data-theme="light"] .mar-profile-copy strong,
.mar-app.mar-direct-agent-mode.mar-direct-agent-ready[data-theme="light"] .mar-new-chat,
.mar-app.mar-direct-agent-mode.mar-direct-agent-ready[data-theme="light"] .mar-direct-settings-button,
.mar-app.mar-direct-agent-mode.mar-direct-agent-ready[data-theme="light"] .mar-history-item,
.mar-app.mar-direct-agent-mode.mar-direct-agent-ready[data-theme="light"] .mar-history-copy strong{color:#181820!important}
.mar-app.mar-direct-agent-mode.mar-direct-agent-ready[data-theme="light"] .mar-history-copy small,
.mar-app.mar-direct-agent-mode.mar-direct-agent-ready[data-theme="light"] .mar-direct-history-label,
.mar-app.mar-direct-agent-mode.mar-direct-agent-ready[data-theme="light"] .mar-profile-copy span{color:#70707a!important}

/* Cabeçalho clicável do agente */
.mar-app.mar-direct-agent-mode.mar-direct-agent-ready>.mar-topbar{cursor:pointer!important}

/* Nova conversa sem tarja permanente; ícone + texto */
.mar-app.mar-direct-agent-mode.mar-direct-agent-ready>.mar-sidebar .mar-new-chat{
    margin:0 2px 7px!important;width:calc(100% - 4px)!important;min-height:42px!important;
    padding:0 9px!important;border:0!important;border-radius:10px!important;background:transparent!important;
    color:inherit!important;gap:9px!important;font-size:calc(11px * var(--mar-direct-font-scale))!important;font-weight:800!important;
}
.mar-app.mar-direct-agent-mode.mar-direct-agent-ready>.mar-sidebar .mar-new-chat:hover{background:color-mix(in srgb,currentColor 10%,transparent)!important}
.mar-app.mar-direct-agent-mode.mar-direct-agent-ready .mar-new-chat-icon{display:grid!important;place-items:center!important;width:20px!important;height:20px!important;flex:0 0 20px!important}
.mar-app.mar-direct-agent-mode.mar-direct-agent-ready .mar-new-chat-icon svg{width:18px!important;height:18px!important;fill:none!important;stroke:currentColor!important;stroke-width:1.8!important}

/* Sidebar: grupos fixados/recentes e menu contextual somente sob demanda */
.mar-app.mar-direct-agent-mode.mar-direct-agent-ready>.mar-sidebar .mar-history{display:block!important;overflow:auto!important;flex:1 1 auto!important;padding:0 1px 8px!important;margin:0!important}
.mar-app.mar-direct-agent-mode.mar-direct-agent-ready .mar-direct-history-group{display:grid!important;gap:4px!important}
.mar-app.mar-direct-agent-mode.mar-direct-agent-ready .mar-direct-history-group+.mar-direct-history-group{margin-top:13px!important}
.mar-app.mar-direct-agent-mode.mar-direct-agent-ready .mar-direct-history-label{padding:0 9px 4px!important;color:#91919a!important;font-size:10px!important;font-weight:800!important}
.mar-app.mar-direct-agent-mode.mar-direct-agent-ready .mar-history-row{min-height:45px!important;border-radius:9px!important;padding:0!important;border:1px solid transparent!important}
.mar-app.mar-direct-agent-mode.mar-direct-agent-ready .mar-history-row:hover,
.mar-app.mar-direct-agent-mode.mar-direct-agent-ready .mar-history-row.is-context-open{background:color-mix(in srgb,currentColor 10%,transparent)!important;border-color:color-mix(in srgb,currentColor 12%,transparent)!important}
.mar-app.mar-direct-agent-mode.mar-direct-agent-ready .mar-history-item{min-height:45px!important;padding:8px 9px!important;display:block!important;background:transparent!important;color:inherit!important;text-align:left!important}
.mar-app.mar-direct-agent-mode.mar-direct-agent-ready .mar-history-copy{display:grid!important;gap:3px!important;min-width:0!important}
.mar-app.mar-direct-agent-mode.mar-direct-agent-ready .mar-history-copy strong{font-size:calc(10px * var(--mar-direct-font-scale))!important;color:inherit!important}
.mar-app.mar-direct-agent-mode.mar-direct-agent-ready .mar-history-copy small{font-size:calc(8.5px * var(--mar-direct-font-scale))!important}
.mar-app.mar-direct-agent-mode.mar-direct-agent-ready .mar-history-more,
.mar-app.mar-direct-agent-mode.mar-direct-agent-ready .mar-history-pin,
.mar-app.mar-direct-agent-mode.mar-direct-agent-ready .mar-history-menu{display:none!important}
.mar-direct-history-context{position:fixed!important;z-index:999999!important;min-width:190px!important;padding:8px!important;border:1px solid #3a3a42!important;border-radius:15px!important;background:#2c2c2f!important;color:#fff!important;box-shadow:0 18px 50px rgba(0,0,0,.46)!important}
.mar-direct-history-context[hidden]{display:none!important}
.mar-direct-history-context button{width:100%!important;min-height:54px!important;padding:10px 11px!important;border:0!important;border-radius:10px!important;background:transparent!important;color:inherit!important;display:flex!important;align-items:center!important;gap:13px!important;text-align:left!important;font-size:15px!important;cursor:pointer!important}
.mar-direct-history-context button:hover{background:rgba(255,255,255,.08)!important}
.mar-direct-history-context svg{width:24px!important;height:24px!important;fill:none!important;stroke:currentColor!important;stroke-width:1.8!important}
.mar-app[data-theme="light"]~.mar-direct-history-context,.mar-direct-history-context.mar-light{background:#fff!important;color:#181820!important;border-color:#d9d9df!important}

/* Configurações acima do usuário */
.mar-direct-settings-button{width:calc(100% - 2px)!important;margin:0 1px 3px!important;padding:9px!important;border:0!important;border-radius:9px!important;background:transparent!important;color:inherit!important;display:flex!important;align-items:center!important;gap:8px!important;text-align:left!important;font-size:calc(10px * var(--mar-direct-font-scale))!important;font-weight:800!important;cursor:pointer!important}
.mar-direct-settings-button:hover{background:color-mix(in srgb,currentColor 10%,transparent)!important}
.mar-direct-settings-button svg{width:17px!important;height:17px!important;fill:none!important;stroke:currentColor!important;stroke-width:1.8!important}
.mar-app.mar-direct-agent-mode.mar-direct-agent-ready>.mar-sidebar .mar-profile{margin-top:0!important;color:inherit!important}
.mar-app.mar-direct-agent-mode.mar-direct-agent-ready>.mar-sidebar .mar-profile-copy strong{font-size:calc(10px * var(--mar-direct-font-scale))!important;color:inherit!important}
.mar-app.mar-direct-agent-mode.mar-direct-agent-ready>.mar-sidebar .mar-profile-copy span{font-size:calc(8.5px * var(--mar-direct-font-scale))!important}

/* Tela Configurações */
.mar-app.mar-direct-agent-mode.mar-direct-agent-ready #marDirectSettingsView{align-items:flex-start!important;padding-top:14px!important}
.mar-direct-settings-card{width:min(760px,calc(100% - 34px))!important;margin:0 auto!important;padding:20px!important;border:1px solid #303038!important;border-radius:19px!important;background:#19191f!important;color:#fff!important}
.mar-direct-settings-card h2{margin:0 0 20px!important;font-size:22px!important;line-height:1.2!important}
.mar-direct-setting-row{display:grid!important;grid-template-columns:minmax(0,1fr) auto!important;align-items:center!important;gap:15px!important;padding:18px 0!important;border-top:1px solid #303038!important}
.mar-direct-setting-row:first-of-type{border-top:0!important}
.mar-direct-setting-row strong{display:block!important;font-size:14px!important}.mar-direct-setting-row span{display:block!important;margin-top:5px!important;color:#aaaab5!important;font-size:11px!important;line-height:1.45!important}
.mar-direct-segmented{display:flex!important;gap:8px!important;flex-wrap:wrap!important;justify-content:flex-end!important}
.mar-direct-segmented button{min-height:40px!important;padding:0 13px!important;border:1px solid #3a3a42!important;border-radius:11px!important;background:#000!important;color:#fff!important;font-size:11px!important;cursor:pointer!important}
.mar-direct-segmented button.is-active{background:var(--mar-agent-active-bg,#3C2365)!important;border-color:var(--mar-agent-active-bg,#3C2365)!important;color:#fff!important}
.mar-app.mar-direct-agent-mode.mar-direct-agent-ready[data-theme="light"] .mar-direct-settings-card{background:#fff!important;color:#181820!important;border-color:#d9d9df!important}
.mar-app.mar-direct-agent-mode.mar-direct-agent-ready[data-theme="light"] .mar-direct-setting-row{border-color:#e2e2e7!important}
.mar-app.mar-direct-agent-mode.mar-direct-agent-ready[data-theme="light"] .mar-direct-setting-row span{color:#70707a!important}
.mar-app.mar-direct-agent-mode.mar-direct-agent-ready[data-theme="light"] .mar-direct-segmented button{background:#f6f6f8!important;color:#181820!important;border-color:#d9d9df!important}
.mar-app.mar-direct-agent-mode.mar-direct-agent-ready[data-theme="light"] .mar-direct-segmented button.is-active{background:var(--mar-agent-active-bg,#3C2365)!important;color:#fff!important;border-color:var(--mar-agent-active-bg,#3C2365)!important}
.mar-direct-mobile-back{display:none!important}

/* Memória enxuta no modo agente */
.mar-app.mar-direct-agent-mode.mar-direct-agent-ready #marMemoryView .mar-memory-toolbar,
.mar-app.mar-direct-agent-mode.mar-direct-agent-ready #marMemoryView .mar-memory-note,
.mar-app.mar-direct-agent-mode.mar-direct-agent-ready #marMemoryView .mar-memory-summary-actions{display:none!important}
.mar-app.mar-direct-agent-mode.mar-direct-agent-ready #marMemoryView .mar-section-head,
.mar-app.mar-direct-agent-mode.mar-direct-agent-ready #marMemoryView .mar-memory-summary-card,
.mar-app.mar-direct-agent-mode.mar-direct-agent-ready #marMemoryView .mar-memory-groups{width:min(760px,calc(100% - 34px))!important;margin-left:auto!important;margin-right:auto!important}

/* Conversa com respiro lateral no estilo de app de chat */
.mar-app.mar-direct-agent-mode.mar-direct-agent-ready .mar-messages{width:min(780px,calc(100% - 34px))!important;margin:0 auto!important;padding:8px 0 16px!important}
.mar-app.mar-direct-agent-mode.mar-direct-agent-ready .mar-message{width:100%!important}
.mar-app.mar-direct-agent-mode.mar-direct-agent-ready .mar-message.is-user{justify-content:flex-end!important}
.mar-app.mar-direct-agent-mode.mar-direct-agent-ready .mar-message.is-user .mar-bubble{max-width:min(72%,620px)!important;padding:12px 15px!important;border:0!important;border-radius:19px!important;background:#25262c!important;color:#fff!important;line-height:1.55!important;font-size:calc(12px * var(--mar-direct-font-scale))!important}
.mar-app.mar-direct-agent-mode.mar-direct-agent-ready .mar-message.is-agent{display:block!important;margin:10px 0 20px!important}
.mar-app.mar-direct-agent-mode.mar-direct-agent-ready .mar-message.is-agent .mar-bubble{width:100%!important;max-width:none!important;padding:0!important;border:0!important;border-radius:0!important;background:transparent!important;color:inherit!important;box-shadow:none!important;font-size:calc(13px * var(--mar-direct-font-scale))!important;line-height:1.72!important}
.mar-app.mar-direct-agent-mode.mar-direct-agent-ready .mar-rich-response p{margin:0 0 14px!important}.mar-app.mar-direct-agent-mode.mar-direct-agent-ready .mar-rich-response p:last-child{margin-bottom:0!important}
.mar-app.mar-direct-agent-mode.mar-direct-agent-ready .mar-rich-response ul{margin:0 0 14px 20px!important;padding:0!important}.mar-app.mar-direct-agent-mode.mar-direct-agent-ready .mar-rich-response li{margin:5px 0!important}
.mar-app.mar-direct-agent-mode.mar-direct-agent-ready[data-theme="light"] .mar-message.is-user .mar-bubble{background:#e9e9ee!important;color:#181820!important}
.mar-direct-message-actions{display:flex!important;align-items:center!important;gap:14px!important;flex-wrap:wrap!important;margin-top:9px!important;color:#9b9ba4!important}
.mar-direct-message-actions button{padding:3px 0!important;border:0!important;background:transparent!important;color:inherit!important;display:inline-flex!important;align-items:center!important;gap:5px!important;font-size:calc(9px * var(--mar-direct-font-scale))!important;cursor:pointer!important}
.mar-direct-message-actions button:hover,.mar-direct-message-actions button.is-speaking{color:inherit!important;opacity:.72!important}
.mar-direct-message-actions svg{width:15px!important;height:15px!important;fill:none!important;stroke:currentColor!important;stroke-width:1.8!important}
.mar-direct-feedback-thanks{margin-top:6px!important;color:#9b9ba4!important;font-size:9px!important}

/* Composer + gravação */
.mar-app.mar-direct-agent-mode.mar-direct-agent-ready .mar-composer{background:#24252b!important}
.mar-app.mar-direct-agent-mode.mar-direct-agent-ready[data-theme="light"] .mar-composer{background:#e9e9ee!important;color:#181820!important}
.mar-app.mar-direct-agent-mode.mar-direct-agent-ready[data-theme="light"] .mar-composer textarea{color:#181820!important}
.mar-app.mar-direct-agent-mode.mar-direct-agent-ready[data-theme="light"] .mar-composer textarea::placeholder{color:#70707a!important}
.mar-app.mar-direct-agent-mode.mar-direct-agent-ready .mar-camera svg{width:20px!important;height:20px!important;transform:none!important}
.mar-app.mar-direct-agent-mode.mar-direct-agent-ready .mar-record-pause{font-size:9px!important;min-width:auto!important;padding:0 9px!important}
.mar-app.mar-direct-agent-mode.mar-direct-agent-ready .mar-record-pause span:first-child{font-size:9px!important}
.mar-app.mar-direct-agent-mode.mar-direct-agent-ready .mar-record-finish svg{width:15px!important;height:15px!important;transform:none!important;margin:auto!important}
.mar-app.mar-direct-agent-mode.mar-direct-agent-ready .mar-record-finish{display:grid!important;place-items:center!important;background:var(--mar-agent-active-bg,#3C2365)!important;color:#fff!important;border-radius:50%!important;width:38px!important;height:38px!important;min-width:38px!important;padding:0!important}
.mar-app.mar-direct-agent-mode.mar-direct-agent-ready .mar-record-delete{color:inherit!important}
.mar-app.mar-direct-agent-mode.mar-direct-agent-ready .mar-waveform span{background:currentColor!important;opacity:.55!important}

@media(max-width:860px){
  .mar-app.mar-direct-agent-mode.mar-direct-agent-ready>.mar-sidebar{width:min(330px,86vw)!important}
  .mar-app.mar-direct-agent-mode.mar-direct-agent-ready .mar-messages{width:calc(100% - 34px)!important;padding-top:8px!important}
  .mar-app.mar-direct-agent-mode.mar-direct-agent-ready .mar-message.is-user .mar-bubble{max-width:84%!important;font-size:calc(11px * var(--mar-direct-font-scale))!important}
  .mar-app.mar-direct-agent-mode.mar-direct-agent-ready .mar-message.is-agent .mar-bubble{font-size:calc(12px * var(--mar-direct-font-scale))!important}
  .mar-app.mar-direct-agent-mode.mar-direct-agent-ready .mar-direct-message-actions{gap:11px!important}
  .mar-direct-settings-card{width:calc(100% - 24px)!important;margin:0 12px!important;padding:18px 16px!important;border-radius:18px!important}
  .mar-direct-settings-card h2{margin-top:10px!important;margin-bottom:18px!important;font-size:21px!important}
  .mar-direct-setting-row{grid-template-columns:1fr!important;gap:10px!important;padding:16px 0!important}
  .mar-direct-segmented{justify-content:flex-start!important}
  .mar-direct-mobile-back{display:inline-flex!important;align-items:center!important;gap:7px!important;margin:4px 12px 0!important;padding:8px 4px!important;border:0!important;background:transparent!important;color:inherit!important;font-size:12px!important;font-weight:800!important;cursor:pointer!important}
  .mar-direct-mobile-back span:first-child{font-size:20px!important;line-height:1!important}
  .mar-app.mar-direct-agent-mode.mar-direct-agent-ready #marDirectSettingsView{padding-top:4px!important}
  .mar-app.mar-direct-agent-mode.mar-direct-agent-ready #marMemoryView .mar-section-head,
  .mar-app.mar-direct-agent-mode.mar-direct-agent-ready #marMemoryView .mar-memory-summary-card,
  .mar-app.mar-direct-agent-mode.mar-direct-agent-ready #marMemoryView .mar-memory-groups{width:calc(100% - 24px)!important;margin-left:12px!important;margin-right:12px!important}
  .mar-app.mar-direct-agent-mode.mar-direct-agent-ready .mar-record-finish{width:35px!important;height:35px!important;min-width:35px!important}
  .mar-app.mar-direct-agent-mode.mar-direct-agent-ready .mar-record-finish svg{width:14px!important;height:14px!important}
}

.mar-direct-history-context [data-direct-history-action="pin"] svg{stroke:var(--mar-menu-pin-color,#3C2365)!important}
.mar-direct-history-context.mar-light{background:#fff!important;color:#181820!important;border-color:#d9d9df!important}
.mar-direct-history-context.mar-light button:hover{background:#f0f0f3!important}

/* ================================================================
   Mega Rê v2.6.7 — preview aprovado
   Contraste claro/escuro, fonte por login, saudação sutil,
   edição da mensagem do usuário e pré-visualização de até 10 arquivos.
   ================================================================ */

/* Escala aprovada: Pequena = base, Média = +50%, Grande = 100% maior que a Média. */
.mar-app.mar-direct-agent-mode.mar-direct-agent-ready{--mar-direct-font-scale:1;--mar-direct-text:#F4F0F8;--mar-direct-muted:#B8AEC6}
.mar-app.mar-direct-agent-mode.mar-direct-agent-ready[data-direct-font="small"]{--mar-direct-font-scale:1}
.mar-app.mar-direct-agent-mode.mar-direct-agent-ready[data-direct-font="medium"]{--mar-direct-font-scale:1.5}
.mar-app.mar-direct-agent-mode.mar-direct-agent-ready[data-direct-font="large"]{--mar-direct-font-scale:3}

/* Visor escuro: preto total + branco levemente puxado para o lilás. */
.mar-app.mar-direct-agent-mode.mar-direct-agent-ready[data-theme="dark"]{
  --mar-bg:#000000!important;
  --mar-sidebar:#0d0d0f!important;
  --mar-surface:#19191f!important;
  --mar-surface-2:#24252b!important;
  --mar-border:#2c2c33!important;
  --mar-text:#F4F0F8!important;
  --mar-muted:#B8AEC6!important;
  --mar-direct-text:#F4F0F8;
  --mar-direct-muted:#B8AEC6;
  color:var(--mar-direct-text)!important;
}

/* Visor claro: branco com uma pitada de lilás + textos roxos. */
.mar-app.mar-direct-agent-mode.mar-direct-agent-ready[data-theme="light"]{
  --mar-bg:#F7F4FA!important;
  --mar-sidebar:#F3EFF7!important;
  --mar-surface:#FFFFFF!important;
  --mar-surface-2:#F0EBF5!important;
  --mar-border:#DDD4E8!important;
  --mar-text:#3C2365!important;
  --mar-muted:#6F5A8A!important;
  --mar-direct-text:#3C2365;
  --mar-direct-muted:#6F5A8A;
  background:#F7F4FA!important;
  color:#3C2365!important;
}
.mar-app.mar-direct-agent-mode.mar-direct-agent-ready[data-theme="light"]>.mar-main,
.mar-app.mar-direct-agent-mode.mar-direct-agent-ready[data-theme="light"]>.mar-main>.mar-content,
.mar-app.mar-direct-agent-mode.mar-direct-agent-ready[data-theme="light"]>.mar-main>.mar-composer-area,
.mar-app.mar-direct-agent-mode.mar-direct-agent-ready[data-theme="light"]>.mar-topbar{background:#F7F4FA!important;color:#3C2365!important;border-color:#DDD4E8!important}
.mar-app.mar-direct-agent-mode.mar-direct-agent-ready[data-theme="light"]>.mar-sidebar{background:#F3EFF7!important;color:#3C2365!important;border-color:#DDD4E8!important}

/* Textos e ícones acompanham o visor. Botões ativos preservam texto branco. */
.mar-app.mar-direct-agent-mode.mar-direct-agent-ready .mar-agent-name,
.mar-app.mar-direct-agent-mode.mar-direct-agent-ready .mar-new-chat,
.mar-app.mar-direct-agent-mode.mar-direct-agent-ready .mar-direct-settings-button,
.mar-app.mar-direct-agent-mode.mar-direct-agent-ready .mar-history-item,
.mar-app.mar-direct-agent-mode.mar-direct-agent-ready .mar-history-copy strong,
.mar-app.mar-direct-agent-mode.mar-direct-agent-ready .mar-profile,
.mar-app.mar-direct-agent-mode.mar-direct-agent-ready .mar-profile-copy strong,
.mar-app.mar-direct-agent-mode.mar-direct-agent-ready .mar-direct-mobile-back,
.mar-app.mar-direct-agent-mode.mar-direct-agent-ready .mar-direct-settings-card,
.mar-app.mar-direct-agent-mode.mar-direct-agent-ready .mar-direct-setting-row strong,
.mar-app.mar-direct-agent-mode.mar-direct-agent-ready .mar-message.is-agent .mar-bubble,
.mar-app.mar-direct-agent-mode.mar-direct-agent-ready .mar-direct-user-message-actions button,
.mar-app.mar-direct-agent-mode.mar-direct-agent-ready .mar-direct-message-actions button,
.mar-app.mar-direct-agent-mode.mar-direct-agent-ready .mar-composer textarea,
.mar-app.mar-direct-agent-mode.mar-direct-agent-ready .mar-composer-icon,
.mar-app.mar-direct-agent-mode.mar-direct-agent-ready .mar-record-time,
.mar-app.mar-direct-agent-mode.mar-direct-agent-ready .mar-record-pause,
.mar-app.mar-direct-agent-mode.mar-direct-agent-ready .mar-file-preview-dialog,
.mar-app.mar-direct-agent-mode.mar-direct-agent-ready .mar-attachment-tray{color:var(--mar-direct-text)!important}

.mar-app.mar-direct-agent-mode.mar-direct-agent-ready .mar-history-copy small,
.mar-app.mar-direct-agent-mode.mar-direct-agent-ready .mar-direct-history-label,
.mar-app.mar-direct-agent-mode.mar-direct-agent-ready .mar-profile-copy span,
.mar-app.mar-direct-agent-mode.mar-direct-agent-ready .mar-direct-setting-row>div>span,
.mar-app.mar-direct-agent-mode.mar-direct-agent-ready .mar-direct-message-actions,
.mar-app.mar-direct-agent-mode.mar-direct-agent-ready .mar-direct-feedback-thanks,
.mar-app.mar-direct-agent-mode.mar-direct-agent-ready .mar-composer-note,
.mar-app.mar-direct-agent-mode.mar-direct-agent-ready .mar-attachment-card small{color:var(--mar-direct-muted)!important}

.mar-app.mar-direct-agent-mode.mar-direct-agent-ready[data-theme="light"] .mar-history-row:hover,
.mar-app.mar-direct-agent-mode.mar-direct-agent-ready[data-theme="light"] .mar-history-row.is-context-open{background:#E9E2F0!important;border-color:#D7CCE3!important}
.mar-app.mar-direct-agent-mode.mar-direct-agent-ready[data-theme="light"] .mar-message.is-user .mar-bubble{background:#E9E2F0!important;color:#3C2365!important}
.mar-app.mar-direct-agent-mode.mar-direct-agent-ready[data-theme="dark"] .mar-message.is-user .mar-bubble{background:#25262c!important;color:#F4F0F8!important}

/* Configurações: Voltar aparece em desktop e celular. */
.mar-direct-mobile-back{
  display:inline-flex!important;align-items:center!important;gap:7px!important;
  width:max-content!important;margin:4px 0 10px!important;padding:7px 4px!important;
  border:0!important;background:transparent!important;color:inherit!important;
  font-size:calc(12px * var(--mar-direct-font-scale))!important;font-weight:800!important;cursor:pointer!important;
}
.mar-direct-mobile-back span:first-child{font-size:calc(20px * var(--mar-direct-font-scale))!important;line-height:1!important}
.mar-app.mar-direct-agent-mode.mar-direct-agent-ready #marDirectSettingsView,
.mar-app.mar-direct-agent-mode.mar-direct-agent-ready #marMemoryView{position:relative!important;z-index:20!important}

/* Fonte afeta todo o layout do agente, não apenas a conversa. */
.mar-app.mar-direct-agent-mode.mar-direct-agent-ready .mar-agent-name{font-size:calc(14px * var(--mar-direct-font-scale))!important}
.mar-app.mar-direct-agent-mode.mar-direct-agent-ready .mar-new-chat{font-size:calc(11px * var(--mar-direct-font-scale))!important}
.mar-app.mar-direct-agent-mode.mar-direct-agent-ready .mar-direct-history-label{font-size:calc(9px * var(--mar-direct-font-scale))!important}
.mar-app.mar-direct-agent-mode.mar-direct-agent-ready .mar-history-copy strong{font-size:calc(10px * var(--mar-direct-font-scale))!important}
.mar-app.mar-direct-agent-mode.mar-direct-agent-ready .mar-history-copy small{font-size:calc(8.5px * var(--mar-direct-font-scale))!important}
.mar-app.mar-direct-agent-mode.mar-direct-agent-ready .mar-direct-settings-button{font-size:calc(10px * var(--mar-direct-font-scale))!important}
.mar-app.mar-direct-agent-mode.mar-direct-agent-ready .mar-profile-copy strong{font-size:calc(10px * var(--mar-direct-font-scale))!important}
.mar-app.mar-direct-agent-mode.mar-direct-agent-ready .mar-profile-copy span{font-size:calc(8.5px * var(--mar-direct-font-scale))!important}
.mar-app.mar-direct-agent-mode.mar-direct-agent-ready .mar-direct-settings-card h2{font-size:calc(22px * var(--mar-direct-font-scale))!important}
.mar-app.mar-direct-agent-mode.mar-direct-agent-ready .mar-direct-setting-row strong{font-size:calc(14px * var(--mar-direct-font-scale))!important}
.mar-app.mar-direct-agent-mode.mar-direct-agent-ready .mar-direct-setting-row>div>span{font-size:calc(11px * var(--mar-direct-font-scale))!important}
.mar-app.mar-direct-agent-mode.mar-direct-agent-ready .mar-direct-segmented button{font-size:calc(11px * var(--mar-direct-font-scale))!important}
.mar-app.mar-direct-agent-mode.mar-direct-agent-ready .mar-message.is-user .mar-bubble{font-size:calc(12px * var(--mar-direct-font-scale))!important}
.mar-app.mar-direct-agent-mode.mar-direct-agent-ready .mar-message.is-agent .mar-bubble{font-size:calc(13px * var(--mar-direct-font-scale))!important}
.mar-app.mar-direct-agent-mode.mar-direct-agent-ready .mar-direct-message-actions button,
.mar-app.mar-direct-agent-mode.mar-direct-agent-ready .mar-direct-user-message-actions button{font-size:calc(9px * var(--mar-direct-font-scale))!important}
.mar-app.mar-direct-agent-mode.mar-direct-agent-ready .mar-composer textarea{font-size:calc(11px * var(--mar-direct-font-scale))!important}
.mar-app.mar-direct-agent-mode.mar-direct-agent-ready .mar-composer-note{font-size:calc(8px * var(--mar-direct-font-scale))!important}
.mar-app.mar-direct-agent-mode.mar-direct-agent-ready .mar-record-time,
.mar-app.mar-direct-agent-mode.mar-direct-agent-ready .mar-record-pause{font-size:calc(9px * var(--mar-direct-font-scale))!important}
.mar-app.mar-direct-agent-mode.mar-direct-agent-ready[data-direct-font="large"] .mar-direct-setting-row{grid-template-columns:1fr!important}
.mar-app.mar-direct-agent-mode.mar-direct-agent-ready[data-direct-font="large"] .mar-direct-segmented{justify-content:flex-start!important}

/* Saudação personalizada: pequena, acolhedora e no fluxo normal do chat. */
.mar-app.mar-direct-agent-mode.mar-direct-agent-ready .mar-welcome-minimal.mar-direct-greeting{
  width:min(780px,calc(100% - 34px))!important;min-height:132px!important;
  margin:0 auto!important;padding:0!important;border:0!important;border-radius:0!important;
  background:transparent!important;box-shadow:none!important;text-align:center!important;
  display:flex!important;align-items:center!important;justify-content:center!important;
}
.mar-app.mar-direct-agent-mode.mar-direct-agent-ready .mar-welcome-minimal.mar-direct-greeting h1{
  display:block!important;margin:0!important;max-width:92%!important;
  color:var(--mar-direct-text)!important;
  font-family:"Segoe Print","Bradley Hand","Lucida Handwriting","Comic Sans MS",cursive!important;
  font-size:calc(15px * var(--mar-direct-font-scale))!important;font-weight:400!important;
  line-height:1.4!important;letter-spacing:.01em!important;text-align:center!important;
  opacity:1!important;transform:none!important;filter:none!important;
}
.mar-app.mar-direct-agent-mode.mar-direct-agent-ready .mar-welcome-minimal.mar-direct-greeting>p,
.mar-app.mar-direct-agent-mode.mar-direct-agent-ready .mar-welcome-minimal.mar-direct-greeting .mar-starter-grid{display:none!important}
.mar-app.mar-direct-agent-mode.mar-direct-agent-ready .mar-welcome-minimal.mar-direct-greeting.is-intro h1{
  animation:marGreetingZoomIn 3s cubic-bezier(.18,.72,.22,1) forwards!important;
}
@keyframes marGreetingZoomIn{
  0%{opacity:0;transform:translateY(16px) scale(.84)}
  45%{opacity:.72;transform:translateY(7px) scale(.93)}
  100%{opacity:1;transform:translateY(0) scale(1)}
}
.mar-app.mar-direct-agent-mode.mar-direct-agent-ready .mar-welcome-minimal.mar-direct-greeting.is-settled h1{opacity:1!important;transform:none!important;animation:none!important}

/* Mensagem do usuário: Editar abaixo do balão. */
.mar-direct-user-message-actions{display:flex!important;justify-content:flex-end!important;margin-top:-8px!important;margin-bottom:4px!important;color:var(--mar-direct-muted)!important}
.mar-direct-user-message-actions button{border:0!important;background:transparent!important;color:inherit!important;padding:4px 1px!important;display:inline-flex!important;align-items:center!important;gap:5px!important;cursor:pointer!important}
.mar-direct-user-message-actions button:hover{color:var(--mar-direct-text)!important}
.mar-direct-user-message-actions button:disabled{opacity:.45!important;cursor:wait!important}
.mar-direct-user-message-actions svg{width:14px!important;height:14px!important;fill:none!important;stroke:currentColor!important;stroke-width:1.8!important}
.mar-direct-message-editor{width:min(620px,84%)!important;margin-left:auto!important;padding:10px!important;border:1px solid var(--mar-border)!important;border-radius:16px!important;background:var(--mar-surface-2)!important}
.mar-direct-message-editor textarea{width:100%!important;min-height:82px!important;resize:vertical!important;border:0!important;outline:0!important;background:transparent!important;color:var(--mar-direct-text)!important;font-size:calc(12px * var(--mar-direct-font-scale))!important;line-height:1.5!important}
.mar-direct-message-editor>div{display:flex!important;justify-content:flex-end!important;gap:7px!important;margin-top:8px!important}
.mar-direct-message-editor button{border:1px solid var(--mar-border)!important;background:var(--mar-bg)!important;color:var(--mar-direct-text)!important;border-radius:9px!important;padding:7px 10px!important;font-size:calc(9px * var(--mar-direct-font-scale))!important;cursor:pointer!important}
.mar-direct-message-editor button.is-primary{background:var(--mar-agent-active-bg,#3C2365)!important;border-color:var(--mar-agent-active-bg,#3C2365)!important;color:#fff!important}

/* Anexos: até 10, com pré-visualização antes do envio definitivo. */
.mar-attachment-tray{padding:10px 11px 3px!important;border-bottom:1px solid var(--mar-border)!important;background:transparent!important}
.mar-attachment-tray[hidden]{display:none!important}
.mar-attachment-tray-head{display:flex!important;align-items:center!important;justify-content:space-between!important;gap:10px!important;margin-bottom:8px!important}
.mar-attachment-tray-head strong{font-size:calc(10px * var(--mar-direct-font-scale))!important}
.mar-attachment-tray-head span{font-size:calc(8.5px * var(--mar-direct-font-scale))!important;color:var(--mar-direct-muted)!important}
.mar-attachment-grid{display:grid!important;grid-template-columns:repeat(auto-fit,minmax(135px,1fr))!important;gap:8px!important;max-height:205px!important;overflow:auto!important;padding-bottom:7px!important}
.mar-attachment-card{min-width:0!important;padding:8px!important;border:1px solid var(--mar-border)!important;border-radius:12px!important;background:var(--mar-bg)!important}
.mar-attachment-thumb{height:74px!important;border-radius:9px!important;background:var(--mar-surface-2)!important;display:grid!important;place-items:center!important;overflow:hidden!important;color:var(--mar-direct-muted)!important}
.mar-attachment-thumb img{width:100%!important;height:100%!important;object-fit:cover!important}
.mar-attachment-kind{font-size:calc(9px * var(--mar-direct-font-scale))!important;font-weight:800!important}
.mar-attachment-card>strong{display:block!important;margin-top:7px!important;font-size:calc(9px * var(--mar-direct-font-scale))!important;white-space:nowrap!important;overflow:hidden!important;text-overflow:ellipsis!important}
.mar-attachment-card>small{display:block!important;margin-top:2px!important;font-size:calc(7.5px * var(--mar-direct-font-scale))!important}
.mar-attachment-actions{display:flex!important;gap:5px!important;margin-top:7px!important}
.mar-attachment-actions button{border:1px solid var(--mar-border)!important;background:transparent!important;color:var(--mar-direct-text)!important;border-radius:8px!important;padding:6px!important;font-size:calc(8px * var(--mar-direct-font-scale))!important;cursor:pointer!important}
.mar-attachment-actions button:first-child{flex:1!important}.mar-attachment-actions button:last-child{width:30px!important}
.mar-file-preview-modal{position:fixed!important;inset:0!important;z-index:99999!important;background:rgba(0,0,0,.76)!important;display:flex!important;align-items:center!important;justify-content:center!important;padding:18px!important}
.mar-file-preview-modal[hidden]{display:none!important}
.mar-file-preview-dialog{width:min(860px,94vw)!important;max-height:88vh!important;border:1px solid var(--mar-border)!important;border-radius:16px!important;background:var(--mar-surface)!important;color:var(--mar-direct-text)!important;overflow:hidden!important;display:flex!important;flex-direction:column!important;box-shadow:0 24px 70px rgba(0,0,0,.42)!important}
.mar-file-preview-head{display:flex!important;align-items:center!important;justify-content:space-between!important;gap:10px!important;padding:10px 12px!important;border-bottom:1px solid var(--mar-border)!important}
.mar-file-preview-head strong{font-size:calc(10px * var(--mar-direct-font-scale))!important;white-space:nowrap!important;overflow:hidden!important;text-overflow:ellipsis!important}
.mar-file-preview-head button{border:0!important;background:transparent!important;color:inherit!important;font-size:22px!important;cursor:pointer!important}
.mar-file-preview-body{min-height:240px!important;padding:12px!important;overflow:auto!important;display:grid!important;place-items:center!important}
.mar-file-preview-body img{max-width:100%!important;max-height:70vh!important;border-radius:10px!important}
.mar-file-preview-body iframe{width:100%!important;height:68vh!important;border:0!important;background:#fff!important;border-radius:10px!important}
.mar-file-preview-generic{display:grid!important;gap:8px!important;text-align:center!important;color:var(--mar-direct-muted)!important;font-size:calc(10px * var(--mar-direct-font-scale))!important;line-height:1.55!important}

/* Menu Fixar/Renomear acompanha o tema e mantém a cor personalizada do alfinete. */
.mar-direct-history-context{background:#1f1f23!important;color:#F4F0F8!important;border-color:#38383f!important}
.mar-direct-history-context.mar-light{background:#FFFFFF!important;color:#3C2365!important;border-color:#DDD4E8!important}
.mar-direct-history-context button{color:inherit!important}
.mar-direct-history-context.mar-light button:hover{background:#F0EBF5!important}

/* Layout mobile */
@media(max-width:860px){
  .mar-app.mar-direct-agent-mode.mar-direct-agent-ready .mar-welcome-minimal.mar-direct-greeting{width:calc(100% - 34px)!important;min-height:118px!important}
  .mar-app.mar-direct-agent-mode.mar-direct-agent-ready .mar-welcome-minimal.mar-direct-greeting h1{font-size:calc(13px * var(--mar-direct-font-scale))!important;max-width:94%!important}
  .mar-app.mar-direct-agent-mode.mar-direct-agent-ready .mar-direct-settings-view,
  .mar-app.mar-direct-agent-mode.mar-direct-agent-ready #marMemoryView{z-index:75!important;background:var(--mar-bg)!important}
  .mar-app.mar-direct-agent-mode.mar-direct-agent-ready .mar-direct-mobile-back{margin:4px 12px 4px!important;padding:8px 4px!important}
  .mar-attachment-grid{grid-template-columns:repeat(2,minmax(0,1fr))!important;max-height:180px!important}
  .mar-attachment-thumb{height:68px!important}
  .mar-direct-message-editor{width:88%!important}
}

/* v2.6.7 — acabamento das preferências em todas as telas do link exclusivo. */
.mar-app.mar-direct-agent-mode.mar-direct-agent-ready .mar-direct-user-popover>strong{font-size:calc(11px * var(--mar-direct-font-scale))!important;color:var(--mar-direct-text)!important}
.mar-app.mar-direct-agent-mode.mar-direct-agent-ready .mar-direct-user-popover>span,
.mar-app.mar-direct-agent-mode.mar-direct-agent-ready .mar-direct-user-popover small{font-size:calc(8.5px * var(--mar-direct-font-scale))!important;color:var(--mar-direct-muted)!important}
.mar-app.mar-direct-agent-mode.mar-direct-agent-ready .mar-direct-user-popover input{font-size:calc(10px * var(--mar-direct-font-scale))!important}
.mar-app.mar-direct-agent-mode.mar-direct-agent-ready .mar-direct-user-popover button{font-size:calc(9px * var(--mar-direct-font-scale))!important}
.mar-app.mar-direct-agent-mode.mar-direct-agent-ready[data-theme="light"] .mar-direct-user-popover{background:#FFFFFF!important;color:#3C2365!important;border-color:#DDD4E8!important}
.mar-app.mar-direct-agent-mode.mar-direct-agent-ready[data-theme="light"] .mar-direct-user-popover input{background:#F7F4FA!important;color:#3C2365!important;border-color:#DDD4E8!important}

.mar-app.mar-direct-agent-mode.mar-direct-agent-ready #marMemoryView .mar-memory-summary-card h3,
.mar-app.mar-direct-agent-mode.mar-direct-agent-ready #marMemoryView .mar-memory-group h3{font-size:calc(16px * var(--mar-direct-font-scale))!important;color:var(--mar-direct-text)!important}
.mar-app.mar-direct-agent-mode.mar-direct-agent-ready #marMemoryView #marMemorySummary,
.mar-app.mar-direct-agent-mode.mar-direct-agent-ready #marMemoryView .mar-memory-item-copy strong{font-size:calc(12px * var(--mar-direct-font-scale))!important;color:var(--mar-direct-text)!important}
.mar-app.mar-direct-agent-mode.mar-direct-agent-ready #marMemoryView .mar-memory-item-copy p,
.mar-app.mar-direct-agent-mode.mar-direct-agent-ready #marMemoryView .mar-memory-dates,
.mar-app.mar-direct-agent-mode.mar-direct-agent-ready #marMemoryView .mar-memory-cycle span{font-size:calc(10px * var(--mar-direct-font-scale))!important;color:var(--mar-direct-muted)!important}
.mar-app.mar-direct-agent-mode.mar-direct-agent-ready #marMemoryView .mar-small-button{font-size:calc(9px * var(--mar-direct-font-scale))!important}
.mar-app.mar-direct-agent-mode.mar-direct-agent-ready[data-theme="light"] #marMemoryView .mar-memory-summary-card,
.mar-app.mar-direct-agent-mode.mar-direct-agent-ready[data-theme="light"] #marMemoryView .mar-memory-group{background:#FFFFFF!important;border-color:#DDD4E8!important;color:#3C2365!important}

.mar-direct-history-context button{font-size:calc(14px * var(--mar-direct-font-scale,1))!important}
.mar-direct-history-context svg{width:23px!important;height:23px!important}


/* ================================================================
   Mega Rê 2.6.9 — correções finais aprovadas
   - menu da mensagem do usuário em pop-up (Copiar/Editar)
   - contraste claro/escuro consistente
   - gravação limpa: onda + enviar
   - anexos compactos, clicáveis para visualizar, sem rótulo extra
   ================================================================ */

/* Tema claro: toda informação textual do link exclusivo usa o roxo oficial. */
.mar-app.mar-direct-agent-mode.mar-direct-agent-ready[data-theme="light"]{
  --mar-direct-text:#3C2365!important;
  --mar-direct-muted:#6F5A8A!important;
  --mar-text:#3C2365!important;
  --mar-muted:#6F5A8A!important;
  color:#3C2365!important;
}
.mar-app.mar-direct-agent-mode.mar-direct-agent-ready[data-theme="light"]>.mar-topbar,
.mar-app.mar-direct-agent-mode.mar-direct-agent-ready[data-theme="light"]>.mar-main,
.mar-app.mar-direct-agent-mode.mar-direct-agent-ready[data-theme="light"]>.mar-main>.mar-content,
.mar-app.mar-direct-agent-mode.mar-direct-agent-ready[data-theme="light"]>.mar-main>.mar-composer-area{
  background:#F7F4FA!important;color:#3C2365!important;border-color:#DDD4E8!important;
}
.mar-app.mar-direct-agent-mode.mar-direct-agent-ready[data-theme="light"]>.mar-sidebar{
  background:#F3EFF7!important;color:#3C2365!important;border-color:#DDD4E8!important;
}
.mar-app.mar-direct-agent-mode.mar-direct-agent-ready[data-theme="light"]>.mar-topbar .mar-agent-name,
.mar-app.mar-direct-agent-mode.mar-direct-agent-ready[data-theme="light"]>.mar-topbar .mar-open-mobile,
.mar-app.mar-direct-agent-mode.mar-direct-agent-ready[data-theme="light"]>.mar-topbar svg,
.mar-app.mar-direct-agent-mode.mar-direct-agent-ready[data-theme="light"]>.mar-sidebar .mar-new-chat,
.mar-app.mar-direct-agent-mode.mar-direct-agent-ready[data-theme="light"]>.mar-sidebar .mar-new-chat svg,
.mar-app.mar-direct-agent-mode.mar-direct-agent-ready[data-theme="light"]>.mar-sidebar .mar-direct-history-label,
.mar-app.mar-direct-agent-mode.mar-direct-agent-ready[data-theme="light"]>.mar-sidebar .mar-history-item,
.mar-app.mar-direct-agent-mode.mar-direct-agent-ready[data-theme="light"]>.mar-sidebar .mar-history-copy strong,
.mar-app.mar-direct-agent-mode.mar-direct-agent-ready[data-theme="light"]>.mar-sidebar .mar-direct-settings-button,
.mar-app.mar-direct-agent-mode.mar-direct-agent-ready[data-theme="light"]>.mar-sidebar .mar-direct-settings-button svg,
.mar-app.mar-direct-agent-mode.mar-direct-agent-ready[data-theme="light"]>.mar-sidebar .mar-profile,
.mar-app.mar-direct-agent-mode.mar-direct-agent-ready[data-theme="light"]>.mar-sidebar .mar-profile-copy strong,
.mar-app.mar-direct-agent-mode.mar-direct-agent-ready[data-theme="light"] .mar-welcome-minimal h1,
.mar-app.mar-direct-agent-mode.mar-direct-agent-ready[data-theme="light"] .mar-message.is-user .mar-bubble,
.mar-app.mar-direct-agent-mode.mar-direct-agent-ready[data-theme="light"] .mar-message.is-agent .mar-bubble,
.mar-app.mar-direct-agent-mode.mar-direct-agent-ready[data-theme="light"] .mar-direct-message-actions button,
.mar-app.mar-direct-agent-mode.mar-direct-agent-ready[data-theme="light"] .mar-direct-mobile-back,
.mar-app.mar-direct-agent-mode.mar-direct-agent-ready[data-theme="light"] .mar-direct-settings-card,
.mar-app.mar-direct-agent-mode.mar-direct-agent-ready[data-theme="light"] .mar-direct-setting-row strong,
.mar-app.mar-direct-agent-mode.mar-direct-agent-ready[data-theme="light"] .mar-direct-setting-row button,
.mar-app.mar-direct-agent-mode.mar-direct-agent-ready[data-theme="light"] .mar-composer textarea,
.mar-app.mar-direct-agent-mode.mar-direct-agent-ready[data-theme="light"] .mar-composer-icon,
.mar-app.mar-direct-agent-mode.mar-direct-agent-ready[data-theme="light"] .mar-composer-note{
  color:#3C2365!important;
}
.mar-app.mar-direct-agent-mode.mar-direct-agent-ready[data-theme="light"] .mar-history-copy small,
.mar-app.mar-direct-agent-mode.mar-direct-agent-ready[data-theme="light"] .mar-profile-copy span,
.mar-app.mar-direct-agent-mode.mar-direct-agent-ready[data-theme="light"] .mar-direct-setting-row>div>span,
.mar-app.mar-direct-agent-mode.mar-direct-agent-ready[data-theme="light"] .mar-composer-note{
  color:#6F5A8A!important;
}
.mar-app.mar-direct-agent-mode.mar-direct-agent-ready[data-theme="light"] .mar-composer{
  background:#F0EBF5!important;border-color:#DDD4E8!important;
}
.mar-app.mar-direct-agent-mode.mar-direct-agent-ready[data-theme="light"] .mar-composer textarea::placeholder{color:#6F5A8A!important}

/* Tema escuro: branco suavemente puxado ao lilás. */
.mar-app.mar-direct-agent-mode.mar-direct-agent-ready[data-theme="dark"]{
  --mar-direct-text:#F4F0F8!important;--mar-direct-muted:#B8AEC6!important;--mar-text:#F4F0F8!important;--mar-muted:#B8AEC6!important;color:#F4F0F8!important;
}
.mar-app.mar-direct-agent-mode.mar-direct-agent-ready[data-theme="dark"]>.mar-topbar .mar-agent-name,
.mar-app.mar-direct-agent-mode.mar-direct-agent-ready[data-theme="dark"]>.mar-topbar .mar-open-mobile,
.mar-app.mar-direct-agent-mode.mar-direct-agent-ready[data-theme="dark"]>.mar-sidebar .mar-new-chat,
.mar-app.mar-direct-agent-mode.mar-direct-agent-ready[data-theme="dark"]>.mar-sidebar .mar-direct-settings-button,
.mar-app.mar-direct-agent-mode.mar-direct-agent-ready[data-theme="dark"]>.mar-sidebar .mar-history-item,
.mar-app.mar-direct-agent-mode.mar-direct-agent-ready[data-theme="dark"] .mar-welcome-minimal h1,
.mar-app.mar-direct-agent-mode.mar-direct-agent-ready[data-theme="dark"] .mar-message .mar-bubble{
  color:#F4F0F8!important;
}

/* Mensagem do usuário: sem botão fixo. O toque abre apenas Copiar / Editar. */
.mar-direct-user-message-actions{display:none!important}
.mar-direct-user-message-menu{
  position:fixed!important;z-index:100000!important;min-width:168px!important;padding:7px!important;
  border:1px solid #38383f!important;border-radius:15px!important;background:#1F1F23!important;color:#F4F0F8!important;
  box-shadow:0 18px 50px rgba(0,0,0,.42)!important;
}
.mar-direct-user-message-menu[hidden]{display:none!important}
.mar-direct-user-message-menu.mar-light{background:#FFFFFF!important;color:#3C2365!important;border-color:#DDD4E8!important}
.mar-direct-user-message-menu button{
  width:100%!important;display:flex!important;align-items:center!important;gap:11px!important;padding:11px 10px!important;
  border:0!important;border-radius:10px!important;background:transparent!important;color:inherit!important;text-align:left!important;
  font-size:calc(13px * var(--mar-direct-font-scale,1))!important;cursor:pointer!important;
}
.mar-direct-user-message-menu button:hover{background:rgba(127,127,127,.13)!important}
.mar-direct-user-message-menu button:disabled{opacity:.42!important;cursor:wait!important}
.mar-direct-user-message-menu svg{width:21px!important;height:21px!important;fill:none!important;stroke:currentColor!important;stroke-width:1.8!important}
.mar-message.is-user.is-context-open .mar-bubble{outline:1px solid var(--mar-border)!important;box-shadow:0 6px 20px rgba(0,0,0,.12)!important}

/* Gravação: apenas onda de voz + enviar. */
.mar-app.mar-direct-agent-mode.mar-direct-agent-ready .mar-voice-recorder{
  display:flex!important;align-items:center!important;gap:10px!important;width:100%!important;min-height:58px!important;padding:7px 9px 7px 12px!important;
}
.mar-app.mar-direct-agent-mode.mar-direct-agent-ready .mar-voice-recorder[hidden]{display:none!important}
.mar-app.mar-direct-agent-mode.mar-direct-agent-ready .mar-record-delete,
.mar-app.mar-direct-agent-mode.mar-direct-agent-ready .mar-record-time,
.mar-app.mar-direct-agent-mode.mar-direct-agent-ready .mar-record-pause{display:none!important}
.mar-app.mar-direct-agent-mode.mar-direct-agent-ready .mar-waveform{flex:1 1 auto!important;min-width:0!important;height:34px!important;display:flex!important;align-items:center!important;justify-content:center!important;gap:2px!important;overflow:hidden!important}
.mar-app.mar-direct-agent-mode.mar-direct-agent-ready .mar-waveform span{width:2px!important;min-width:2px!important;border-radius:99px!important;background:var(--mar-direct-muted)!important;transition:height .08s linear,opacity .08s linear!important}
.mar-app.mar-direct-agent-mode.mar-direct-agent-ready .mar-record-finish{
  flex:0 0 38px!important;width:38px!important;height:38px!important;display:grid!important;place-items:center!important;padding:0!important;border:0!important;border-radius:50%!important;
  background:var(--mar-agent-active-bg,#3C2365)!important;color:#fff!important;cursor:pointer!important;
}
.mar-app.mar-direct-agent-mode.mar-direct-agent-ready .mar-record-finish svg{width:16px!important;height:16px!important;stroke:currentColor!important;fill:none!important;stroke-width:2!important}

/* Anexos: compactos dentro do compositor, sem texto 'Pré-visualização'. Clicar no cartão abre. */
.mar-app.mar-direct-agent-mode.mar-direct-agent-ready .mar-composer:has(.mar-attachment-tray:not([hidden])){border-radius:24px!important}
.mar-app.mar-direct-agent-mode.mar-direct-agent-ready .mar-attachment-tray{
  padding:10px 10px 2px!important;border:0!important;background:transparent!important;
}
.mar-app.mar-direct-agent-mode.mar-direct-agent-ready .mar-attachment-tray-head{margin:0 2px 7px!important}
.mar-app.mar-direct-agent-mode.mar-direct-agent-ready .mar-attachment-tray-head strong{display:none!important}
.mar-app.mar-direct-agent-mode.mar-direct-agent-ready .mar-attachment-tray-head span{font-size:calc(8px * var(--mar-direct-font-scale))!important;color:var(--mar-direct-muted)!important}
.mar-app.mar-direct-agent-mode.mar-direct-agent-ready .mar-attachment-grid{
  display:flex!important;align-items:flex-start!important;gap:7px!important;max-height:190px!important;overflow:auto!important;padding:0 1px 7px!important;
  scrollbar-width:thin!important;
}
.mar-app.mar-direct-agent-mode.mar-direct-agent-ready .mar-attachment-card{
  position:relative!important;flex:0 0 86px!important;width:86px!important;min-width:86px!important;height:92px!important;padding:0!important;
  border:1px solid var(--mar-border)!important;border-radius:12px!important;background:var(--mar-bg)!important;overflow:hidden!important;cursor:pointer!important;
}
.mar-app.mar-direct-agent-mode.mar-direct-agent-ready .mar-attachment-thumb{width:100%!important;height:68px!important;border-radius:0!important;background:var(--mar-surface-2)!important;display:grid!important;place-items:center!important;overflow:hidden!important}
.mar-app.mar-direct-agent-mode.mar-direct-agent-ready .mar-attachment-thumb img{width:100%!important;height:100%!important;object-fit:cover!important}
.mar-app.mar-direct-agent-mode.mar-direct-agent-ready .mar-attachment-name{display:block!important;padding:5px 6px 0!important;font-size:calc(7.5px * var(--mar-direct-font-scale))!important;color:var(--mar-direct-text)!important;white-space:nowrap!important;overflow:hidden!important;text-overflow:ellipsis!important}
.mar-app.mar-direct-agent-mode.mar-direct-agent-ready .mar-attachment-card>strong,
.mar-app.mar-direct-agent-mode.mar-direct-agent-ready .mar-attachment-card>small,
.mar-app.mar-direct-agent-mode.mar-direct-agent-ready .mar-attachment-actions{display:none!important}
.mar-app.mar-direct-agent-mode.mar-direct-agent-ready .mar-attachment-remove{
  position:absolute!important;top:4px!important;right:4px!important;width:22px!important;height:22px!important;display:grid!important;place-items:center!important;padding:0!important;
  border:0!important;border-radius:50%!important;background:rgba(0,0,0,.66)!important;color:#fff!important;font-size:16px!important;line-height:1!important;cursor:pointer!important;
}

@media(max-width:860px){
  .mar-app.mar-direct-agent-mode.mar-direct-agent-ready .mar-attachment-card{flex-basis:78px!important;width:78px!important;min-width:78px!important;height:86px!important}
  .mar-app.mar-direct-agent-mode.mar-direct-agent-ready .mar-attachment-thumb{height:63px!important}
  .mar-app.mar-direct-agent-mode.mar-direct-agent-ready .mar-voice-recorder{min-height:55px!important;padding:6px 7px 6px 9px!important}
  .mar-app.mar-direct-agent-mode.mar-direct-agent-ready .mar-record-finish{width:35px!important;height:35px!important;flex-basis:35px!important}
}


/* v2.7.0 — correções pontuais solicitadas, sem alterar o restante do layout aprovado. */
/* hidden precisa vencer o display:flex!important do compositor. */
.mar-app.mar-direct-agent-mode.mar-direct-agent-ready .mar-composer-input-row[hidden],
.mar-app.mar-direct-agent-mode.mar-direct-agent-ready .mar-voice-recorder[hidden]{display:none!important}

/* Escuro: Nova conversa sempre clara. Claro: usa o roxo da paleta. */
.mar-app.mar-direct-agent-mode.mar-direct-agent-ready[data-theme="dark"]>.mar-sidebar .mar-new-chat,
.mar-app.mar-direct-agent-mode.mar-direct-agent-ready[data-theme="dark"]>.mar-sidebar .mar-new-chat *{color:#F4F0F8!important;stroke:currentColor!important}
.mar-app.mar-direct-agent-mode.mar-direct-agent-ready[data-theme="light"]>.mar-sidebar .mar-new-chat,
.mar-app.mar-direct-agent-mode.mar-direct-agent-ready[data-theme="light"]>.mar-sidebar .mar-new-chat *{color:#3C2365!important;stroke:currentColor!important}

/* Voz: durante a fala, botão quadrado de parar; depois vira aviãozinho para enviar. */
.mar-app.mar-direct-agent-mode.mar-direct-agent-ready .mar-record-finish[data-voice-mode="recording"]{border-radius:50%!important}
.mar-record-stop-square{display:block!important;width:12px!important;height:12px!important;border-radius:2px!important;background:currentColor!important}

/* Miniaturas persistentes dos anexos já enviados na conversa. */
.mar-sent-attachments{display:flex;flex-wrap:wrap;justify-content:flex-end;gap:6px;margin:7px 0 3px auto;max-width:min(620px,88%)}
.mar-sent-attachment{border:1px solid var(--mar-border)!important;background:var(--mar-surface-2)!important;color:var(--mar-direct-text)!important;border-radius:13px!important;padding:0!important;overflow:hidden!important;cursor:pointer!important}
.mar-sent-attachment.is-image{width:92px!important;height:92px!important}
.mar-sent-attachment.is-image img{display:block!important;width:100%!important;height:100%!important;object-fit:cover!important}
.mar-sent-attachment.is-file{width:126px!important;min-height:74px!important;padding:10px!important;display:flex!important;flex-direction:column!important;align-items:flex-start!important;justify-content:center!important;gap:5px!important;text-align:left!important}
.mar-sent-file-kind{font-size:10px!important;font-weight:850!important;letter-spacing:.05em!important;color:var(--mar-direct-muted)!important}
.mar-sent-attachment.is-file small{display:block!important;width:100%!important;white-space:nowrap!important;overflow:hidden!important;text-overflow:ellipsis!important;color:var(--mar-direct-text)!important}
.mar-app[data-theme="light"] .mar-sent-attachment{background:#F0EBF5!important;color:#3C2365!important;border-color:#DDD4E8!important}
@media(max-width:860px){.mar-sent-attachments{max-width:92%;gap:5px}.mar-sent-attachment.is-image{width:82px!important;height:82px!important}}

.mar-app.mar-direct-agent-mode.mar-direct-agent-ready .mar-message.is-user .mar-bubble:empty{display:none!important}

.mar-app.mar-direct-agent-mode.mar-direct-agent-ready .mar-message.is-user.has-attachments{flex-direction:column!important;align-items:flex-end!important;gap:6px!important}


/* ================================================================
   Mega Rê v2.7.1 — preview 2.7.1 aprovado
   Ajustes pontuais: alinhamento do usuário à direita, voz,
   leitura em voz, processamento, histórico e tipografia global.
   ================================================================ */

/* Tudo que o usuário envia fica do lado direito, inclusive imagens e arquivos. */
.mar-app.mar-direct-agent-mode.mar-direct-agent-ready .mar-message.is-user{
  width:100%!important;
  display:flex!important;
  flex-direction:column!important;
  align-items:flex-end!important;
  justify-content:flex-start!important;
}
.mar-app.mar-direct-agent-mode.mar-direct-agent-ready .mar-message.is-user .mar-bubble{
  align-self:flex-end!important;
  text-align:left!important;
}
.mar-app.mar-direct-agent-mode.mar-direct-agent-ready .mar-message.is-user .mar-sent-attachments{
  align-self:flex-end!important;
  justify-content:flex-end!important;
  margin-left:auto!important;
  margin-right:0!important;
}
.mar-app.mar-direct-agent-mode.mar-direct-agent-ready .mar-message.is-agent{
  align-items:flex-start!important;
}
.mar-app.mar-direct-agent-mode.mar-direct-agent-ready .mar-message.is-agent .mar-bubble{
  text-align:left!important;
}

/* Botão principal mais visível. No escuro: fundo claro + ícone roxo. */
.mar-app.mar-direct-agent-mode.mar-direct-agent-ready .mar-voice-input,
.mar-app.mar-direct-agent-mode.mar-direct-agent-ready .mar-send,
.mar-app.mar-direct-agent-mode.mar-direct-agent-ready .mar-record-finish{
  width:44px!important;
  height:44px!important;
  min-width:44px!important;
  flex:0 0 44px!important;
  border-radius:50%!important;
  display:grid!important;
  place-items:center!important;
  padding:0!important;
  border:0!important;
}
.mar-app.mar-direct-agent-mode.mar-direct-agent-ready .mar-voice-input svg,
.mar-app.mar-direct-agent-mode.mar-direct-agent-ready .mar-send svg,
.mar-app.mar-direct-agent-mode.mar-direct-agent-ready .mar-record-finish svg{
  width:21px!important;
  height:21px!important;
  max-width:21px!important;
  max-height:21px!important;
  stroke:currentColor!important;
}
.mar-app.mar-direct-agent-mode.mar-direct-agent-ready[data-theme="dark"] .mar-voice-input,
.mar-app.mar-direct-agent-mode.mar-direct-agent-ready[data-theme="dark"] .mar-send,
.mar-app.mar-direct-agent-mode.mar-direct-agent-ready[data-theme="dark"] .mar-record-finish{
  background:#F4F0F8!important;
  color:#3C2365!important;
}
.mar-app.mar-direct-agent-mode.mar-direct-agent-ready[data-theme="light"] .mar-voice-input,
.mar-app.mar-direct-agent-mode.mar-direct-agent-ready[data-theme="light"] .mar-send,
.mar-app.mar-direct-agent-mode.mar-direct-agent-ready[data-theme="light"] .mar-record-finish{
  background:#3C2365!important;
  color:#FFFFFF!important;
}

/* Durante a gravação, a linha normal fica totalmente escondida:
   sem anexo, câmera, microfone ou botão duplicado. */
.mar-app.mar-direct-agent-mode.mar-direct-agent-ready .mar-composer-input-row[hidden]{
  display:none!important;
}
.mar-app.mar-direct-agent-mode.mar-direct-agent-ready .mar-voice-recorder{
  align-items:center!important;
  gap:10px!important;
}
.mar-app.mar-direct-agent-mode.mar-direct-agent-ready .mar-voice-recorder[hidden]{
  display:none!important;
}
.mar-app.mar-direct-agent-mode.mar-direct-agent-ready .mar-record-finish[data-voice-mode="recording"] .mar-record-stop-square{
  width:14px!important;
  height:14px!important;
  border-radius:3px!important;
  background:currentColor!important;
}
@media(max-width:860px){
  .mar-app.mar-direct-agent-mode.mar-direct-agent-ready .mar-voice-input,
  .mar-app.mar-direct-agent-mode.mar-direct-agent-ready .mar-send,
  .mar-app.mar-direct-agent-mode.mar-direct-agent-ready .mar-record-finish{
    width:42px!important;height:42px!important;min-width:42px!important;flex-basis:42px!important;
  }
  .mar-app.mar-direct-agent-mode.mar-direct-agent-ready .mar-voice-input svg,
  .mar-app.mar-direct-agent-mode.mar-direct-agent-ready .mar-send svg,
  .mar-app.mar-direct-agent-mode.mar-direct-agent-ready .mar-record-finish svg{
    width:20px!important;height:20px!important;max-width:20px!important;max-height:20px!important;
  }
}

/* Feedback visual enquanto a IA prepara a resposta. */
.mar-processing-status{
  width:min(760px,calc(100% - 34px))!important;
  margin:8px auto 16px!important;
  display:flex!important;
  align-items:center!important;
  gap:8px!important;
  color:var(--mar-direct-muted)!important;
  font-size:calc(11px * var(--mar-direct-font-scale))!important;
  line-height:1.4!important;
}
.mar-processing-dots{display:inline-flex!important;gap:3px!important}
.mar-processing-dots i{
  width:4px!important;height:4px!important;border-radius:50%!important;
  background:currentColor!important;animation:marProcessingDot 1s infinite ease-in-out!important
}
.mar-processing-dots i:nth-child(2){animation-delay:.14s!important}
.mar-processing-dots i:nth-child(3){animation-delay:.28s!important}
@keyframes marProcessingDot{
  0%,80%,100%{opacity:.28;transform:translateY(0)}
  40%{opacity:1;transform:translateY(-3px)}
}

/* Leitura de resposta: o próprio rótulo vira "Parar áudio". */
.mar-direct-message-actions button.is-speaking{
  color:var(--mar-direct-text)!important;
  font-weight:800!important;
}

/* Escuro e claro preservam o contraste aprovado em toda a lateral. */
.mar-app.mar-direct-agent-mode.mar-direct-agent-ready[data-theme="dark"]>.mar-sidebar,
.mar-app.mar-direct-agent-mode.mar-direct-agent-ready[data-theme="dark"]>.mar-sidebar *{
  color:#F4F0F8;
}
.mar-app.mar-direct-agent-mode.mar-direct-agent-ready[data-theme="dark"]>.mar-sidebar .mar-history-copy small,
.mar-app.mar-direct-agent-mode.mar-direct-agent-ready[data-theme="dark"]>.mar-sidebar .mar-direct-history-label,
.mar-app.mar-direct-agent-mode.mar-direct-agent-ready[data-theme="dark"]>.mar-sidebar .mar-profile-copy span,
.mar-app.mar-direct-agent-mode.mar-direct-agent-ready[data-theme="dark"]>.mar-sidebar .mar-history-empty{
  color:#B8AEC6!important;
}
.mar-app.mar-direct-agent-mode.mar-direct-agent-ready[data-theme="light"]>.mar-sidebar,
.mar-app.mar-direct-agent-mode.mar-direct-agent-ready[data-theme="light"]>.mar-sidebar *{
  color:#3C2365;
}
.mar-app.mar-direct-agent-mode.mar-direct-agent-ready[data-theme="light"]>.mar-sidebar .mar-history-copy small,
.mar-app.mar-direct-agent-mode.mar-direct-agent-ready[data-theme="light"]>.mar-sidebar .mar-direct-history-label,
.mar-app.mar-direct-agent-mode.mar-direct-agent-ready[data-theme="light"]>.mar-sidebar .mar-profile-copy span,
.mar-app.mar-direct-agent-mode.mar-direct-agent-ready[data-theme="light"]>.mar-sidebar .mar-history-empty{
  color:#6F5A8A!important;
}

/* Fonte selecionada acompanha todas as áreas textuais da experiência do agente. */
.mar-app.mar-direct-agent-mode.mar-direct-agent-ready .mar-brand-text{font-size:calc(12px * var(--mar-direct-font-scale))!important}
.mar-app.mar-direct-agent-mode.mar-direct-agent-ready .mar-agent-subtitle{font-size:calc(9px * var(--mar-direct-font-scale))!important}
.mar-app.mar-direct-agent-mode.mar-direct-agent-ready .mar-history-empty{font-size:calc(9px * var(--mar-direct-font-scale))!important}
.mar-app.mar-direct-agent-mode.mar-direct-agent-ready .mar-direct-user-popover>span{font-size:calc(9px * var(--mar-direct-font-scale))!important}
.mar-app.mar-direct-agent-mode.mar-direct-agent-ready .mar-direct-feedback-thanks{font-size:calc(9px * var(--mar-direct-font-scale))!important}
.mar-app.mar-direct-agent-mode.mar-direct-agent-ready .mar-file-preview-head strong{font-size:calc(10px * var(--mar-direct-font-scale))!important}
.mar-app.mar-direct-agent-mode.mar-direct-agent-ready .mar-file-preview-generic,
.mar-app.mar-direct-agent-mode.mar-direct-agent-ready .mar-file-preview-generic a{font-size:calc(10px * var(--mar-direct-font-scale))!important}
.mar-app.mar-direct-agent-mode.mar-direct-agent-ready #marMemoryView .mar-eyebrow{font-size:calc(9px * var(--mar-direct-font-scale))!important}
.mar-app.mar-direct-agent-mode.mar-direct-agent-ready #marMemoryView .mar-section-head h2{font-size:calc(20px * var(--mar-direct-font-scale))!important}
.mar-app.mar-direct-agent-mode.mar-direct-agent-ready #marMemoryView .mar-section-head p,
.mar-app.mar-direct-agent-mode.mar-direct-agent-ready #marMemoryView .mar-memory-note,
.mar-app.mar-direct-agent-mode.mar-direct-agent-ready #marMemoryView .mar-memory-dates{font-size:calc(10px * var(--mar-direct-font-scale))!important}
.mar-app.mar-direct-agent-mode.mar-direct-agent-ready .mar-direct-user-message-menu button{font-size:calc(13px * var(--mar-direct-font-scale))!important}

/* Miniaturas enviadas permanecem clicáveis e claramente pertencem ao usuário. */
.mar-app.mar-direct-agent-mode.mar-direct-agent-ready .mar-sent-attachments{
  display:grid!important;
  grid-template-columns:repeat(auto-fit,minmax(92px,118px))!important;
  gap:7px!important;
  max-width:min(560px,90%)!important;
}
.mar-app.mar-direct-agent-mode.mar-direct-agent-ready .mar-sent-attachment.is-image{
  width:100%!important;height:112px!important;
}
.mar-app.mar-direct-agent-mode.mar-direct-agent-ready .mar-sent-attachment.is-file{
  width:118px!important;min-height:76px!important;
}
@media(max-width:860px){
  .mar-app.mar-direct-agent-mode.mar-direct-agent-ready .mar-sent-attachments{
    grid-template-columns:repeat(auto-fit,minmax(82px,105px))!important;
    max-width:92%!important;
  }
  .mar-app.mar-direct-agent-mode.mar-direct-agent-ready .mar-sent-attachment.is-image{height:98px!important}
}


/* ================================================================
   Mega Rê 2.7.5 — histórico persistente + seta para fechar sidebar
   Apenas ajustes pontuais solicitados nesta versão.
   ================================================================ */
.mar-app.mar-direct-agent-mode.mar-direct-agent-ready>.mar-sidebar .mar-sidebar-top{
  display:flex!important;
  align-items:center!important;
  justify-content:flex-end!important;
  min-height:34px!important;
  margin:0 2px 4px!important;
}
.mar-app.mar-direct-agent-mode.mar-direct-agent-ready>.mar-sidebar .mar-sidebar-top .mar-brand{display:none!important}
.mar-app.mar-direct-agent-mode.mar-direct-agent-ready>.mar-sidebar .mar-close-mobile{
  display:grid!important;
  place-items:center!important;
  width:34px!important;height:34px!important;min-width:34px!important;min-height:34px!important;
  padding:0!important;border:0!important;border-radius:9px!important;
  background:transparent!important;color:inherit!important;cursor:pointer!important;
  font-size:22px!important;line-height:1!important;
}
.mar-app.mar-direct-agent-mode.mar-direct-agent-ready>.mar-sidebar .mar-close-mobile:hover{
  background:color-mix(in srgb,currentColor 10%,transparent)!important;
}

@media(min-width:861px){
  .mar-app.mar-direct-agent-mode.mar-direct-agent-ready.mar-sidebar-collapsed{
    grid-template-columns:0 minmax(0,1fr)!important;
    grid-template-areas:"agent-header agent-header" "agent-sidebar agent-main"!important;
  }
  .mar-app.mar-direct-agent-mode.mar-direct-agent-ready.mar-sidebar-collapsed>.mar-sidebar{
    width:0!important;min-width:0!important;padding:0!important;border:0!important;overflow:hidden!important;
  }
  .mar-app.mar-direct-agent-mode.mar-direct-agent-ready.mar-sidebar-collapsed>.mar-topbar .mar-open-mobile{
    display:grid!important;place-items:center!important;width:36px!important;height:36px!important;min-width:36px!important;
    padding:0!important;color:inherit!important;
  }
}

@media(max-width:860px){
  .mar-app.mar-direct-agent-mode.mar-direct-agent-ready>.mar-sidebar .mar-sidebar-top{
    min-height:36px!important;margin-bottom:5px!important;
  }
  .mar-app.mar-direct-agent-mode.mar-direct-agent-ready>.mar-sidebar .mar-close-mobile{
    display:grid!important;
  }
}


/* ================================================================
   Mega Rê 2.7.7 — ações de histórico + agrupamento por período
   Ajustes pontuais, sem alterar o restante do layout aprovado.
   ================================================================ */

/* Nova conversa no canto esquerdo, compacta, sem duplicação visual. */
.mar-app.mar-direct-agent-mode.mar-direct-agent-ready>.mar-sidebar .mar-new-chat{
  width:max-content!important;
  max-width:calc(100% - 4px)!important;
  justify-content:flex-start!important;
  text-align:left!important;
  align-self:flex-start!important;
  margin:0 2px 5px!important;
  padding:0 9px!important;
}

/* Cada conversa reserva espaço para os dois ícones no desktop. */
.mar-app.mar-direct-agent-mode.mar-direct-agent-ready .mar-history-row{
  position:relative!important;
  display:flex!important;
  align-items:center!important;
}
.mar-app.mar-direct-agent-mode.mar-direct-agent-ready .mar-history-item{
  flex:1 1 auto!important;
  min-width:0!important;
  padding-right:9px!important;
}
.mar-app.mar-direct-agent-mode.mar-direct-agent-ready .mar-history-inline-actions{
  display:none;
  align-items:center;
  gap:2px;
  padding-right:5px;
  flex:0 0 auto;
  color:inherit;
}
.mar-app.mar-direct-agent-mode.mar-direct-agent-ready .mar-history-inline-actions button{
  width:30px;height:30px;min-width:30px;
  border:0;border-radius:8px;background:transparent;color:inherit;
  display:grid;place-items:center;padding:0;cursor:pointer;
}
.mar-app.mar-direct-agent-mode.mar-direct-agent-ready .mar-history-inline-actions button:hover{
  background:color-mix(in srgb,currentColor 13%,transparent)!important;
}
.mar-app.mar-direct-agent-mode.mar-direct-agent-ready .mar-history-inline-actions svg{
  width:17px;height:17px;fill:none;stroke:currentColor;stroke-width:1.8;
}

/* No computador, passar o mouse mostra Fixar e Renomear. */
@media(min-width:861px){
  .mar-app.mar-direct-agent-mode.mar-direct-agent-ready .mar-history-row:hover .mar-history-inline-actions,
  .mar-app.mar-direct-agent-mode.mar-direct-agent-ready .mar-history-row:focus-within .mar-history-inline-actions{
    display:flex!important;
  }
  .mar-app.mar-direct-agent-mode.mar-direct-agent-ready .mar-history-row:hover .mar-history-item{
    padding-right:2px!important;
  }
}

/* No celular, as ações continuam escondidas e aparecem apenas no popup de pressão longa. */
@media(max-width:860px){
  .mar-app.mar-direct-agent-mode.mar-direct-agent-ready .mar-history-inline-actions{display:none!important}
}

/* Cores dos dois ícones seguem o tema, iguais às demais ações do chat. */
.mar-app.mar-direct-agent-mode.mar-direct-agent-ready[data-theme="dark"] .mar-history-inline-actions,
.mar-direct-history-context:not(.mar-light){
  color:#F4F0F8!important;
}
.mar-app.mar-direct-agent-mode.mar-direct-agent-ready[data-theme="light"] .mar-history-inline-actions,
.mar-direct-history-context.mar-light{
  color:#3C2365!important;
}
.mar-direct-history-context [data-direct-history-action="pin"] svg,
.mar-direct-history-context [data-direct-history-action="rename"] svg{
  stroke:currentColor!important;
}

/* Grupos por período no histórico. */
.mar-app.mar-direct-agent-mode.mar-direct-agent-ready .mar-direct-history-period+.mar-direct-history-period{
  margin-top:11px!important;
}
.mar-app.mar-direct-agent-mode.mar-direct-agent-ready .mar-direct-history-label{
  text-transform:none!important;
  letter-spacing:0!important;
}

/* Popup móvel um pouco mais compacto, com os dois itens no mesmo padrão visual. */
.mar-direct-history-context{
  min-width:176px!important;
  padding:7px!important;
}
.mar-direct-history-context button{
  min-height:46px!important;
  font-size:calc(13px * var(--mar-direct-font-scale,1))!important;
  gap:11px!important;
}
.mar-direct-history-context svg{
  width:20px!important;height:20px!important;
}

/* ================================================================
   Mega Rê 2.7.11 — ajustes funcionais sem alterar o layout aprovado 2.6.7
   - fontes web discretas
   - proteção contra rolagem horizontal no mobile
   ================================================================ */
.mar-app.mar-direct-agent-mode.mar-direct-agent-ready .mar-rich-response,
.mar-app.mar-direct-agent-mode.mar-direct-agent-ready .mar-rich-response p,
.mar-app.mar-direct-agent-mode.mar-direct-agent-ready .mar-rich-response li,
.mar-app.mar-direct-agent-mode.mar-direct-agent-ready .mar-rich-response strong,
.mar-app.mar-direct-agent-mode.mar-direct-agent-ready .mar-rich-response a,
.mar-app.mar-direct-agent-mode.mar-direct-agent-ready .mar-message,
.mar-app.mar-direct-agent-mode.mar-direct-agent-ready .mar-bubble{
  min-width:0!important;
  max-width:100%!important;
  overflow-wrap:anywhere!important;
  word-break:break-word!important;
}
.mar-app.mar-direct-agent-mode.mar-direct-agent-ready .mar-inline-source-link{
  display:inline-flex!important;
  align-items:center!important;
  max-width:100%!important;
  margin:0 2px!important;
  padding:2px 7px!important;
  border:1px solid var(--mar-border)!important;
  border-radius:999px!important;
  background:transparent!important;
  color:var(--mar-direct-muted,var(--mar-muted))!important;
  font-size:calc(9px * var(--mar-direct-font-scale,1))!important;
  line-height:1.35!important;
  text-decoration:none!important;
  white-space:normal!important;
}
.mar-app.mar-direct-agent-mode.mar-direct-agent-ready .mar-web-sources{
  width:100%!important;
  display:flex!important;
  flex-wrap:wrap!important;
  gap:5px!important;
  margin:8px 0 2px!important;
  min-width:0!important;
}
.mar-app.mar-direct-agent-mode.mar-direct-agent-ready .mar-web-source-chip{
  display:inline-flex!important;
  align-items:center!important;
  max-width:100%!important;
  min-height:24px!important;
  padding:3px 8px!important;
  border:1px solid var(--mar-border)!important;
  border-radius:999px!important;
  background:transparent!important;
  color:var(--mar-direct-muted,var(--mar-muted))!important;
  font-size:calc(8.5px * var(--mar-direct-font-scale,1))!important;
  font-weight:700!important;
  line-height:1.2!important;
  text-decoration:none!important;
  overflow-wrap:anywhere!important;
}
.mar-app.mar-direct-agent-mode.mar-direct-agent-ready .mar-web-source-chip:hover,
.mar-app.mar-direct-agent-mode.mar-direct-agent-ready .mar-web-source-chip:focus-visible{
  color:var(--mar-direct-text,var(--mar-text))!important;
  border-color:var(--mar-agent-active-bg,var(--mar-accent))!important;
  outline:none!important;
}
@media(max-width:860px){
  html.mar-app-page,body.mar-app-page{
    width:100%!important;
    max-width:100%!important;
    overflow-x:hidden!important;
  }
  .mar-app.mar-direct-agent-mode.mar-direct-agent-ready,
  .mar-app.mar-direct-agent-mode.mar-direct-agent-ready>.mar-main,
  .mar-app.mar-direct-agent-mode.mar-direct-agent-ready>.mar-main>.mar-content,
  .mar-app.mar-direct-agent-mode.mar-direct-agent-ready .mar-view,
  .mar-app.mar-direct-agent-mode.mar-direct-agent-ready .mar-messages,
  .mar-app.mar-direct-agent-mode.mar-direct-agent-ready .mar-message,
  .mar-app.mar-direct-agent-mode.mar-direct-agent-ready .mar-rich-response,
  .mar-app.mar-direct-agent-mode.mar-direct-agent-ready .mar-composer,
  .mar-app.mar-direct-agent-mode.mar-direct-agent-ready .mar-composer-input-row,
  .mar-app.mar-direct-agent-mode.mar-direct-agent-ready textarea{
    max-width:100%!important;
    min-width:0!important;
    box-sizing:border-box!important;
  }
  .mar-app.mar-direct-agent-mode.mar-direct-agent-ready>.mar-main,
  .mar-app.mar-direct-agent-mode.mar-direct-agent-ready>.mar-main>.mar-content,
  .mar-app.mar-direct-agent-mode.mar-direct-agent-ready .mar-view{
    overflow-x:hidden!important;
  }
  .mar-app.mar-direct-agent-mode.mar-direct-agent-ready .mar-rich-response pre,
  .mar-app.mar-direct-agent-mode.mar-direct-agent-ready .mar-rich-response code{
    max-width:100%!important;
    white-space:pre-wrap!important;
    overflow-wrap:anywhere!important;
    word-break:break-word!important;
  }
}

/* Mega Rê beta 2.7.13 — abertura, leitura e navegação compartilhadas. */
/* Estados de interação definidos pelo aplicativo, sem o rosa do tema/Elementor. */
#mega-re-app button,
#mega-re-app a{
  -webkit-tap-highlight-color:transparent;
}
#mega-re-app button:not(:disabled):is(:hover,:focus,:active){
  background:var(--mar-control-bg,var(--mar-surface-2))!important;
  color:var(--mar-control-ink,var(--mar-text))!important;
}
#mega-re-app button:focus-visible,
#mega-re-app a:focus-visible{
  outline:2px solid #8B6DB8!important;
  outline-offset:2px!important;
}
#mega-re-app :is(.mar-primary-button,.mar-send,.mar-record-finish),
#mega-re-app .mar-direct-segmented button.is-active,
#mega-re-app .mar-nav-item.is-active{
  --mar-control-bg:#3C2365;
  --mar-control-ink:#FFFFFF;
}
#mega-re-app .mar-nav-item.is-active{
  background:#3C2365!important;color:#FFFFFF!important;
}
#mega-re-app:not(.mar-direct-agent-mode) :is(.mar-new-chat,.mar-new-chat span,.mar-open-mobile,.mar-close-mobile){
  color:var(--mar-text)!important;
}
#mega-re-app:not(.mar-direct-agent-mode) .mar-history-filters button.is-active{
  --mar-control-bg:#3C2365;--mar-control-ink:#FFFFFF;
  background:#3C2365!important;color:#FFFFFF!important;
}
#mega-re-app :is(.mar-brand,.mar-topbar-logo){
  --mar-control-bg:transparent;
  background:transparent!important;
  border:0!important;
  padding:0!important;
  cursor:pointer;
}
#mega-re-app .mar-topbar-logo{flex:0 0 auto}
#mega-re-app :is(.mar-direct-message-actions,.mar-direct-user-message-actions) button{
  --mar-control-bg:transparent;
}
#mega-re-app .mar-voice-input{
  --mar-control-bg:#F4F0F8;
  --mar-control-ink:#3C2365;
  width:48px!important;height:48px!important;min-width:48px!important;
  flex:0 0 48px!important;display:grid;place-items:center;
  padding:0!important;border-radius:50%!important;
  background:var(--mar-control-bg)!important;color:var(--mar-control-ink)!important;
}
#mega-re-app[data-theme="light"] .mar-voice-input{
  --mar-control-bg:#3C2365;
  --mar-control-ink:#FFFFFF;
}
#mega-re-app .mar-voice-input svg{
  width:28px!important;height:28px!important;max-width:28px!important;max-height:28px!important;
  display:block!important;margin:auto!important;transform:none!important;
}
#mega-re-app .mar-voice-input[hidden]{display:none!important}

/* Abertura no viewport real: mesma centralização em todas as telas. */
#marMobileSplash{
  position:fixed!important;
  inset:auto!important;
  top:var(--mar-visual-viewport-top,0px)!important;
  left:var(--mar-visual-viewport-left,0px)!important;
  width:var(--mar-visual-viewport-width,100vw)!important;
  height:var(--mar-visual-viewport-height,100dvh)!important;
  min-height:var(--mar-visual-viewport-height,100dvh)!important;
  margin:0!important;padding:0!important;border:0!important;
  background:#000000!important;
  z-index:2147483000!important;
  display:none!important;place-items:center!important;
  opacity:0!important;visibility:hidden!important;pointer-events:none!important;
}
#marMobileSplash.is-visible{
  display:grid!important;opacity:1!important;visibility:visible!important;pointer-events:auto!important;
}
#marMobileSplash.is-done{display:none!important}
#marMobileSplash .mar-splash-logo{
  position:relative!important;inset:auto!important;
  width:48px!important;height:57px!important;
  margin:0!important;padding:0!important;display:grid!important;place-items:center!important;
  transform:none!important;animation:none!important;
}
#marMobileSplash .mar-splash-logo img{
  width:100%!important;height:100%!important;object-fit:contain!important;
  display:block!important;margin:0!important;padding:0!important;
}
@media(min-width:861px){
  #marMobileSplash .mar-splash-logo{width:56px!important;height:66px!important}
}

/* Configurações e retorno ficam disponíveis também na aplicação principal. */
#mega-re-app #marDirectSettingsView.is-active,
#mega-re-app #marMemoryView.is-active{display:block!important;width:100%;min-width:0}
#mega-re-app #marDirectSettingsBack,
#mega-re-app #marDirectMemoryBack{
  --mar-control-bg:transparent;
  display:flex!important;align-items:center;gap:8px;
  width:fit-content;min-height:44px;
  margin:0 auto 12px 0!important;padding:6px 8px!important;
  border:0!important;background:transparent!important;color:var(--mar-text)!important;
  font-size:calc(14px * var(--mar-reading-scale,1))!important;
}
#mega-re-app :is(#marDirectSettingsBack,#marDirectMemoryBack) span:first-child{font-size:22px!important}
#mega-re-app .mar-direct-settings-card{
  background:var(--mar-surface)!important;color:var(--mar-text)!important;
  border-color:var(--mar-border)!important;max-width:100%!important;
}
#mega-re-app .mar-direct-setting-row{border-color:var(--mar-border)!important}
#mega-re-app .mar-direct-setting-row strong{color:var(--mar-text)!important}
#mega-re-app .mar-direct-setting-row>div>span{color:var(--mar-muted)!important}
#mega-re-app .mar-direct-settings-button svg{flex:0 0 17px!important}
#mega-re-app .mar-direct-settings-button span{min-width:0;white-space:normal;overflow-wrap:anywhere}
#mega-re-app .mar-direct-segmented button{
  background:var(--mar-surface-2)!important;color:var(--mar-text)!important;
  border-color:var(--mar-border)!important;min-height:44px!important;
}
#mega-re-app .mar-direct-segmented button.is-active{
  background:#3C2365!important;color:#FFFFFF!important;border-color:#3C2365!important;
}
#mega-re-app .mar-direct-settings-button.is-active{
  --mar-control-bg:var(--mar-surface-2);
  background:var(--mar-surface-2)!important;
}
#mega-re-app:not(.mar-direct-agent-mode) .mar-direct-settings-button{
  font-size:calc(13px * var(--mar-reading-scale,1))!important;
}
#mega-re-app:not(.mar-direct-agent-mode){--mar-reading-scale:1}
#mega-re-app:not(.mar-direct-agent-mode)[data-direct-font="medium"]{--mar-reading-scale:1.15}
#mega-re-app:not(.mar-direct-agent-mode)[data-direct-font="large"]{--mar-reading-scale:1.3}
#mega-re-app:not(.mar-direct-agent-mode) :is(.mar-agent-name,.mar-brand-text){font-size:calc(15px * var(--mar-reading-scale))!important}
#mega-re-app:not(.mar-direct-agent-mode) .mar-nav-item{font-size:calc(13px * var(--mar-reading-scale))!important}
#mega-re-app:not(.mar-direct-agent-mode) .mar-history-copy strong{font-size:calc(12px * var(--mar-reading-scale))!important}
#mega-re-app:not(.mar-direct-agent-mode) .mar-history-copy small{font-size:calc(10px * var(--mar-reading-scale))!important}
#mega-re-app:not(.mar-direct-agent-mode) :is(.mar-composer textarea,.mar-bubble){font-size:calc(15px * var(--mar-reading-scale))!important}
#mega-re-app:not(.mar-direct-agent-mode) .mar-direct-settings-card h2{font-size:calc(22px * var(--mar-reading-scale))!important}
#mega-re-app:not(.mar-direct-agent-mode) .mar-direct-setting-row strong{font-size:calc(14px * var(--mar-reading-scale))!important}
#mega-re-app:not(.mar-direct-agent-mode) .mar-direct-setting-row>div>span{font-size:calc(12px * var(--mar-reading-scale))!important}
#mega-re-app:not(.mar-direct-agent-mode) .mar-direct-segmented button{font-size:calc(12px * var(--mar-reading-scale))!important}
#mega-re-app:not(.mar-direct-agent-mode) :is(#marMemorySummary,.mar-memory-item-copy){font-size:calc(14px * var(--mar-reading-scale))!important}

/* A fonte mantém o tamanho ao focar/sair do campo, sem deslocar o envio no toque. */
#mega-re-app.mar-direct-agent-mode.mar-direct-agent-ready .mar-composer textarea,
#mega-re-app.mar-direct-agent-mode.mar-direct-agent-ready .mar-composer textarea:is(:focus,:focus-visible){
  font-size:calc(11px * var(--mar-direct-font-scale,1))!important;
}

/* Histórico lateral: os mesmos grupos e ações do agente, com arquivos preservados. */
#mega-re-app:not(.mar-direct-agent-mode) .mar-sidebar-spacer{flex:0 0 auto}
#mega-re-app:not(.mar-direct-agent-mode) .mar-nav{flex:0 1 auto;min-height:0;overflow-y:auto}
#mega-re-app:not(.mar-direct-agent-mode) .mar-history{flex:1 1 auto;min-height:92px;overflow:auto;display:block}
#mega-re-app:not(.mar-direct-agent-mode) .mar-direct-history-group{display:grid;gap:3px}
#mega-re-app:not(.mar-direct-agent-mode) .mar-direct-history-group+.mar-direct-history-group{margin-top:12px}
#mega-re-app:not(.mar-direct-agent-mode) .mar-direct-history-label{padding:8px 9px 4px;font-size:11px;color:var(--mar-muted)}
#mega-re-app:not(.mar-direct-agent-mode) .mar-history-row{min-height:44px;border-radius:9px}
#mega-re-app:not(.mar-direct-agent-mode) .mar-history-item{padding:8px 9px;min-width:0;min-height:44px;color:var(--mar-text)}
#mega-re-app:not(.mar-direct-agent-mode) .mar-history-copy{display:grid;gap:3px;min-width:0}
#mega-re-app:not(.mar-direct-agent-mode) .mar-history-copy :is(strong,small){overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
#mega-re-app:not(.mar-direct-agent-mode) .mar-history-inline-actions{display:none;align-items:center;gap:2px;flex:0 0 auto}
#mega-re-app:not(.mar-direct-agent-mode) .mar-history-inline-actions button{width:28px;height:32px;padding:4px;border:0;background:transparent;color:var(--mar-text);border-radius:7px}
#mega-re-app:not(.mar-direct-agent-mode) .mar-history-inline-actions svg{width:17px;height:17px;fill:none;stroke:currentColor;stroke-width:1.8}
@media(min-width:861px){
  #mega-re-app:not(.mar-direct-agent-mode) .mar-history-row:is(:hover,:focus-within) .mar-history-inline-actions{display:flex}
}
@media(max-width:860px){
  #mega-re-app .mar-direct-setting-row{grid-template-columns:1fr!important;gap:12px!important}
  #mega-re-app .mar-direct-segmented{justify-content:flex-start!important;gap:6px!important}
  #mega-re-app .mar-direct-settings-card{width:100%!important;padding:18px!important}
  #mega-re-app:not(.mar-direct-agent-mode) .mar-topbar-left>.mar-topbar-logo{display:block!important}
  #mega-re-app:not(.mar-direct-agent-mode) .mar-memory-toolbar{grid-template-columns:1fr}
  #mega-re-app:not(.mar-direct-agent-mode) .mar-memory-item{flex-wrap:wrap}
}

/* 2.7.14 beta: shared conversation controls and the suggestions area. */
#mega-re-app:not(.mar-direct-agent-mode) .mar-message.is-agent{display:flex!important;flex-direction:column!important;align-items:flex-start!important;gap:0!important}
#mega-re-app:not(.mar-direct-agent-mode) .mar-direct-message-actions{display:flex!important;flex-wrap:wrap!important;align-items:center!important;gap:14px!important;margin:8px 0 14px!important;color:var(--mar-muted)!important}
#mega-re-app:not(.mar-direct-agent-mode) .mar-direct-message-actions button{font-size:12px!important;min-height:32px!important;padding:4px 0!important}
#mega-re-app:not(.mar-direct-agent-mode) .mar-direct-message-actions svg{width:17px!important;height:17px!important}
#mega-re-app .mar-direct-message-actions button[aria-pressed="true"]{color:var(--mar-accent,#3C2365)!important;font-weight:600!important}
#mega-re-app:not(.mar-direct-agent-mode) .mar-direct-feedback-thanks{font-size:12px!important;color:var(--mar-muted)!important}
#mega-re-app .mar-direct-feedback-thanks[hidden]{display:none!important}
#mega-re-app:not(.mar-direct-agent-mode) :is(.mar-voice-input,.mar-send,.mar-record-finish){width:48px!important;height:48px!important;min-width:48px!important;flex:0 0 48px!important;display:grid!important;place-items:center!important;border:0!important;border-radius:50%!important;padding:0!important;box-shadow:none!important}
#mega-re-app:not(.mar-direct-agent-mode) :is(.mar-send,.mar-record-finish) svg{width:24px!important;height:24px!important;stroke:currentColor!important;fill:none!important;stroke-width:2!important}
#mega-re-app:not(.mar-direct-agent-mode)[data-theme="dark"] :is(.mar-voice-input,.mar-send,.mar-record-finish){background:#F4F0F8!important;color:#3C2365!important}
#mega-re-app:not(.mar-direct-agent-mode)[data-theme="light"] :is(.mar-voice-input,.mar-send,.mar-record-finish){background:#3C2365!important;color:#FFFFFF!important}
#mega-re-app :is(.mar-send,.mar-voice-input,.mar-composer-input-row,.mar-voice-recorder,.mar-suggestions-view)[hidden]{display:none!important}
#mega-re-app:not(.mar-direct-agent-mode) .mar-composer{border-radius:28px!important}
#mega-re-app:not(.mar-direct-agent-mode) .mar-composer:has(.mar-attachment-tray:not([hidden])){border-radius:24px!important}
#mega-re-app .mar-suggestions-button{flex:0 0 auto!important;margin:4px 0!important}
#mega-re-app .mar-suggestions-view{max-width:740px!important;width:100%!important;margin:0 auto!important;padding:20px 16px 36px!important;box-sizing:border-box!important;color:var(--mar-text)!important}
#mega-re-app .mar-suggestions-view>p{line-height:1.6!important}
#mega-re-app .mar-suggestion-form{display:flex!important;flex-direction:column!important;gap:12px!important;margin-top:24px!important}
#mega-re-app .mar-suggestion-form label{font-weight:600!important;font-size:14px!important;color:var(--mar-text)!important}
#mega-re-app .mar-suggestion-form label span{font-weight:400!important;color:var(--mar-muted)!important}
#mega-re-app .mar-suggestion-form :is(input,textarea){width:100%!important;box-sizing:border-box!important;padding:12px!important;background:var(--mar-surface)!important;color:var(--mar-text)!important;border:1px solid var(--mar-border)!important;border-radius:10px!important;font:inherit!important;outline-offset:3px!important}
#mega-re-app .mar-suggestion-form textarea{resize:vertical!important;min-height:150px!important;line-height:1.6!important}
#mega-re-app .mar-suggestion-form p{font-size:13px!important;color:var(--mar-muted)!important;line-height:1.55!important}
#mega-re-app .mar-suggestion-form button{align-self:flex-start!important}
#mega-re-app #marSuggestionStatus{font-size:14px!important;line-height:1.5!important;min-height:24px!important}
#mega-re-app:not(.mar-direct-agent-mode) :is(.mar-send,.mar-record-finish){width:44px!important;height:44px!important;min-width:44px!important;flex-basis:44px!important}
#mega-re-app:not(.mar-direct-agent-mode) :is(.mar-send,.mar-record-finish) svg{width:21px!important;height:21px!important;max-width:21px!important;max-height:21px!important}
@media(max-width:860px){
  #mega-re-app:not(.mar-direct-agent-mode) :is(.mar-send,.mar-record-finish){width:42px!important;height:42px!important;min-width:42px!important;flex-basis:42px!important}
  #mega-re-app:not(.mar-direct-agent-mode) :is(.mar-send,.mar-record-finish) svg{width:20px!important;height:20px!important;max-width:20px!important;max-height:20px!important}
}
#mega-re-app:not(.mar-direct-agent-mode) .mar-voice-recorder{display:flex!important;align-items:center!important;gap:10px!important;width:100%!important;min-height:54px!important;box-sizing:border-box!important;padding:4px 0!important}
#mega-re-app:not(.mar-direct-agent-mode) .mar-voice-recorder .mar-waveform{display:flex!important;align-items:center!important;justify-content:center!important;gap:3px!important;flex:1 1 auto!important;min-width:0!important;width:auto!important;height:36px!important}
#mega-re-app:not(.mar-direct-agent-mode) .mar-record-stop-square{display:block!important;width:14px!important;height:14px!important;border-radius:3px!important;background:currentColor!important}
#mega-re-app:not(.mar-direct-agent-mode) .mar-voice-recorder[hidden]{display:none!important}

/* 2.7.17 beta — shared composer, file picker and dictation controls. */
#mega-re-app {
    --mar-composer-font:ui-sans-serif,-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,Arial,sans-serif;
}
#mega-re-app .mar-composer-area {
    padding:12px 20px max(12px,env(safe-area-inset-bottom))!important;
    border-top:0!important;
    overflow:visible!important;
}
#mega-re-app .mar-work-composer.mar-composer {
    position:relative!important;
    display:block!important;
    box-sizing:border-box!important;
    width:min(820px,100%)!important;
    min-height:0!important;
    margin:0 auto!important;
    padding:0!important;
    border:1px solid var(--mar-border)!important;
    border-radius:28px!important;
    background:var(--mar-surface-2)!important;
    color:var(--mar-text)!important;
    box-shadow:0 3px 14px rgba(0,0,0,.05)!important;
    overflow:visible!important;
    font-family:var(--mar-composer-font)!important;
}
#mega-re-app[data-theme="dark"] .mar-work-composer.mar-composer { background:#303030!important;border-color:#3d3d3d!important;color:#f5f5f5!important; }
#mega-re-app[data-theme="light"] .mar-work-composer.mar-composer { background:#fff!important;border-color:#dedee3!important;color:#202123!important; }
#mega-re-app .mar-work-composer.mar-composer .mar-composer-input-row {
    display:flex!important;flex-direction:column!important;align-items:stretch!important;
    box-sizing:border-box!important;width:100%!important;min-height:0!important;
    padding:13px 10px 8px!important;gap:8px!important;
}
#mega-re-app .mar-work-composer.mar-composer textarea,
#mega-re-app:not(.mar-direct-agent-mode) .mar-work-composer.mar-composer textarea,
#mega-re-app.mar-direct-agent-mode.mar-direct-agent-ready .mar-work-composer.mar-composer textarea,
#mega-re-app.mar-direct-agent-mode.mar-direct-agent-ready .mar-work-composer.mar-composer textarea:is(:focus,:focus-visible) {
    display:block!important;box-sizing:border-box!important;flex:0 0 auto!important;
    width:100%!important;min-width:0!important;min-height:30px!important;max-height:132px!important;height:var(--mar-composer-input-height,auto)!important;
    margin:0!important;padding:4px 10px!important;
    border:0!important;border-radius:0!important;outline:0!important;
    background:transparent!important;color:inherit!important;box-shadow:none!important;
    font-family:var(--mar-composer-font)!important;font-size:calc(16px * var(--mar-reading-scale,var(--mar-direct-font-scale,1)))!important;
    font-weight:400!important;line-height:1.5!important;resize:none!important;overflow-y:auto!important;
}
#mega-re-app .mar-work-composer.mar-composer textarea::placeholder {color:var(--mar-muted)!important;opacity:1!important;}
#mega-re-app .mar-work-composer.mar-composer .mar-composer-toolbar {
    display:flex!important;align-items:center!important;gap:3px!important;min-width:0!important;width:100%!important;
}
#mega-re-app .mar-work-composer.mar-composer :is(.mar-composer-icon,.mar-round-action,.mar-record-delete,.mar-record-pause,.mar-record-finish) {
    display:grid!important;place-items:center!important;box-sizing:border-box!important;flex:0 0 44px!important;
    width:44px!important;height:44px!important;min-width:44px!important;max-width:44px!important;
    margin:0!important;padding:0!important;border:0!important;border-radius:50%!important;box-shadow:none!important;
    cursor:pointer!important;font-family:var(--mar-composer-font)!important;
}
#mega-re-app .mar-work-composer.mar-composer :is(.mar-composer-icon,.mar-voice-input,.mar-record-delete) {
    --mar-control-bg:rgba(127,127,127,.12);--mar-control-ink:var(--mar-text);
    background:transparent!important;color:inherit!important;
}
#mega-re-app .mar-work-composer.mar-composer :is(.mar-send,.mar-record-finish) {
    --mar-control-bg:#3C2365;--mar-control-ink:#fff;
    background:#3C2365!important;color:#fff!important;opacity:1!important;
}
#mega-re-app .mar-work-composer.mar-composer .mar-record-pause {
    --mar-control-bg:rgba(127,127,127,.18);--mar-control-ink:var(--mar-text);
    background:rgba(127,127,127,.12)!important;color:inherit!important;
}
#mega-re-app .mar-work-composer.mar-composer :is(.mar-composer-icon,.mar-round-action,.mar-record-delete,.mar-record-pause,.mar-record-finish):disabled {
    cursor:default!important;opacity:.42!important;
}
#mega-re-app .mar-work-composer.mar-composer :is(.mar-composer-icon,.mar-round-action,.mar-record-delete,.mar-record-finish) svg {
    display:block!important;width:24px!important;height:24px!important;max-width:24px!important;max-height:24px!important;
    color:inherit!important;fill:none!important;stroke:currentColor!important;stroke-width:1.8!important;stroke-linecap:round!important;stroke-linejoin:round!important;
}
#mega-re-app .mar-work-composer.mar-composer :is(.mar-send,.mar-record-finish) svg {stroke-width:2!important;}
#mega-re-app .mar-work-composer.mar-composer .mar-record-stop-square {
    display:block!important;width:14px!important;height:14px!important;border-radius:3px!important;background:currentColor!important;
}
#mega-re-app .mar-work-composer.mar-composer :is(.mar-attachment-menu-wrap,.mar-composer-model-wrap) {position:relative!important;flex:0 0 auto!important;}
#mega-re-app .mar-work-composer.mar-composer .mar-composer-model-wrap {margin-left:auto!important;min-width:0!important;max-width:calc(100% - 142px)!important;}
#mega-re-app .mar-work-composer.mar-composer .mar-composer-model {
    --mar-control-bg:rgba(127,127,127,.12);--mar-control-ink:var(--mar-text);
    display:flex!important;align-items:center!important;gap:3px!important;max-width:100%!important;
    min-height:44px!important;padding:6px 8px!important;border:0!important;border-radius:12px!important;
    background:transparent!important;color:inherit!important;box-shadow:none!important;cursor:pointer!important;
    font-family:var(--mar-composer-font)!important;font-size:13px!important;font-weight:500!important;line-height:1.3!important;
}
#mega-re-app .mar-work-composer.mar-composer .mar-composer-model span {overflow:hidden!important;text-overflow:ellipsis!important;white-space:nowrap!important;max-width:230px!important;}
#mega-re-app .mar-work-composer.mar-composer .mar-composer-model svg {flex:0 0 16px!important;width:16px!important;height:16px!important;fill:none!important;stroke:currentColor!important;stroke-width:1.5!important;}
#mega-re-app .mar-work-composer.mar-composer :is(.mar-attachment-menu,.mar-composer-model-info) {
    position:absolute!important;bottom:calc(100% + 14px)!important;left:0!important;right:auto!important;
    box-sizing:border-box!important;z-index:80!important;width:260px!important;max-width:calc(100vw - 32px)!important;
    max-height:min(320px,calc(100dvh - 150px))!important;overflow-y:auto!important;
    padding:9px!important;border:1px solid var(--mar-border)!important;border-radius:22px!important;
    background:var(--mar-surface)!important;color:var(--mar-text)!important;
    box-shadow:0 12px 36px rgba(0,0,0,.20)!important;
    font-family:var(--mar-composer-font)!important;
}
#mega-re-app .mar-work-composer.mar-composer .mar-attachment-menu button {
    --mar-control-bg:rgba(127,127,127,.12);--mar-control-ink:var(--mar-text);
    display:flex!important;align-items:center!important;gap:12px!important;box-sizing:border-box!important;width:100%!important;
    min-height:58px!important;margin:0!important;padding:8px 10px!important;
    border:0!important;border-radius:14px!important;background:transparent!important;color:inherit!important;
    font:500 16px/1.3 var(--mar-composer-font)!important;box-shadow:none!important;cursor:pointer!important;text-align:left!important;
}
#mega-re-app .mar-work-composer.mar-composer .mar-menu-icon {
    display:grid!important;place-items:center!important;flex:0 0 40px!important;width:40px!important;height:40px!important;
    border-radius:50%!important;background:rgba(127,127,127,.12)!important;color:inherit!important;
}
#mega-re-app .mar-work-composer.mar-composer .mar-menu-icon svg {width:22px!important;height:22px!important;fill:none!important;stroke:currentColor!important;stroke-width:1.6!important;stroke-linecap:round!important;stroke-linejoin:round!important;}
#mega-re-app .mar-work-composer.mar-composer .mar-composer-model-info {
    display:flex!important;flex-direction:column!important;gap:9px!important;left:auto!important;right:0!important;
    width:270px!important;padding:18px!important;border-radius:18px!important;font-size:14px!important;line-height:1.4!important;overflow-wrap:anywhere!important;
}
#mega-re-app .mar-work-composer.mar-composer .mar-composer-model-info strong {font-size:14px!important;font-weight:600!important;}
#mega-re-app .mar-work-composer.mar-composer .mar-composer-model-info small {font-size:13px!important;color:var(--mar-muted)!important;}
#mega-re-app .mar-work-composer.mar-composer .mar-voice-recorder {
    display:flex!important;align-items:center!important;gap:7px!important;box-sizing:border-box!important;
    width:100%!important;min-height:66px!important;margin:0!important;padding:10px!important;
}
#mega-re-app .mar-work-composer.mar-composer .mar-waveform {
    display:flex!important;align-items:center!important;justify-content:space-between!important;gap:2px!important;
    flex:1 1 auto!important;min-width:0!important;width:auto!important;height:38px!important;margin:0!important;padding:0 4px!important;overflow:hidden!important;
}
#mega-re-app .mar-work-composer.mar-composer .mar-waveform span {
    display:block!important;flex:0 1 3px!important;width:3px!important;min-width:2px!important;max-height:32px!important;
    border-radius:8px!important;background:currentColor!important;
}
#mega-re-app .mar-work-composer.mar-composer [hidden] {display:none!important;}
#mega-re-app .mar-composer-note {max-width:820px!important;margin:9px auto 0!important;padding:0 4px!important;text-align:center!important;font:400 11px/1.4 var(--mar-composer-font)!important;color:var(--mar-muted)!important;}
#mega-re-app .mar-work-composer.mar-composer .mar-attachment-tray {padding:12px 12px 0!important;margin:0!important;border:0!important;}
#mega-re-app .mar-work-composer.mar-composer .mar-attachment-tray-head {display:flex!important;justify-content:flex-end!important;margin:0 0 5px!important;font-size:11px!important;color:var(--mar-muted)!important;}
#mega-re-app .mar-work-composer.mar-composer .mar-attachment-tray-head strong {display:none!important;}
#mega-re-app .mar-work-composer.mar-composer .mar-attachment-grid {display:flex!important;gap:9px!important;overflow-x:auto!important;overflow-y:hidden!important;padding:4px 2px 8px!important;grid-template-columns:none!important;}
#mega-re-app .mar-work-composer.mar-composer .mar-attachment-card {
    position:relative!important;flex:0 0 104px!important;box-sizing:border-box!important;width:104px!important;min-width:104px!important;
    height:104px!important;min-height:0!important;padding:0!important;border:1px solid var(--mar-border)!important;border-radius:16px!important;
    background:rgba(127,127,127,.08)!important;overflow:visible!important;box-shadow:none!important;
}
#mega-re-app .mar-work-composer.mar-composer .mar-attachment-open {
    --mar-control-bg:rgba(127,127,127,.06);--mar-control-ink:var(--mar-text);
    display:flex!important;flex-direction:column!important;box-sizing:border-box!important;width:100%!important;height:100%!important;
    padding:0!important;border:0!important;border-radius:15px!important;background:transparent!important;color:inherit!important;overflow:hidden!important;cursor:pointer!important;
}
#mega-re-app .mar-work-composer.mar-composer .mar-attachment-thumb {position:relative!important;display:grid!important;place-items:center!important;flex:1 1 auto!important;width:100%!important;min-height:0!important;height:76px!important;}
#mega-re-app .mar-work-composer.mar-composer .mar-attachment-thumb :is(img,video) {display:block!important;width:100%!important;height:76px!important;object-fit:cover!important;}
#mega-re-app .mar-work-composer.mar-composer .mar-attachment-kind {font-size:13px!important;font-weight:600!important;color:var(--mar-muted)!important;}
#mega-re-app .mar-work-composer.mar-composer .mar-attachment-name {display:block!important;box-sizing:border-box!important;flex:0 0 auto!important;width:100%!important;padding:6px!important;font:400 11px/1.2 var(--mar-composer-font)!important;overflow:hidden!important;text-overflow:ellipsis!important;white-space:nowrap!important;}
#mega-re-app .mar-work-composer.mar-composer .mar-attachment-remove {
    --mar-control-bg:#3C2365;--mar-control-ink:#fff;
    display:grid!important;place-items:center!important;position:absolute!important;top:-4px!important;right:-4px!important;
    width:25px!important;height:25px!important;min-width:25px!important;margin:0!important;padding:0!important;
    border:2px solid var(--mar-surface)!important;border-radius:50%!important;background:#3C2365!important;color:#fff!important;
    font:400 18px/1 var(--mar-composer-font)!important;cursor:pointer!important;z-index:1!important;
}
#mega-re-app .mar-video-play {position:absolute!important;inset:0!important;display:grid!important;place-items:center!important;color:#fff!important;font-size:22px!important;text-shadow:0 1px 6px #000!important;pointer-events:none!important;}
#mega-re-app .mar-sent-attachment.is-video {position:relative!important;width:140px!important;overflow:hidden!important;}
#mega-re-app .mar-sent-attachment.is-video video {display:block!important;width:100%!important;height:94px!important;object-fit:cover!important;border-radius:12px!important;}
#mega-re-app .mar-sent-attachment.is-video small {display:block!important;overflow:hidden!important;text-overflow:ellipsis!important;white-space:nowrap!important;}
#mega-re-app .mar-file-preview-body video {display:block!important;max-width:100%!important;width:100%!important;max-height:65dvh!important;margin:auto!important;object-fit:contain!important;background:#111!important;border-radius:12px!important;}
#mega-re-app .mar-video-note {padding:0 8px!important;color:var(--mar-muted)!important;font:400 13px/1.5 var(--mar-composer-font)!important;}
#mega-re-app .mar-message :is(.mar-bubble,.mar-rich-response,.mar-rich-response p,.mar-rich-response li,.mar-rich-response strong) {
    font-family:var(--mar-composer-font)!important;font-size:calc(16px * var(--mar-reading-scale,var(--mar-direct-font-scale,1)))!important;line-height:1.65!important;
}
@media(max-width:860px){
    #mega-re-app .mar-composer-area {padding:8px 10px max(9px,env(safe-area-inset-bottom))!important;}
    #mega-re-app .mar-work-composer.mar-composer .mar-composer-input-row {padding:11px 8px 7px!important;gap:5px!important;}
    #mega-re-app .mar-work-composer.mar-composer .mar-composer-toolbar {gap:1px!important;}
    #mega-re-app .mar-work-composer.mar-composer .mar-composer-model {padding:6px 5px!important;font-size:12px!important;}
    #mega-re-app .mar-work-composer.mar-composer .mar-composer-model span {max-width:150px!important;}
    #mega-re-app .mar-work-composer.mar-composer .mar-composer-model-info {right:-40px!important;width:245px!important;}
    #mega-re-app .mar-work-composer.mar-composer .mar-voice-recorder {gap:4px!important;padding:8px!important;min-height:62px!important;}
    #mega-re-app .mar-composer-note {font-size:10px!important;margin-top:7px!important;}
}
@media(prefers-reduced-motion:reduce){
    #mega-re-app .mar-work-composer.mar-composer * {transition:none!important;}
}

/* v2.7.26-beta.3: Chrome/Android already paints the native installation splash. */
@media (display-mode:standalone), (display-mode:fullscreen){
 #marMobileSplash.mar-splash-boot,#marMobileSplash.is-visible{display:none!important}
}

/* Beta.5: accessible strategic Markdown presentation (without arbitrary model HTML). */
.mar-rich-response .mar-rich-heading{font-weight:750;line-height:1.3;letter-spacing:-.018em;margin:1.3em 0 .55em;color:inherit}
.mar-rich-response h1.mar-rich-heading{font-size:1.35em}.mar-rich-response h2.mar-rich-heading{font-size:1.22em}.mar-rich-response h3.mar-rich-heading{font-size:1.08em}
.mar-rich-response .mar-rich-table-wrap{overflow-x:auto;max-width:100%;margin:14px 0 18px;border:1px solid color-mix(in srgb,currentColor 16%,transparent);border-radius:12px}
.mar-rich-response .mar-rich-table{width:100%;min-width:360px;border-collapse:collapse;font-size:.93em;text-align:left}
.mar-rich-response .mar-rich-table th,.mar-rich-response .mar-rich-table td{padding:11px 13px;vertical-align:top;border-bottom:1px solid color-mix(in srgb,currentColor 11%,transparent);overflow-wrap:break-word}
.mar-rich-response .mar-rich-table th{font-weight:700;background:color-mix(in srgb,#7452a4 10%,transparent)}
.mar-rich-response .mar-rich-table tbody tr:last-child td{border-bottom:0}
.mar-rich-response .mar-rich-table tbody tr:nth-child(even){background:color-mix(in srgb,currentColor 3%,transparent)}
.mar-rich-response .mar-rich-note{padding:13px 15px;margin:14px 0;border-left:3px solid #8a65b5;background:color-mix(in srgb,#8a65b5 10%,transparent);border-radius:0 9px 9px 0;line-height:1.6}
.mar-rich-response .mar-rich-note.is-warning{border-color:#bb861c;background:color-mix(in srgb,#bb861c 9%,transparent)}
.mar-rich-response .mar-rich-list{padding-left:1.6em;margin:12px 0;line-height:1.65}.mar-rich-response .mar-rich-list li{margin:.35em 0}
.mar-rich-response .mar-rich-code{background:color-mix(in srgb,currentColor 7%,transparent);padding:14px;border-radius:10px;overflow-x:auto;line-height:1.5;font-size:.9em}
.mar-rich-response .mar-rich-rule{border:0;border-top:1px solid color-mix(in srgb,currentColor 16%,transparent);margin:19px 0}
@media(max-width:540px){.mar-rich-response .mar-rich-table{font-size:.87em}.mar-rich-response .mar-rich-table th,.mar-rich-response .mar-rich-table td{padding:10px}}

.mar-rich-response .mar-rich-note{display:flex;align-items:flex-start;gap:10px}
.mar-rich-response .mar-rich-note svg{width:16px;height:16px;flex:0 0 16px;margin-top:4px}
.mar-rich-response .mar-rich-status{display:inline-block;border-radius:999px;font-size:.81em;font-weight:650;line-height:1.4;padding:3px 9px;white-space:nowrap;background:color-mix(in srgb,currentColor 8%,transparent)}
.mar-rich-response .mar-rich-status.is-success{color:#19804a;background:color-mix(in srgb,#19804a 12%,transparent)}
.mar-rich-response .mar-rich-status.is-warning{color:#9e6812;background:color-mix(in srgb,#b57c19 13%,transparent)}
.mar-rich-response .mar-rich-status.is-muted{color:inherit;opacity:.7}

/* 2.7.27-beta.28: perfil público do agente compartilhado. */
.mar-direct-agent-mode .mar-welcome.mar-direct-agent-profile{display:flex!important;visibility:visible!important;opacity:1!important;max-width:900px;margin:clamp(20px,5vh,64px) auto 24px;padding:8px 18px 20px;text-align:center;flex-direction:column;align-items:center;gap:8px}
.mar-direct-agent-mode .mar-direct-agent-identity{width:100%;display:flex;flex-direction:column;align-items:center;gap:8px}
.mar-direct-agent-mode .mar-direct-agent-avatar{width:76px;height:76px;border-radius:50%;overflow:hidden;background:var(--mar-accent,#3C2365);display:grid;place-items:center;border:2px solid rgba(255,255,255,.18);box-shadow:0 5px 24px rgba(60,35,101,.25)}
.mar-direct-agent-mode .mar-direct-agent-avatar img{width:100%;height:100%;object-fit:cover;display:block}
.mar-direct-agent-mode .mar-direct-agent-avatar span{font-size:30px;font-weight:700;color:#fff}
.mar-direct-agent-mode .mar-direct-agent-identity h1{margin:4px 0 0;font-size:clamp(24px,3vw,34px);line-height:1.2;font-weight:600;color:var(--mar-text,#fff)}
.mar-direct-agent-mode .mar-direct-agent-theme{margin:0;color:var(--mar-muted,#b9b9c2);font-size:15px}
.mar-direct-agent-mode .mar-direct-agent-identity small{color:var(--mar-muted,#9b9ba5);font-size:12px}
.mar-direct-agent-mode .mar-direct-agent-intro{max-width:680px;margin-top:8px;color:var(--mar-text,#eee);font-size:15px;line-height:1.6}
@media(max-width:600px){.mar-direct-agent-mode .mar-welcome.mar-direct-agent-profile{margin:14px auto 16px;padding:4px 12px 12px}.mar-direct-agent-mode .mar-direct-agent-avatar{width:64px;height:64px}.mar-direct-agent-mode .mar-direct-agent-intro{font-size:14px}}

/* =========================================================
   2.7.27-beta.29 — fundo preto e experiência pública dedicada
   para links compartilhados de agentes personalizados.
   ========================================================= */
html.mar-direct-agent-public,
body.mar-direct-agent-public{
    background:#000!important;
    margin:0!important;
    padding:0!important;
    overflow:hidden!important;
}
body.mar-direct-agent-public #page,
body.mar-direct-agent-public #content,
body.mar-direct-agent-public .site,
body.mar-direct-agent-public .site-main,
body.mar-direct-agent-public .entry-content{
    background:#000!important;
    margin:0!important;
    padding:0!important;
    max-width:none!important;
    width:100%!important;
}
#mega-re-app[data-theme="dark"]{
    --mar-bg:#000!important;
}
#mega-re-app[data-theme="dark"]>.mar-main,
#mega-re-app[data-theme="dark"]>.mar-main>.mar-content,
#mega-re-app[data-theme="dark"]>.mar-main>.mar-composer-area,
#mega-re-app[data-theme="dark"] .mar-view,
#mega-re-app[data-theme="dark"] .mar-chat-view{
    background:#000!important;
}
#mega-re-app[data-theme="dark"] .mar-composer{
    background:#23242a!important;
}
#mega-re-app.mar-direct-agent-mode.mar-direct-agent-ready{
    display:block!important;
    position:relative!important;
    inset:auto!important;
    width:100vw!important;
    max-width:none!important;
    height:var(--mar-app-height,100dvh)!important;
    min-height:var(--mar-app-height,100dvh)!important;
    overflow:hidden!important;
    background:#000!important;
    color:#fff!important;
}
#mega-re-app.mar-direct-agent-mode.mar-direct-agent-ready>.mar-sidebar,
#mega-re-app.mar-direct-agent-mode.mar-direct-agent-ready>.mar-topbar,
#mega-re-app.mar-direct-agent-mode.mar-direct-agent-ready>.mar-backdrop,
#mega-re-app.mar-direct-agent-mode.mar-direct-agent-ready>.mar-mobile-splash{
    display:none!important;
    visibility:hidden!important;
}
#mega-re-app.mar-direct-agent-mode.mar-direct-agent-ready>.mar-main{
    display:grid!important;
    position:relative!important;
    inset:auto!important;
    width:100%!important;
    max-width:none!important;
    height:100%!important;
    min-height:0!important;
    margin:0!important;
    padding:0!important;
    grid-template-columns:minmax(0,1fr)!important;
    grid-template-rows:minmax(0,1fr) auto!important;
    grid-template-areas:none!important;
    background:#000!important;
    overflow:hidden!important;
}
#mega-re-app.mar-direct-agent-mode.mar-direct-agent-ready>.mar-main>.mar-content{
    width:100%!important;
    min-width:0!important;
    min-height:0!important;
    height:auto!important;
    overflow-y:auto!important;
    padding:clamp(22px,5vh,60px) clamp(14px,3vw,34px) 22px!important;
    background:#000!important;
}
#mega-re-app.mar-direct-agent-mode.mar-direct-agent-ready #marChatView{
    display:flex!important;
    width:100%!important;
    min-height:100%!important;
    flex-direction:column!important;
    align-items:center!important;
    background:#000!important;
}
#mega-re-app.mar-direct-agent-mode.mar-direct-agent-ready .mar-welcome.mar-direct-agent-profile{
    display:flex!important;
    visibility:visible!important;
    opacity:1!important;
    width:min(980px,100%)!important;
    max-width:980px!important;
    margin:clamp(18px,5vh,58px) auto 24px!important;
    padding:0 12px 12px!important;
    flex-direction:column!important;
    align-items:center!important;
    gap:8px!important;
    text-align:center!important;
    background:transparent!important;
    border:0!important;
    border-radius:0!important;
    box-shadow:none!important;
}
#mega-re-app.mar-direct-agent-mode.mar-direct-agent-ready .mar-direct-agent-identity{
    display:flex!important;
    width:100%!important;
    flex-direction:column!important;
    align-items:center!important;
    gap:8px!important;
    background:transparent!important;
}
#mega-re-app.mar-direct-agent-mode.mar-direct-agent-ready .mar-direct-agent-avatar{
    display:grid!important;
    width:82px!important;
    height:82px!important;
    flex:0 0 82px!important;
    margin:0 auto 6px!important;
    border-radius:50%!important;
    overflow:hidden!important;
    background:#292038!important;
}
#mega-re-app.mar-direct-agent-mode.mar-direct-agent-ready .mar-direct-agent-identity h1{
    margin:2px 0 0!important;
    color:#fff!important;
    font-size:clamp(23px,3vw,34px)!important;
    font-weight:650!important;
    line-height:1.2!important;
    text-align:center!important;
}
#mega-re-app.mar-direct-agent-mode.mar-direct-agent-ready .mar-direct-agent-theme{
    margin:0!important;
    color:#d2d2d8!important;
    font-size:15px!important;
    text-align:center!important;
}
#mega-re-app.mar-direct-agent-mode.mar-direct-agent-ready .mar-direct-agent-identity small{
    color:#a7a7b0!important;
    font-size:12px!important;
}
#mega-re-app.mar-direct-agent-mode.mar-direct-agent-ready .mar-direct-agent-intro{
    max-width:720px!important;
    margin:8px auto 0!important;
    color:#f1f1f4!important;
    font-size:15px!important;
    line-height:1.6!important;
    text-align:center!important;
}
#mega-re-app.mar-direct-agent-mode.mar-direct-agent-ready .mar-messages{
    width:min(820px,100%)!important;
    max-width:820px!important;
    margin:0 auto!important;
}
#mega-re-app.mar-direct-agent-mode.mar-direct-agent-ready>.mar-main>.mar-composer-area{
    position:relative!important;
    inset:auto!important;
    width:100%!important;
    margin:0!important;
    padding:10px max(14px,env(safe-area-inset-right)) max(14px,env(safe-area-inset-bottom)) max(14px,env(safe-area-inset-left))!important;
    background:#000!important;
    border:0!important;
    box-shadow:none!important;
    z-index:10!important;
}
#mega-re-app.mar-direct-agent-mode.mar-direct-agent-ready .mar-composer{
    width:min(820px,100%)!important;
    max-width:820px!important;
    margin:0 auto!important;
    min-height:68px!important;
    background:#23242a!important;
    border:1px solid #3a3a42!important;
    border-radius:28px!important;
}
#mega-re-app.mar-direct-agent-mode.mar-direct-agent-ready .mar-composer textarea{
    color:#fff!important;
    background:transparent!important;
}
#mega-re-app.mar-direct-agent-mode.mar-direct-agent-ready .mar-composer-note{
    margin-top:8px!important;
    color:#92929b!important;
    text-align:center!important;
}
@media(max-width:650px){
    #mega-re-app.mar-direct-agent-mode.mar-direct-agent-ready>.mar-main>.mar-content{
        padding:22px 12px 12px!important;
    }
    #mega-re-app.mar-direct-agent-mode.mar-direct-agent-ready .mar-welcome.mar-direct-agent-profile{
        margin:16px auto 18px!important;
        padding:0 8px 8px!important;
    }
    #mega-re-app.mar-direct-agent-mode.mar-direct-agent-ready .mar-direct-agent-avatar{
        width:72px!important;height:72px!important;flex-basis:72px!important;
    }
    #mega-re-app.mar-direct-agent-mode.mar-direct-agent-ready .mar-direct-agent-intro{
        font-size:14px!important;
    }
    #mega-re-app.mar-direct-agent-mode.mar-direct-agent-ready>.mar-main>.mar-composer-area{
        padding:8px 10px max(10px,env(safe-area-inset-bottom))!important;
    }
    #mega-re-app.mar-direct-agent-mode.mar-direct-agent-ready .mar-composer{
        min-height:62px!important;border-radius:24px!important;
    }
}

#mega-re-app.mar-direct-agent-mode.mar-direct-agent-ready #marLayoutTestBadge,
#mega-re-app.mar-direct-agent-mode.mar-direct-agent-ready .mar-layout-test-badge{display:none!important}


/* Mega Rê beta30: fundo preto integral e interface pública sem superfícies cinza externas */
#mega-re-app[data-theme="dark"], #mega-re-app[data-theme="dark"] .mar-main, #mega-re-app[data-theme="dark"] .mar-content, #mega-re-app[data-theme="dark"] .mar-view, #mega-re-app[data-theme="dark"] #marChatView, #mega-re-app[data-theme="dark"] .mar-composer-area {background:#000!important;}
#mega-re-app[data-theme="dark"] .mar-composer {background:#23242a!important;}
#mega-re-app .mar-composer-model-wrap[hidden] {display:none!important;}
body.mar-direct-agent-public, body.mar-direct-agent-public #page, body.mar-direct-agent-public .site, body.mar-direct-agent-public .site-content, body.mar-direct-agent-public .content-area, body.mar-direct-agent-public .entry-content {background:#000!important;}
#mega-re-app.mar-direct-agent-mode.mar-direct-agent-ready, #mega-re-app.mar-direct-agent-mode.mar-direct-agent-ready>.mar-main, #mega-re-app.mar-direct-agent-mode.mar-direct-agent-ready>.mar-main>.mar-content, #mega-re-app.mar-direct-agent-mode.mar-direct-agent-ready #marChatView, #mega-re-app.mar-direct-agent-mode.mar-direct-agent-ready>.mar-main>.mar-composer-area {background:#000!important;}
#mega-re-app.mar-direct-agent-mode.mar-direct-agent-ready .mar-welcome.mar-direct-agent-profile {margin:4px auto 24px!important;}
.mar-form-voice-status.is-recording {display:flex;align-items:center;gap:10px;min-height:42px;padding:9px 12px;border:1px solid #6841a0;border-radius:12px;color:#eee;background:#21172f;}
.mar-form-live-dot {width:9px;height:9px;flex:0 0 9px;border-radius:50%;background:#ff5252;box-shadow:0 0 0 5px #ff525222;animation:marFormPulse 1s infinite;}
.mar-form-wave {display:inline-flex;align-items:center;gap:3px;height:25px;}
.mar-form-wave i {display:block;width:3px;height:8px;border-radius:3px;background:#bd91ff;animation:marFormWave .65s ease-in-out infinite alternate;}
.mar-form-wave i:nth-child(2n){animation-delay:.18s}.mar-form-wave i:nth-child(3n){animation-delay:.34s}.mar-form-wave i:nth-child(4n){animation-delay:.1s}
.mar-form-voice-actions button.is-recording {background:#572d35!important;border-color:#a84a55!important;color:#fff!important;}
@keyframes marFormWave {from{height:5px}to{height:23px}} @keyframes marFormPulse {50%{opacity:.45;transform:scale(.82)}}


/* Mega Rê beta31: fundo preto integral em toda a experiência de conversa.
   O compositor permanece em cinza-carvão, conforme aprovado. */
html, body.mar-standalone-page, body.mar-standalone-page #page,
body.mar-standalone-page #content, body.mar-standalone-page .site,
body.mar-standalone-page .site-content, body.mar-standalone-page .content-area,
body.mar-standalone-page .entry-content { background:#000!important; }
#mega-re-app[data-theme="dark"], #mega-re-app[data-theme="dark"] .mar-main,
#mega-re-app[data-theme="dark"] .mar-content, #mega-re-app[data-theme="dark"] .mar-view,
#mega-re-app[data-theme="dark"] .mar-chat-view, #mega-re-app[data-theme="dark"] #marChatView,
#mega-re-app[data-theme="dark"] .mar-composer-area, #mega-re-app[data-theme="dark"] .mar-direct-greeting,
#mega-re-app[data-theme="dark"] .mar-welcome, #mega-re-app[data-theme="dark"] .mar-history-view,
#mega-re-app[data-theme="dark"] .mar-agent-materials-view { background:#000!important; }
#mega-re-app[data-theme="dark"] .mar-composer,
#mega-re-app[data-theme="dark"] .mar-direct-agent-mode .mar-composer { background:#24252b!important; }
body.mar-direct-agent-public, body.mar-direct-agent-public #mega-re-app,
body.mar-direct-agent-public #mega-re-app .mar-main,
body.mar-direct-agent-public #mega-re-app .mar-content,
body.mar-direct-agent-public #mega-re-app .mar-view,
body.mar-direct-agent-public #mega-re-app #marChatView,
body.mar-direct-agent-public #mega-re-app .mar-composer-area,
body.mar-direct-agent-public #mega-re-app .mar-welcome,
body.mar-direct-agent-public #mega-re-app .mar-direct-greeting { background:#000!important; }
body.mar-direct-agent-public #mega-re-app .mar-composer { background:#24252b!important; }

/* Mega Rê beta32: modo escuro integral, sem faixas cinza do tema WordPress.
   Não altera dimensões, ordem ou controles do compositor original. */
html.mar-megare-dark,
body.mar-megare-dark,
body.mar-megare-dark #page,
body.mar-megare-dark #content,
body.mar-megare-dark .site,
body.mar-megare-dark .site-content,
body.mar-megare-dark .content-area,
body.mar-megare-dark .entry-content,
body.mar-megare-dark .wp-site-blocks,
body.mar-megare-dark .elementor,
body.mar-megare-dark .elementor-section-wrap,
body.mar-megare-dark .elementor-widget-wrap {
    background:#000!important;
}
#mega-re-app[data-theme="dark"],
#mega-re-app[data-theme="dark"] > .mar-main,
#mega-re-app[data-theme="dark"] > .mar-main > .mar-topbar,
#mega-re-app[data-theme="dark"] > .mar-main > .mar-content,
#mega-re-app[data-theme="dark"] > .mar-main > .mar-content > .mar-view,
#mega-re-app[data-theme="dark"] > .mar-main > .mar-content > .mar-view.is-active,
#mega-re-app[data-theme="dark"] > .mar-main > .mar-composer-area,
#mega-re-app[data-theme="dark"] .mar-layout-workspace,
#mega-re-app[data-theme="dark"] #marChatView,
#mega-re-app[data-theme="dark"] #marAgentsView,
#mega-re-app[data-theme="dark"] #marAgentMaterialsView,
#mega-re-app[data-theme="dark"] #marPersonalContextView,
#mega-re-app[data-theme="dark"] #marAccountView,
#mega-re-app[data-theme="dark"] #marOwnerView,
#mega-re-app[data-theme="dark"] #marDirectHistoryView,
#mega-re-app[data-theme="dark"] #marDirectSettingsView {
    background-color:#000!important;
    background-image:none!important;
}
#mega-re-app[data-theme="dark"] .mar-composer,
#mega-re-app[data-theme="dark"] .mar-composer-box {
    background:#24252b!important;
}
#mega-re-app[data-theme="dark"] .mar-composer textarea {
    background:transparent!important;
}
/* A faixa inferior do tema não deve pintar a área externa do campo de mensagem. */
body.mar-megare-dark #mega-re-app .mar-composer-area::before,
body.mar-megare-dark #mega-re-app .mar-composer-area::after {
    background:transparent!important;
    box-shadow:none!important;
}


/* Mega Rê beta36: gravação simplificada sem controles duplicados. */
#mega-re-app .mar-composer-input-row[hidden] { display:none!important; }
#mega-re-app .mar-voice-recorder[hidden] { display:none!important; }
#mega-re-app .mar-voice-recorder {
    display:flex!important;align-items:center!important;gap:10px!important;
    width:100%!important;min-height:58px!important;padding:5px 3px!important;
}
#mega-re-app .mar-voice-recorder .mar-record-delete {
    flex:0 0 38px!important;width:38px!important;height:38px!important;
}
#mega-re-app .mar-voice-recorder .mar-waveform {
    flex:1 1 auto!important;min-width:0!important;width:auto!important;
    display:flex!important;align-items:center!important;justify-content:center!important;
    gap:3px!important;height:42px!important;overflow:hidden!important;
}
#mega-re-app .mar-voice-recorder .mar-waveform span {
    flex:0 0 3px!important;width:3px!important;max-height:34px!important;
    border-radius:8px!important;
}
#mega-re-app .mar-voice-recorder .mar-record-pause,
#mega-re-app .mar-voice-recorder .mar-record-finish {
    flex:0 0 48px!important;width:48px!important;height:48px!important;
    min-width:48px!important;border-radius:50%!important;
}
#mega-re-app .mar-voice-recorder .mar-record-pause[hidden],
#mega-re-app .mar-voice-recorder .mar-record-finish[hidden] { display:none!important; }
#mega-re-app .mar-voice-recorder[data-voice-phase="recording"] .mar-waveform span {
    background:#c4a4ee!important;opacity:.92!important;
}
#mega-re-app .mar-voice-recorder[data-voice-phase="ready"] .mar-waveform span {
    background:#c4a4ee!important;opacity:.72!important;
}
#mega-re-app .mar-voice-recorder[data-voice-phase="stopping"] .mar-waveform span,
#mega-re-app .mar-voice-recorder[data-voice-phase="transcribing"] .mar-waveform span {
    animation:marVoicePending .65s ease-in-out infinite alternate!important;
}
@keyframes marVoicePending { from { opacity:.35; } to { opacity:1; } }


/* Mega Rê beta37: make the ordinary composer row truly disappear while recording.
   This selector intentionally outranks the older !important display:flex rule. */
#mega-re-app .mar-work-composer.mar-composer .mar-composer-input-row[hidden] {
    display: none !important;
    visibility: hidden !important;
}
#mega-re-app .mar-work-composer.mar-composer .mar-voice-recorder[hidden] {
    display: none !important;
    visibility: hidden !important;
}
#mega-re-app .mar-work-composer.mar-composer .mar-voice-recorder .mar-record-pause {
    display: none !important;
}
#mega-re-app .mar-work-composer.mar-composer .mar-voice-recorder .mar-record-finish {
    display: grid !important;
    flex: 0 0 48px !important;
    width: 48px !important;
    height: 48px !important;
    min-width: 48px !important;
    border-radius: 50% !important;
    background: #3C2365 !important;
    color: #FFFFFF !important;
    border: 0 !important;
    place-items: center !important;
    padding: 0 !important;
}
#mega-re-app .mar-work-composer.mar-composer .mar-voice-recorder .mar-record-finish svg {
    width: 23px !important;
    height: 23px !important;
    stroke: #FFFFFF !important;
    fill: none !important;
}


/* Mega Rê beta38: cross-browser interaction and accessibility fixes. */
#mega-re-app .mar-rich-response,
#mega-re-app .mar-rich-response .mar-bubble,
#mega-re-app .mar-rich-response .mar-rich-code,
#mega-re-app .mar-rich-response .mar-rich-table-wrap,
#mega-re-app .mar-layout-workspace,
#mega-re-app .mar-layout-field :is(input,textarea,select),
#mega-re-app .mar-field :is(input,textarea,select),
#mega-re-app .mar-composer textarea,
.mar-setup-contact :is(input,textarea,select) {
    -webkit-user-select: text !important;
    user-select: text !important;
    -webkit-touch-callout: default;
}
#mega-re-app .mar-rich-response ol.mar-rich-list {
    display: block !important;
    list-style: decimal !important;
    list-style-position: outside !important;
    padding-inline-start: 2em !important;
    margin: 12px 0 !important;
    counter-reset: none !important;
}
#mega-re-app .mar-rich-response ol.mar-rich-list > li {
    display: list-item !important;
    list-style: decimal !important;
    list-style-position: outside !important;
    margin: .4em 0 !important;
}
#mega-re-app .mar-rich-response ul.mar-rich-list {
    display: block !important;
    list-style: disc !important;
    list-style-position: outside !important;
    padding-inline-start: 2em !important;
}
#mega-re-app .mar-rich-response ul.mar-rich-list > li {
    display: list-item !important;
    list-style: disc !important;
}
#mega-re-app :is(input,textarea,select,button,[role="button"],.mar-layout-field) {
    -webkit-tap-highlight-color: transparent;
}
#mega-re-app :is(input,textarea,select) {
    max-width: 100%;
    min-width: 0;
}
#mega-re-app .mar-content,
#mega-re-app .mar-layout-workspace,
#mega-re-app .mar-messages,
#mega-re-app .mar-direct-history-list {
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: contain;
}
@media (max-width: 860px) {
    /* 16px minimum prevents Safari iOS from zooming the page on input focus. */
    #mega-re-app :is(.mar-layout-field input,.mar-layout-field textarea,.mar-layout-field select,
        .mar-field input,.mar-field textarea,.mar-field select,
        .mar-layout-table input,.mar-layout-table select,
        .mar-direct-user-popover input,.mar-composer textarea,
        .mar-setup-form input,.mar-setup-form textarea,.mar-setup-form select) {
        font-size: 16px !important;
    }
    #mega-re-app.mar-layout-2718,
    #mega-re-app.mar-layout-2718 .mar-main {
        min-height: var(--mar-app-height, 100dvh) !important;
        height: var(--mar-app-height, 100dvh) !important;
        min-width: 0 !important;
    }
    #mega-re-app.mar-layout-2718 .mar-main {
        padding-bottom: env(safe-area-inset-bottom, 0px) !important;
    }
    #mega-re-app.mar-layout-2718 .mar-composer-area {
        padding-bottom: max(8px, env(safe-area-inset-bottom, 0px)) !important;
    }
    #mega-re-app.mar-layout-2718 :is(.mar-layout-field input,.mar-layout-field textarea,.mar-layout-field select) {
        width: 100% !important;
        box-sizing: border-box !important;
        min-height: 44px;
    }
}
@supports (height: 100dvh) {
    #mega-re-app.mar-layout-2718 { height: var(--mar-app-height, 100dvh) !important; }
}
@media (prefers-reduced-motion: reduce) {
    #mega-re-app * { scroll-behavior: auto !important; }
}


/* Beta39: expand iOS/Android field compatibility to custom form + agent dialogs. */
@media (max-width: 860px) {
    #mega-re-app .mar-power-workspace :is(input:not([type="checkbox"]):not([type="radio"]),textarea,select),
    #mega-re-app .mar-power-dialog-overlay :is(input:not([type="checkbox"]):not([type="radio"]),textarea,select),
    #mega-re-app .mar-agent-editor :is(input:not([type="checkbox"]):not([type="radio"]),textarea,select),
    #mega-re-app .mar-form-builder :is(input:not([type="checkbox"]):not([type="radio"]),textarea,select) {
        font-size: 16px !important;
        line-height: 1.5 !important;
        min-height: 44px;
        max-width: 100%;
        min-width: 0;
        box-sizing: border-box;
        -webkit-user-select: text;
        user-select: text;
    }
    #mega-re-app input[type="file"] {
        min-height: 44px;
        max-width: 100%;
        font-size: 16px !important;
        touch-action: manipulation;
    }
}
