:root {
    --bg-dark: #0a0a0a;
    --card-bg: rgba(255, 255, 255, 0.05);
    --gold: #FFD700;
    --orange: #FF8C00;
    --text-primary: #ffffff;
    --text-secondary: #a0a0a0;
    --accent-red: #ff4d4d;
    --accent-green: #2ecc71;
    --accent-blue: #3498db;
    --glass-border: rgba(255, 255, 255, 0.1);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    width: 100%;
    min-width: 400px;
}

body {
    width: 100%;
    min-width: 400px;
    height: 100vh;
    background-color: var(--bg-dark);
    color: var(--text-primary);
    font-family: 'Inter', sans-serif;
    overflow-x: hidden;
}

.container {
    padding: 20px;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.container > main { flex: 1 0 auto; }
.container > footer { flex: 0 0 auto; margin-top: auto; }

header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 24px;
}

.logo-area {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-right: 4px;
}

.icon-circle {
    font-size: 24px;
    background: linear-gradient(135deg, var(--gold), var(--orange));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

h1 {
    font-size: 18px;
    font-weight: 700;
    letter-spacing: -0.5px;
}

h1 span {
    color: var(--gold);
}

/* Spacer empurra os controles para a direita */
.header-spacer { flex: 1; }

.status-badge {
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    padding: 4px 10px;
    background: var(--card-bg);
    border-radius: 20px;
    display: flex;
    align-items: center;
    gap: 6px;
    border: 1px solid var(--glass-border);
}

/* Versão "só ponto" do status (sem texto) */
.status-badge-dot {
    padding: 0;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    justify-content: center;
    background: transparent;
    border: none;
}
.status-badge-dot .dot {
    width: 10px;
    height: 10px;
}

/* Status ancorado sobre o avatar do perfil (canto superior direito). */
.profile-menu { position: relative; }
.profile-menu #connection-status.status-badge-dot {
    position: absolute;
    top: -2px;
    right: -2px;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: var(--bg-dark);
    border: 2px solid var(--bg-dark);
    padding: 0;
    z-index: 3;
    pointer-events: none;
    display: flex;
    align-items: center;
    justify-content: center;
}
.profile-menu #connection-status .dot {
    width: 10px;
    height: 10px;
}

.dot {
    width: 8px;
    height: 8px;
    background: var(--accent-red);
    border-radius: 50%;
    box-shadow: 0 0 6px rgba(255,77,77,0.6);
}

.online .dot {
    background: var(--accent-green);
    box-shadow: 0 0 8px var(--accent-green);
}

.card {
    background: var(--card-bg);
    backdrop-filter: blur(10px);
    border: 1px solid var(--glass-border);
    border-radius: 12px;
    padding: 16px;
    margin-bottom: 16px;
}

.section-title {
    font-size: 12px;
    font-weight: 700;
    color: var(--gold);
    text-transform: uppercase;
    margin-bottom: 12px;
    display: flex;
    align-items: center;
}

.info-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

.info-item label {
    display: block;
    font-size: 10px;
    color: var(--text-secondary);
    margin-bottom: 4px;
}

.info-item span {
    font-size: 13px;
    font-weight: 600;
    word-break: break-all;
}

textarea {
    width: 100%;
    height: 80px;
    background: rgba(0,0,0,0.3);
    border: 1px solid var(--glass-border);
    border-radius: 8px;
    color: white;
    padding: 10px;
    font-size: 13px;
    resize: none;
    margin-bottom: 10px;
}

textarea:focus {
    outline: none;
    border-color: var(--orange);
}

.btn-secondary {
    width: 100%;
    background: transparent;
    border: 1px solid var(--gold);
    color: var(--gold);
    padding: 8px;
    border-radius: 8px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: 0.3s;
}

.btn-secondary:hover {
    background: var(--gold);
    color: black;
}

.result-box {
    background: rgba(0,0,0,0.4);
    padding: 10px;
    border-radius: 6px;
    font-size: 12px;
    margin: 8px 0;
    border-left: 3px solid var(--gold);
    max-height: 250px;
    overflow: hidden;
    white-space: pre-wrap;
    word-break: break-word;
    line-height: 1.5;
}

.result-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 8px;
    margin-top: 4px;
}

.result-header label {
    font-size: 11px;
    color: var(--text-secondary);
}

.btn-view-more {
    width: 100%;
    background: transparent;
    border: 1px dashed var(--glass-border);
    color: var(--gold);
    padding: 6px 8px;
    border-radius: 6px;
    font-size: 11px;
    font-weight: 600;
    cursor: pointer;
    margin: 0 0 10px 0;
    transition: 0.2s;
}

.btn-view-more:hover {
    border-color: var(--gold);
    background: rgba(255, 215, 0, 0.05);
}

/* Modal "Ver mais" do Prompt Sugerido */
.prompt-modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.85);
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
}

.auth-modal-overlay {
    position: fixed;
    inset: 0;
    background: var(--bg-dark);
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
}

.prompt-modal-content, .auth-modal-content {
    background: #1a1a1a;
    border: 1px solid var(--gold);
    border-radius: 12px;
    padding: 16px;
    width: 100%;
    max-width: 360px;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    gap: 12px;
    box-shadow: 0 0 25px rgba(255, 215, 0, 0.2);
}

.prompt-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 8px;
}

.prompt-modal-header h3 {
    color: var(--gold);
    font-size: 14px;
    font-weight: 700;
    margin: 0;
}

.prompt-modal-close {
    background: transparent;
    border: none;
    color: var(--text-secondary);
    font-size: 18px;
    font-weight: 700;
    line-height: 1;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: 0.2s;
}

.prompt-modal-close:hover {
    background: rgba(255, 255, 255, 0.08);
    color: var(--accent-red);
}

.prompt-modal-body {
    flex: 1;
    overflow-y: auto;
    background: rgba(0, 0, 0, 0.4);
    padding: 12px;
    border-radius: 6px;
    font-size: 12px;
    line-height: 1.5;
    white-space: pre-wrap;
    word-break: break-word;
    border-left: 3px solid var(--gold);
    max-height: 60vh;
    color: var(--text-primary);
}

.prompt-modal-body::-webkit-scrollbar {
    width: 6px;
}

.prompt-modal-body::-webkit-scrollbar-thumb {
    background: var(--gold);
    border-radius: 4px;
}

.mask-hint {
    font-size: 10px;
    color: var(--text-secondary);
    margin-top: 8px;
    line-height: 1.4;
}

.toggle-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}

.switch {
  position: relative;
  display: inline-block;
  width: 40px;
  height: 20px;
}

.switch input { 
  opacity: 0;
  width: 0;
  height: 0;
}

.slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: #333;
  transition: .4s;
}

.slider:before {
  position: absolute;
  content: "";
  height: 14px;
  width: 14px;
  left: 3px;
  bottom: 3px;
  background-color: white;
  transition: .4s;
}

input:checked + .slider {
  background-color: var(--orange);
}

input:checked + .slider:before {
  transform: translateX(20px);
}

.slider.round {
  border-radius: 34px;
}

.slider.round:before {
  border-radius: 50%;
}

.stats-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}

.stat {
    background: rgba(255,255,255,0.03);
    padding: 10px;
    border-radius: 8px;
    text-align: center;
}

.stat .label {
    display: block;
    font-size: 10px;
    color: var(--text-secondary);
}

.stat .value {
    font-size: 16px;
    font-weight: 700;
}

.text-red { color: var(--accent-red); }

.actions-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

.btn-action {
    background: var(--card-bg);
    border: 1px solid var(--glass-border);
    color: white;
    padding: 12px;
    border-radius: 12px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    transition: 0.2s;
}

.btn-action:hover {
    background: rgba(255,255,255,0.1);
    border-color: var(--gold);
    transform: translateY(-2px);
}

footer {
    margin-top: 20px;
    text-align: center;
    border-top: 1px solid var(--glass-border);
    padding-top: 15px;
}

footer p {
    font-size: 11px;
    color: var(--text-secondary);
}

.version {
    font-size: 9px;
    color: #8a8a8a;
    margin-top: 5px;
}

.btn-primary {
    width: 100%;
    background: linear-gradient(135deg, var(--gold), var(--orange));
    border: none;
    color: black;
    padding: 10px;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
    margin-bottom: 12px;
    transition: 0.3s;
}

.btn-primary:hover {
    box-shadow: 0 0 15px rgba(255, 215, 0, 0.4);
    transform: scale(1.02);
}

#extension-input-area {
    margin-bottom: 15px;
    border-bottom: 1px solid var(--glass-border);
    padding-bottom: 15px;
}

/* Scrollbar Style */
::-webkit-scrollbar {
    width: 6px;
}
::-webkit-scrollbar-track {
    background: var(--bg-dark);
}
::-webkit-scrollbar-thumb {
    background: var(--gold);
    border-radius: 6px;
}
::-webkit-scrollbar-thumb:hover {
    background: var(--orange);
}

.header-logo {
    width: 32px;
    height: 32px;
    border-radius: 6px;
    object-fit: cover;
    border: 1px solid var(--glass-border);
}

.hidden { display: none !important; }

.btn-small {
    background: var(--gold);
    color: black;
    border: none;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 10px;
    font-weight: 700;
    cursor: pointer;
}
.btn-small.btn-ghost {
    color: #ffffff !important;
}

/* Área de Anexos */
.attachment-area {
    margin-bottom: 10px;
}

.attachment-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 7px 14px;
    background: rgba(255, 255, 255, 0.06);
    border: 1px dashed var(--glass-border);
    border-radius: 8px;
    color: var(--text-secondary);
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
}

.attachment-btn:hover {
    border-color: var(--gold);
    color: var(--gold);
    background: rgba(255, 215, 0, 0.05);
}

.attachment-btn input[type="file"] {
    display: none;
}

.attachment-preview {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 10px;
    max-height: 160px;
    overflow-y: auto;
    padding-top: 8px; /* espaço para o botão de remover que fica top:-5px */
}

.attachment-item {
    position: relative;
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 11px 10px 6px 10px; /* top +5px para o ícone de fechar não ficar cortado */
    background: rgba(255, 215, 0, 0.08);
    border: 1px solid rgba(255, 215, 0, 0.2);
    border-radius: 6px;
    font-size: 11px;
    color: var(--text-primary);
    max-width: 200px;
    animation: fadeInAttach 0.25s ease;
}

@keyframes fadeInAttach {
    from { opacity: 0; transform: scale(0.9); }
    to { opacity: 1; transform: scale(1); }
}

.attachment-item .file-icon {
    font-size: 14px;
    flex-shrink: 0;
}

.attachment-item .file-name {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 120px;
}

.attachment-item .file-size {
    font-size: 9px;
    color: var(--text-secondary);
    flex-shrink: 0;
}

.attachment-item .remove-file {
    position: absolute;
    top: -5px;
    right: -5px;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: var(--accent-red);
    color: white;
    border: none;
    font-size: 10px;
    line-height: 16px;
    text-align: center;
    cursor: pointer;
    opacity: 0;
    transition: opacity 0.2s;
}

.attachment-item:hover .remove-file {
    opacity: 1;
}

.attachment-thumb {
    width: 30px;
    height: 30px;
    border-radius: 4px;
    object-fit: cover;
    flex-shrink: 0;
}

/* Histórico de Mensagens */
.history-list {
    max-height: 300px;
    overflow-y: auto;
    margin-bottom: 8px;
    scrollbar-width: thin;
    scrollbar-color: var(--gold) transparent;
}

.history-list::-webkit-scrollbar {
    width: 4px;
}

.history-list::-webkit-scrollbar-thumb {
    background: var(--gold);
    border-radius: 2px;
}

.history-empty {
    text-align: center;
    color: rgba(255,255,255,0.3);
    font-size: 12px;
    padding: 20px 10px;
    font-style: italic;
}

.history-item {
    background: rgba(255,255,255,0.03);
    border: 1px solid var(--glass-border);
    border-radius: 8px;
    padding: 8px 10px;
    margin-bottom: 6px;
    position: relative;
    transition: all 0.2s ease;
}

.history-item:hover {
    background: rgba(255,255,255,0.07);
    border-color: var(--gold);
}

.history-item-text {
    font-size: 12px;
    color: rgba(255,255,255,0.85);
    line-height: 1.4;
    word-break: break-word;
    margin-bottom: 6px;
    /* Recolhido: exatamente 3 linhas. O botão "Ver mais" libera o resto —
       antes havia um max-height fixo que cortava no meio da linha e não tinha
       como expandir. */
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 3;
    line-clamp: 3;
    overflow: hidden;
}

.history-item-text.is-expanded {
    display: block;
    -webkit-line-clamp: unset;
    line-clamp: unset;
    overflow: visible;
}

.btn-toggle-msg {
    background: none;
    border: none;
    padding: 0 0 6px;
    margin: -2px 0 0;
    color: var(--gold);
    font-family: inherit;
    font-size: 11px;
    font-weight: 600;
    cursor: pointer;
    opacity: 0.85;
    transition: opacity 0.2s ease;
}

.btn-toggle-msg:hover {
    opacity: 1;
    text-decoration: underline;
}

.history-item-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.history-item-time {
    font-size: 10px;
    color: rgba(255,255,255,0.3);
}

.history-item-actions {
    display: flex;
    gap: 4px;
}

.history-item-actions button {
    background: none;
    border: 1px solid var(--glass-border);
    color: rgba(255,255,255,0.5);
    font-size: 11px;
    padding: 2px 8px;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s;
}

.history-item-actions button:hover {
    color: var(--gold);
    border-color: var(--gold);
}

.history-item-actions .btn-copy-msg:hover {
    color: #2ecc71;
    border-color: #2ecc71;
}

.history-item-actions .btn-delete-msg:hover {
    color: var(--accent-red);
    border-color: var(--accent-red);
}

.btn-danger {
    width: 100%;
    padding: 8px;
    background: rgba(231, 76, 60, 0.15);
    border: 1px solid rgba(231, 76, 60, 0.3);
    color: var(--accent-red);
    border-radius: 8px;
    cursor: pointer;
    font-size: 12px;
    font-family: inherit;
    transition: all 0.2s;
    margin-top: 4px;
}

.btn-danger:hover {
    background: rgba(231, 76, 60, 0.3);
    border-color: var(--accent-red);
}

.copy-toast {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(46, 204, 113, 0.9);
    color: white;
    padding: 6px 16px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    z-index: 9999;
    animation: toastFade 2s ease forwards;
}

@keyframes toastFade {
    0% { opacity: 0; transform: translateX(-50%) translateY(10px); }
    15% { opacity: 1; transform: translateX(-50%) translateY(0); }
    80% { opacity: 1; }
    100% { opacity: 0; }
}

/* ===== Banner de licença com borda animada (amarelo/vermelho) ===== */
.sunix-license-banner {
    position: relative;
    padding: 3px;
    border-radius: 6px;
    margin-bottom: 14px;
    background: conic-gradient(
        from var(--sunix-angle, 0deg),
        #FFD700 0deg,
        #ff4d4d 90deg,
        #FFD700 180deg,
        #ff4d4d 270deg,
        #FFD700 360deg
    );
    animation: sunix-border-spin 3s linear infinite;
    box-shadow: 0 0 14px rgba(255, 215, 0, 0.35), 0 0 18px rgba(255, 77, 77, 0.25);
}

.sunix-license-banner-inner {
    background: #0d1f12;
    color: #2ecc71;
    text-align: center;
    font-weight: 700;
    font-size: 13px;
    padding: 10px 12px;
    border-radius: 8px;
    letter-spacing: 0.2px;
    text-shadow: 0 0 6px rgba(46, 204, 113, 0.45);
}

@property --sunix-angle {
    syntax: '<angle>';
    initial-value: 0deg;
    inherits: false;
}

@keyframes sunix-border-spin {
    to { --sunix-angle: 360deg; }
}

/* Fallback para navegadores sem @property: rotaciona o background-image */
@supports not (background: conic-gradient(from 0deg, red, blue)) {
    .sunix-license-banner {
        background: linear-gradient(90deg, #FFD700, #ff4d4d, #FFD700, #ff4d4d, #FFD700);
        background-size: 300% 300%;
        animation: sunix-border-slide 3s linear infinite;
    }
    @keyframes sunix-border-slide {
        0% { background-position: 0% 50%; }
        100% { background-position: 100% 50%; }
    }
}

/* Update banner */
.sunix-update-banner {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: center;
    justify-content: space-between;
    margin: 10px 0;
    padding: 10px 12px;
    border-radius: 6px;
    background: linear-gradient(135deg, rgba(34,197,94,0.12), rgba(59,130,246,0.12));
    border: 1px solid rgba(34,197,94,0.45);
    color: #d1fae5;
    font-size: 12px;
}
.sunix-update-banner.hidden { display: none; }
.sunix-update-text { flex: 1 1 180px; }
.sunix-update-text strong { display: block; color: #4ade80; margin-bottom: 2px; }
.sunix-update-text span { opacity: 0.85; }
.sunix-update-notes { margin: 4px 0 0; opacity: 0.75; font-size: 11px; }
.sunix-update-notes.hidden { display: none; }
.sunix-update-actions { display: flex; gap: 6px; }
.btn-ghost { background: transparent !important; border: 1px solid rgba(255,255,255,0.25) !important; color: #fff !important; }
.btn-ghost:hover { color: var(--gold) !important; border-color: var(--gold) !important; }

/* ===== Account status (refactor) ===== */
.sunix-account-status { background: rgba(0,0,0,0.35); border: 1px solid var(--glass-border, rgba(255,215,0,0.25)); }
.sunix-account-row { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 8px; }
.sunix-account-mode { display: flex; align-items: center; gap: 8px; min-width: 0; flex: 1; }
.sunix-mode-badge { padding: 3px 8px; border-radius: 6px; font-size: 11px; font-weight: 700; letter-spacing: .4px; text-transform: uppercase; background: #444; color: #fff; }
.sunix-mode-badge.is-pro { background: linear-gradient(135deg, #FFD700, #ff9900); color: #000; }
.sunix-mode-badge.is-free { background: #2d7d46; color: #fff; }
.sunix-mode-badge.is-exhausted { background: #b33; color: #fff; }
.sunix-account-email { font-size: 11px; color: #ddd; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sunix-account-info { display: flex; flex-direction: column; gap: 3px; font-size: 12px; color: #ccc; }
.sunix-info-line strong { color: #fff; }
.sunix-account-warn { margin-top: 8px; padding: 8px 10px; border-radius: 6px; background: rgba(255,165,0,0.15); border: 1px solid rgba(255,165,0,0.45); color: #ffd28a; font-size: 12px; line-height: 1.4; }
.sunix-account-warn.is-error { background: rgba(220,53,53,0.15); border-color: rgba(220,53,53,0.5); color: #ffb0b0; }

/* ===== Auth modal — login section ===== */
.sunix-auth-section { margin-bottom: 12px; }
.sunix-auth-label { font-size: 12px; color: #ddd; margin-bottom: 8px; font-weight: 600; text-align: center; }
.sunix-auth-input { width: 100%; padding: 10px; border-radius: 8px; border: 1px solid var(--glass-border, rgba(255,215,0,0.25)); background: rgba(0,0,0,0.5); color: #fff; margin-bottom: 8px; font-size: 13px; }
.sunix-auth-btn { width: 100%; padding: 10px; font-size: 13px; }
.sunix-auth-hint { font-size: 10px; color: #aaa; margin-top: 6px; text-align: center; line-height: 1.4; }
.sunix-auth-sep { text-align: center; margin: 14px 0 10px; font-size: 10px; color: #888; text-transform: uppercase; letter-spacing: 1px; }

/* Disabled toggles when exhausted */
.sunix-locked { opacity: 0.55; pointer-events: none; }

/* ===== Profile menu (header) ===== */
.profile-menu { position: relative; }
.profile-btn {
    background: linear-gradient(135deg, var(--gold), var(--orange));
    border: none;
    width: 34px; height: 34px;
    border-radius: 50%;
    cursor: pointer;
    padding: 0;
    display: flex; align-items: center; justify-content: center;
    box-shadow: 0 0 0 1px var(--glass-border), 0 4px 12px rgba(255,140,0,0.25);
    transition: transform .15s ease, box-shadow .15s ease;
    margin-left: 8px;
}
.profile-btn:hover { transform: scale(1.05); box-shadow: 0 0 0 1px var(--gold), 0 6px 16px rgba(255,215,0,0.35); }

.sunix-key-btn {
    background: rgba(255,215,0,0.12);
    border: 1px solid rgba(255,215,0,0.4);
    color: var(--gold);
    width: 30px; height: 30px; border-radius: 50%;
    cursor: pointer; font-size: 14px;
    display: flex; align-items: center; justify-content: center;
    margin: 0;
    padding: 0;
    transition: all .2s ease;
}
.sunix-key-btn:hover { background: rgba(255,215,0,0.25); transform: scale(1.05); }

/* PRO tag oculto no cabeçalho (info já aparece no perfil) */
.sunix-pro-tag { display: none !important; }
.sunix-variant-tag { display: none !important; }
.sunix-auth-error.is-success {
    color: #2ecc71;
    border-color: rgba(46,204,113,0.4);
    background: rgba(46,204,113,0.08);
}

.sunix-onb-prompt {
    margin: 10px 0 4px;
    padding: 10px;
    border: 1px dashed rgba(255,215,0,0.5);
    border-radius: 8px;
    background: rgba(255,215,0,0.06);
}
.sunix-onb-prompt-q {
    margin: 0 0 8px;
    font-size: 12px;
    color: #fff;
    font-weight: 600;
}
.sunix-onb-prompt-actions {
    display: flex; gap: 8px; justify-content: flex-end;
}

.sunix-history-tag {
    display: inline-block; margin-left: 6px;
    padding: 1px 7px; border-radius: 6px;
    font-size: 10px; font-weight: 700; letter-spacing: .3px;
    text-transform: uppercase;
    vertical-align: middle;
}
.sunix-history-tag.tag-direto { background: rgba(46, 204, 113, 0.18); color: #2ecc71; border:1px solid rgba(46,204,113,.35); }
.sunix-history-tag.tag-chat   { background: rgba(255, 215, 0, 0.18); color: var(--gold); border:1px solid rgba(255,215,0,.4); }
.profile-avatar {
    font-size: 14px; font-weight: 800; color: #000;
    text-transform: uppercase;
}
.profile-avatar-lg {
    width: 44px; height: 44px; border-radius: 50%;
    background: linear-gradient(135deg, var(--gold), var(--orange));
    display: flex; align-items: center; justify-content: center;
    font-size: 18px; flex-shrink: 0;
}
.profile-dropdown {
    position: absolute;
    top: calc(100% + 10px);
    right: 0;
    width: 280px;
    background: #141414;
    border: 1px solid var(--glass-border);
    border-radius: 12px;
    padding: 14px;
    box-shadow: 0 14px 40px rgba(0,0,0,0.6), 0 0 0 1px rgba(255,215,0,0.08);
    z-index: 9000;
    display: flex; flex-direction: column; gap: 10px;
    animation: profileFade .15s ease;
}
@keyframes profileFade {
    from { opacity: 0; transform: translateY(-4px); }
    to   { opacity: 1; transform: translateY(0); }
}
.profile-dropdown::before {
    content: "";
    position: absolute;
    top: -6px; right: 12px;
    width: 12px; height: 12px;
    background: #141414;
    border-left: 1px solid var(--glass-border);
    border-top: 1px solid var(--glass-border);
    transform: rotate(45deg);
}
.profile-header { display: flex; align-items: center; gap: 10px; padding-bottom: 10px; border-bottom: 1px solid var(--glass-border); }
.profile-id { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.profile-name {
    font-size: 13px; font-weight: 600; color: #fff;
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 200px;
}
.profile-section { display: flex; flex-direction: column; gap: 4px; font-size: 12px; color: #ccc; }
.profile-logout { margin-top: 4px; }

/* ===== Polished cards (modal-like) ===== */
.card { transition: border-color .2s ease, box-shadow .2s ease; }
.card:hover { border-color: rgba(255,215,0,0.18); }
.section-title::before {
    content: ""; display: inline-block;
    width: 3px; height: 12px;
    background: linear-gradient(180deg, var(--gold), var(--orange));
    border-radius: 2px; margin-right: 8px;
}
.toggle-container { padding: 4px 0; }
.toggle-container span { font-size: 12px; color: #ddd; font-weight: 500; }

/* compact stat row */
.stats-row { margin-top: 12px; }

/* ===== Auth tabs ===== */
.sunix-auth-tabs {
    display: flex; gap: 6px;
    background: rgba(0,0,0,0.4);
    padding: 4px; border-radius: 6px;
    border: 1px solid var(--glass-border);
    margin-bottom: 12px;
}
.sunix-auth-tab {
    flex: 1; padding: 8px 10px;
    background: transparent; border: none;
    color: var(--text-secondary);
    font-size: 12px; font-weight: 600;
    border-radius: 7px; cursor: pointer;
    font-family: inherit;
    transition: all .15s ease;
}
.sunix-auth-tab:hover { color: var(--text-primary); }
.sunix-auth-tab.is-active {
    background: linear-gradient(135deg, var(--gold), var(--orange));
    color: #000;
    box-shadow: 0 2px 8px rgba(255,140,0,0.25);
}
.sunix-auth-pane.hidden { display: none; }

/* ===== License collapse ===== */
.sunix-license-toggle {
    width: 100%;
    display: flex; align-items: center; gap: 8px;
    padding: 10px 12px;
    background: rgba(255,255,255,0.04);
    border: 1px dashed var(--glass-border);
    border-radius: 8px;
    color: var(--text-secondary);
    font-size: 12px; font-weight: 600;
    cursor: pointer;
    font-family: inherit;
    margin-top: 14px;
    transition: all .15s ease;
}
.sunix-license-toggle:hover {
    color: var(--gold);
    border-color: rgba(255,215,0,0.4);
    background: rgba(255,215,0,0.05);
}
.sunix-license-toggle-icon { font-size: 14px; }
.sunix-license-toggle-caret { margin-left: auto; transition: transform .2s ease; }
.sunix-license-toggle.is-open .sunix-license-toggle-caret { transform: rotate(180deg); }

.sunix-license-pane {
    margin-top: 10px;
    padding: 12px;
    background: rgba(0,0,0,0.3);
    border: 1px solid var(--glass-border);
    border-radius: 8px;
}
.sunix-license-pane.hidden { display: none; }
.sunix-license-warn {
    font-size: 11px; line-height: 1.5;
    padding: 8px 10px;
    background: rgba(255,165,0,0.12);
    border: 1px solid rgba(255,165,0,0.35);
    color: #ffd28a;
    border-radius: 6px;
    margin-bottom: 10px;
}
.sunix-license-warn strong { color: var(--gold); }

/* ===== Password show/hide toggle ===== */
.sunix-pwd-wrap { position: relative; }
.sunix-pwd-wrap .sunix-auth-input { padding-right: 38px; }
.sunix-pwd-toggle {
    position: absolute;
    right: 6px;
    top: 50%;
    transform: translateY(-50%);
    background: transparent;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    font-size: 16px;
    padding: 4px 8px;
    line-height: 1;
    border-radius: 6px;
    transition: color .15s ease, background .15s ease;
    margin-top: -4px;
}
.sunix-pwd-toggle:hover { color: var(--gold); background: rgba(255,215,0,0.08); }
.sunix-pwd-toggle.is-on { color: var(--gold); }

/* ===== Inline auth errors ===== */
.sunix-auth-error {
    background: rgba(220,53,53,0.12);
    border: 1px solid rgba(220,53,53,0.45);
    color: #ffb0b0;
    font-size: 11px;
    padding: 8px 10px;
    border-radius: 6px;
    margin-bottom: 10px;
    line-height: 1.4;
    animation: shakeErr .35s ease;
}
@keyframes shakeErr {
    0%,100% { transform: translateX(0); }
    25% { transform: translateX(-4px); }
    75% { transform: translateX(4px); }
}

/* ===== License card (in-panel) ===== */
.license-card .btn-primary { margin-bottom: 8px; }
.license-card .btn-secondary { margin-top: 4px; }

/* ===== Onboarding tour ===== */
.sunix-onboarding {
    position: fixed;
    inset: 0;
    z-index: 99999;
    pointer-events: none;
}
.sunix-onboarding.hidden { display: none; }
.sunix-onb-backdrop {
    position: absolute; inset: 0;
    background: rgba(0,0,0,0.65);
    pointer-events: auto;
}
.sunix-onb-highlight {
    position: absolute;
    border: 2px solid var(--gold);
    border-radius: 6px;
    box-shadow: 0 0 0 9999px rgba(0,0,0,0.65), 0 0 18px rgba(255,215,0,0.6);
    transition: top .25s ease, left .25s ease, width .25s ease, height .25s ease;
    pointer-events: none;
}
/* Modo "perfil": ao destacar itens dentro do menu da conta, removemos o
   escurecimento de fundo (backdrop + recorte) para o dropdown aparecer
   nítido por cima. O alvo recebe um anel dourado próprio (.onb-ring). */
.sunix-onboarding.onb-profile-mode .sunix-onb-backdrop,
.sunix-onboarding.onb-profile-mode .sunix-onb-highlight { display: none !important; }
.onb-ring {
    border-radius: 8px;
    box-shadow: 0 0 0 2px var(--gold), 0 0 14px 3px rgba(255,215,0,0.65) !important;
    animation: onbRingPulse 1.2s ease-in-out infinite;
}
@keyframes onbRingPulse {
    0%, 100% { box-shadow: 0 0 0 2px var(--gold), 0 0 10px 1px rgba(255,215,0,0.45); }
    50%      { box-shadow: 0 0 0 2px var(--gold), 0 0 20px 5px rgba(255,215,0,0.85); }
}
.sunix-onb-tooltip {
    position: absolute;
    width: 260px;
    background: #1a1a1a;
    border: 1px solid var(--gold);
    border-radius: 6px;
    padding: 14px;
    color: #fff;
    box-shadow: 0 12px 30px rgba(0,0,0,0.7);
    pointer-events: auto;
    z-index: 1;
    transition: top .25s ease, left .25s ease;
}
.sunix-onb-step {
    font-size: 10px;
    color: var(--gold);
    font-weight: 700;
    letter-spacing: 1px;
    margin-bottom: 4px;
    text-transform: uppercase;
}
.sunix-onb-tooltip h3 {
    font-size: 14px;
    color: var(--gold);
    margin: 0 0 6px 0;
}
.sunix-onb-tooltip p {
    font-size: 12px;
    color: #ddd;
    line-height: 1.5;
    margin: 0 0 12px 0;
}
.sunix-onb-actions {
    display: flex;
    gap: 6px;
    justify-content: flex-end;
    align-items: center;
}
.btn-ghost-sm {
    background: transparent;
    border: 1px solid var(--glass-border);
    color: var(--text-secondary);
    padding: 6px 10px;
    border-radius: 6px;
    font-size: 11px;
    font-weight: 600;
    cursor: pointer;
    font-family: inherit;
}
.btn-ghost-sm:hover { color: var(--gold); border-color: var(--gold); }
.btn-primary-sm {
    background: linear-gradient(135deg, var(--gold), var(--orange));
    border: none;
    color: #000;
    padding: 6px 14px;
    border-radius: 6px;
    font-size: 11px;
    font-weight: 700;
    cursor: pointer;
    font-family: inherit;
}
.btn-primary-sm:hover { box-shadow: 0 0 12px rgba(255,215,0,0.5); }

/* Countdown card (último hora da licença) */
.sunix-license-countdown {
    margin: 10px 0;
    padding: 14px 16px;
    background: linear-gradient(135deg, rgba(231,76,60,0.18), rgba(255,138,0,0.18));
    border: 1px solid rgba(231,76,60,0.45);
    border-radius: 6px;
    text-align: center;
    animation: sunix-pulse-warn 2s ease-in-out infinite;
}
.sunix-license-countdown-label {
    font-size: 12px;
    color: #ffd9b8;
    letter-spacing: 0.4px;
    text-transform: uppercase;
    font-weight: 600;
}
.sunix-license-countdown-time {
    font-size: 26px;
    font-weight: 800;
    color: #fff;
    font-variant-numeric: tabular-nums;
    margin: 4px 0;
    text-shadow: 0 0 12px rgba(231,76,60,0.6);
}
.sunix-license-countdown-hint {
    font-size: 11px;
    color: var(--text-secondary);
}
@keyframes sunix-pulse-warn {
    0%, 100% { box-shadow: 0 0 0 0 rgba(231,76,60,0.0); }
    50% { box-shadow: 0 0 18px 2px rgba(231,76,60,0.35); }
}

/* ===== Novos componentes (v1.2.x) ===== */
.project-id-row {
    display: flex;
    align-items: center;
    gap: 6px;
}
.project-id-row #project-id-short {
    font-family: monospace;
    font-size: 12px;
    color: #fff;
}
.icon-btn {
    background: transparent;
    border: 1px solid #333;
    color: var(--gold, #FFD700);
    border-radius: 6px;
    padding: 2px 6px;
    cursor: pointer;
    font-size: 12px;
    line-height: 1;
    transition: background .15s, color .15s;
}
.icon-btn:hover {
    background: var(--gold, #FFD700);
    color: #000;
}
.stats-card .stats-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 8px;
}
.message-history .stats-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 8px;
}
.profile-direct-send .toggle-container {
    background: rgba(255,215,0,0.05);
    padding: 6px 8px;
    border-radius: 6px;
}

/* Modal Histórico de Versões */
.release-list { display: flex; flex-direction: column; gap: 8px; }
.release-card {
    border: 1px solid rgba(255,255,255,0.08);
    background: rgba(255,255,255,0.02);
    border-radius: 8px;
    padding: 10px 12px;
}
.release-card-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}
.release-card-meta {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    min-width: 0;
}
.release-version {
    font-weight: 700;
    color: var(--gold);
    font-size: 13px;
    line-height: 1;
}
.release-badge-current {
    background: var(--gold);
    color: #000;
    font-size: 9px;
    font-weight: 700;
    padding: 2px 6px;
    border-radius: 4px;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    line-height: 1;
}
.release-date {
    color: var(--text-secondary);
    font-size: 10px;
    line-height: 1;
}
.release-download-btn {
    background: var(--gold);
    color: #000;
    border: none;
    border-radius: 6px;
    font-size: 11px;
    font-weight: 600;
    padding: 5px 12px;
    cursor: pointer;
    white-space: nowrap;
    transition: opacity .15s ease;
    flex-shrink: 0;
}
.release-download-btn:hover { opacity: 0.85; }
.release-download-btn:disabled { opacity: 0.6; cursor: default; }
.release-notes {
    color: var(--text-secondary);
    font-size: 11px;
    margin-top: 6px;
    padding-top: 6px;
    border-top: 1px dashed rgba(255,255,255,0.06);
    white-space: pre-wrap;
    line-height: 1.4;
}

/* Sunix chat-ready banner + quota/login alert modal */
.sunix-chat-ready {
    margin-top: 10px;
    padding: 8px 10px;
    border-radius: 6px;
    background: rgba(34, 197, 94, 0.12);
    border: 1px solid rgba(34, 197, 94, 0.45);
    color: #4ade80;
    font-size: 11px;
    line-height: 1.4;
}
.sunix-ext-alert-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.85);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 100000;
    padding: 16px;
}
.sunix-ext-alert-card {
    background: #1a1a1a;
    border: 1px solid rgba(255,255,255,0.12);
    border-radius: 12px;
    padding: 22px 20px;
    width: 100%;
    max-width: 320px;
    text-align: center;
    box-shadow: 0 10px 30px rgba(0,0,0,0.45);
}
.sunix-ext-alert-card h3 {
    margin: 0 0 10px;
    font-size: 16px;
    color: var(--gold, #FFD700);
}
.sunix-ext-alert-card p {
    margin: 0 0 16px;
    font-size: 13px;
    color: #fff;
    line-height: 1.5;
}
.sunix-ext-alert-actions { display: flex; flex-direction: column; gap: 8px; }
.sunix-ext-alert-actions button {
    border: none;
    border-radius: 8px;
    padding: 9px 14px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
}
.sunix-ext-alert-buy {
    background: linear-gradient(135deg, var(--gold, #FFD700), #ff9900);
    color: #000;
}
.sunix-ext-alert-close {
    background: transparent;
    border: 1px solid rgba(255,255,255,0.25) !important;
    color: #fff;
}

/* Install modal (manual update flow) */
.sunix-install-modal { position: fixed; inset: 0; background: rgba(0,0,0,0.7); z-index: 99999; display: flex; align-items: center; justify-content: center; padding: 16px; }
.sunix-install-modal.hidden { display: none; }
.sunix-install-modal-card { background: #1a1a1a; border: 1px solid rgba(255,215,0,0.25); border-radius: 6px; max-width: 360px; width: 100%; max-height: 90vh; overflow-y: auto; padding: 16px; color: #fff; font-family: Inter, sans-serif; box-shadow: 0 12px 40px rgba(0,0,0,0.6); }
.sunix-install-modal-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; font-size: 14px; }
.sunix-install-steps { margin: 0 0 12px 18px; padding: 0; font-size: 12px; line-height: 1.55; color: #d4d4d4; }
.sunix-install-steps li { margin-bottom: 6px; }
.sunix-install-steps code { background: rgba(255,255,255,0.08); padding: 1px 5px; border-radius: 4px; font-size: 11px; }
.sunix-install-modal-footer { display: flex; gap: 8px; justify-content: flex-end; margin-top: 8px; }

