#aive-root, #aive-root * {
    box-sizing: border-box;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

.aive-hidden { display: none !important; }

.aive-toggle {
    position: fixed;
    bottom: 24px;
    right: 24px;
    z-index: 999999;
    background: #6d28d9;
    color: #fff;
    border: none;
    border-radius: 999px;
    padding: 12px 20px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    box-shadow: 0 6px 20px rgba(0,0,0,.25);
}
.aive-toggle.aive-active { background: #dc2626; }

/* Dentro do editor do Elementor, o botão fica um pouco mais para cima para não colar
   na borda inferior do quadro (iframe) de edição do Elementor. */
body.aive-inside-elementor .aive-toggle { bottom: 70px; }

.aive-hover-box {
    position: absolute;
    z-index: 999998;
    outline: 2px solid #6d28d9;
    background: rgba(109,40,217,0.08);
    pointer-events: none;
}

body.aive-edit-mode { cursor: crosshair; }

.aive-savebar {
    position: fixed;
    top: 0; left: 0; right: 0;
    z-index: 999997;
    background: #111827;
    color: #fff;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 20px;
    font-size: 14px;
}
.aive-savebar-label { font-weight: 600; }
.aive-verify-badge {
    font-size: 11px;
    font-weight: 600;
    padding: 3px 8px;
    border-radius: 999px;
    white-space: nowrap;
}
.aive-verify-ok { background: rgba(34,197,94,0.15); color: #4ade80; }
.aive-verify-warn { background: rgba(245,158,11,0.18); color: #fbbf24; }
.aive-dot {
    width: 8px; height: 8px; border-radius: 50%;
    background: #22c55e;
    display: inline-block;
    animation: aive-blink 1.4s infinite;
}
@keyframes aive-blink { 0%,100% { opacity: 1; } 50% { opacity: .3; } }
.aive-counter {
    flex: 1;
    font-size: 12px;
    color: #9ca3af;
}

.aive-btn {
    border: none;
    border-radius: 6px;
    padding: 8px 14px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    white-space: nowrap;
}
.aive-btn-primary { background: #6d28d9; color: #fff; }
.aive-btn-success { background: #16a34a; color: #fff; }
.aive-btn-danger { background: #dc2626; color: #fff; }
.aive-btn-ghost { background: transparent; color: #fff; border: 1px solid rgba(255,255,255,.4); }
.aive-btn-disabled, .aive-btn:disabled { opacity: 0.6; cursor: not-allowed; }
.aive-full { width: 100%; margin-top: 8px; }

.aive-remove-row { margin-bottom: 8px; display: flex; flex-direction: column; gap: 6px; }
.aive-remove-row .aive-full { margin-top: 0; }

.aive-radius-wrap { margin-top: 12px; }
.aive-radius-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 8px;
}
.aive-link-toggle {
    border: 1px solid #e5e7eb;
    background: #f9fafb;
    border-radius: 6px;
    width: 28px;
    height: 28px;
    cursor: pointer;
    font-size: 13px;
    opacity: .45;
}
.aive-link-toggle.aive-link-active { opacity: 1; border-color: #6d28d9; background: #ede9fe; }
.aive-radius-body { display: flex; align-items: center; gap: 8px; }
.aive-radius-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 6px;
    flex: 1;
}
.aive-radius-grid input {
    width: 100%;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    padding: 6px 8px;
    font-size: 13px;
}
.aive-radius-unit {
    border: 1px solid #d1d5db;
    border-radius: 6px;
    padding: 6px 4px;
    font-size: 12px;
    background: #fff;
}

.aive-icon-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 8px;
    margin-top: 8px;
}
.aive-icon-card {
    border: 1px solid #e5e7eb;
    border-radius: 6px;
    background: #fff;
    padding: 8px 4px;
    text-align: center;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    color: #374151;
}
.aive-icon-card:hover { border-color: #6d28d9; background: #faf5ff; color: #6d28d9; }
.aive-icon-card svg { display: block; }
.aive-icon-card span:last-child { font-size: 9px; color: #6b7280; line-height: 1.2; }

.aive-panel {
    position: fixed;
    top: 50px;
    right: 0;
    bottom: 0;
    width: 340px;
    background: #fff;
    color: #111827;
    z-index: 999996;
    box-shadow: -4px 0 20px rgba(0,0,0,.15);
    overflow-y: auto;
    padding: 16px;
}
.aive-panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}
.aive-close {
    background: none; border: none; font-size: 20px; cursor: pointer; line-height: 1;
}
.aive-tag-label {
    display: inline-block;
    background: #f3f4f6;
    border-radius: 4px;
    padding: 2px 8px;
    font-size: 12px;
    font-family: monospace;
    margin-bottom: 12px;
}
.aive-section {
    border-top: 1px solid #e5e7eb;
    padding-top: 12px;
    margin-top: 12px;
}
.aive-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 8px;
    font-size: 13px;
}
.aive-section label { display: block; font-size: 13px; font-weight: 600; margin-bottom: 6px; }
.aive-section textarea {
    width: 100%;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    padding: 8px;
    font-size: 13px;
    resize: vertical;
}
.aive-status { font-size: 12px; color: #6b7280; margin-top: 6px; min-height: 16px; }
.aive-action-row { display: flex; gap: 8px; margin-top: 10px; }

.aive-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    border-bottom: 1px solid #e5e7eb;
    padding-bottom: 8px;
    margin-bottom: 4px;
}
.aive-tab {
    background: #f3f4f6;
    border: none;
    border-radius: 6px;
    padding: 6px 10px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    color: #374151;
}
.aive-tab-active { background: #6d28d9; color: #fff; }

.aive-subtabs { display: flex; gap: 6px; margin-bottom: 10px; }
.aive-subtab {
    flex: 1;
    background: #f9fafb;
    border: 1px solid #e5e7eb;
    border-radius: 6px;
    padding: 6px;
    font-size: 12px;
    cursor: pointer;
}
.aive-subtab-active { background: #ede9fe; border-color: #6d28d9; color: #6d28d9; font-weight: 600; }

.aive-hint { font-size: 12px; color: #6b7280; margin-bottom: 10px; }

.aive-divider { border-top: 1px dashed #e5e7eb; margin: 14px 0; }

.aive-font-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
}
.aive-font-card {
    border: 1px solid #e5e7eb;
    border-radius: 6px;
    background: #fff;
    padding: 10px 6px;
    text-align: center;
    cursor: pointer;
    font-size: 15px;
}
.aive-font-card:hover { border-color: #6d28d9; background: #faf5ff; }
.aive-font-card small { font-size: 10px; color: #6b7280; }

.aive-radius-slider-row {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 10px;
}
.aive-radius-slider-row input[type="range"] {
    flex: 1;
    accent-color: #6d28d9;
}
.aive-radius-value {
    font-size: 12px;
    font-weight: 600;
    color: #6d28d9;
    min-width: 42px;
    text-align: right;
}

.aive-align-group {
    display: flex;
    gap: 6px;
    margin-bottom: 4px;
}
.aive-align-btn {
    flex: 1;
    border: 1px solid #e5e7eb;
    background: #f9fafb;
    border-radius: 6px;
    padding: 10px 4px;
    font-size: 15px;
    line-height: 1;
    cursor: pointer;
    color: #374151;
    position: relative;
}
.aive-align-btn .aive-align-sub { font-size: 8px; display: block; margin-top: 2px; }
.aive-align-btn:hover { border-color: #6d28d9; }
.aive-align-btn.aive-align-active { background: #ede9fe; border-color: #6d28d9; color: #6d28d9; }
@keyframes aive-elem-pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.04); }
}

body.aive-media-open #aive-root {
    display: none !important;
}

.aive-preview-pulse {
    animation: aive-pulse 1s ease-in-out 2;
    outline: 2px dashed #6d28d9;
}
@keyframes aive-pulse {
    0%, 100% { outline-color: #6d28d9; }
    50% { outline-color: #c4b5fd; }
}
