/* InsonAI — estilos dos componentes. Tudo vem dos tokens (tokens.css). */
body { margin: 0; font-family: var(--font-sans); background: var(--bg); color: var(--text); -webkit-font-smoothing: antialiased; }
.ins-stage { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-sm); padding: var(--space-md); }
.ins-stack { display: grid; gap: var(--space-sm); padding: var(--space-md); }

/* Ícone */
.ins-icon { display: inline-block; flex: none; vertical-align: middle; }
.ins-icon-duo .d { fill: currentColor; fill-opacity: var(--icon-duo-opacity, 0.24); }

/* Botão */
.ins-btn { font-family: inherit; display: inline-flex; align-items: center; justify-content: center; gap: var(--space-xs); border: 1px solid transparent; border-radius: var(--radius-full); cursor: pointer; white-space: nowrap; transition: background-color .18s ease, box-shadow .18s ease, transform .18s ease, border-color .18s ease; }
.ins-btn--sm { height: 32px; padding: 0 14px; font-size: 13px; line-height: 16px; font-weight: 700; letter-spacing: .006em; }
.ins-btn--md { height: 44px; padding: 0 20px; font-size: 15px; line-height: 20px; font-weight: 700; letter-spacing: -.005em; }
.ins-btn--lg { height: 56px; padding: 0 28px; font-size: 17px; line-height: 24px; font-weight: 700; letter-spacing: -.004em; }
.ins-btn--primary { background: var(--accent); color: var(--on-accent); box-shadow: var(--glow); }
.ins-btn--primary:hover { background: var(--accent-hover); box-shadow: var(--glow-hover); }
.ins-btn--secondary { background: var(--accent-soft); color: var(--text); border-color: var(--border-strong); }
.ins-btn--secondary:hover { border-color: var(--outline); }
.ins-btn--outline { background: transparent; color: var(--text); border-color: var(--outline); }
.ins-btn--outline:hover { background: var(--surface-2); }
.ins-btn--ghost { background: transparent; color: var(--accent-text); }
.ins-btn--ghost:hover { background: var(--accent-soft); }
.ins-btn--cta { background: var(--cta); color: var(--on-cta); }
.ins-btn--cta:hover { transform: translateY(-1px); }
.ins-btn--cta.ins-btn--sm { padding-right: 4px; }
.ins-btn--cta.ins-btn--md { padding-right: 6px; }
.ins-btn--cta.ins-btn--lg { padding-right: 6px; }
.ins-btn__chip { display: inline-flex; align-items: center; justify-content: center; border-radius: var(--radius-full); background: var(--primary); color: var(--on-brand); margin-left: var(--space-xs); }
.ins-btn--sm .ins-btn__chip { width: 24px; height: 24px; }
.ins-btn--md .ins-btn__chip { width: 32px; height: 32px; }
.ins-btn--lg .ins-btn__chip { width: 44px; height: 44px; }
.ins-btn--danger { background: var(--danger-fill); color: var(--on-danger); }
.ins-btn:active { transform: scale(.98); }
.ins-btn:disabled { opacity: .4; cursor: not-allowed; box-shadow: none; transform: none; }

/* Ícone-botão */
.ins-ib { display: inline-flex; align-items: center; justify-content: center; padding: 0; border: 1px solid transparent; border-radius: var(--radius-full); cursor: pointer; transition: background-color .18s ease, color .18s ease; }
.ins-ib--sm { width: 32px; height: 32px; }
.ins-ib--md { width: 40px; height: 40px; }
.ins-ib--lg { width: 48px; height: 48px; }
.ins-ib--filled { background: var(--accent); color: var(--on-accent); }
.ins-ib--filled:hover { background: var(--accent-hover); }
.ins-ib--rose { background: var(--cta); color: var(--on-cta); }
.ins-ib--tonal { background: var(--accent-soft); color: var(--accent-text); }
.ins-ib--outline { background: transparent; border-color: var(--outline); color: var(--text); }
.ins-ib--ghost { background: transparent; color: var(--text-muted); }
.ins-ib--ghost:hover, .ins-ib--outline:hover { background: var(--surface-3); color: var(--text); }
.ins-ib--danger { background: var(--danger-fill); color: var(--on-danger); }
.ins-ib.is-active { background: var(--selected); color: var(--on-selected); border-color: transparent; }

/* Chip */
.ins-chip { font-family: inherit; display: inline-flex; align-items: center; gap: var(--space-xs); height: 32px; padding: 0 14px; border: 1px solid var(--border-strong); border-radius: var(--radius-full); background: var(--surface-2); color: var(--text); font-size: 13px; line-height: 16px; font-weight: 700; letter-spacing: .006em; cursor: pointer; transition: background-color .18s ease; }
.ins-chip:hover { border-color: var(--outline); }
.ins-chip .ins-icon { margin-left: -2px; }
.ins-chip.is-selected { background: var(--selected); color: var(--on-selected); border-color: transparent; }

/* Busca */
.ins-search { display: flex; align-items: center; gap: 10px; height: 44px; padding: 0 16px; border: 1px solid var(--border-strong); border-radius: var(--radius-full); background: var(--surface-1); color: var(--text-subtle); transition: box-shadow .18s ease, border-color .18s ease; }
.ins-search:focus-within { border-color: transparent; box-shadow: var(--focus-ring); }
.ins-search input { flex: 1; min-width: 0; border: 0; outline: 0; background: transparent; color: var(--text); font: 500 15px/22px var(--font-sans); -webkit-appearance: none; appearance: none; }
.ins-search input::placeholder { color: var(--text-subtle); }
.ins-search input::-webkit-search-cancel-button { display: none; }
.ins-search__kbd { font: 700 11px/14px var(--font-sans); letter-spacing: .02em; color: var(--text-muted); border: 1px solid var(--border-strong); border-radius: var(--radius-sm); padding: 3px 7px; }

/* Progresso */
.ins-progress { display: grid; gap: 8px; }
.ins-progress__head { display: flex; justify-content: space-between; gap: var(--space-sm); font-size: 13px; line-height: 18px; font-weight: 500; letter-spacing: .006em; color: var(--text-muted); }
.ins-progress__val { font-variant-numeric: tabular-nums; color: var(--text); font-weight: 700; }
.ins-progress__track { height: 6px; border-radius: var(--radius-full); background: var(--surface-3); overflow: hidden; }
.ins-progress__fill { height: 100%; border-radius: inherit; background: var(--selected); transition: width .4s ease; }

/* Barra de navegação */
.ins-tabbar { display: inline-flex; align-items: center; gap: 4px; padding: 6px; border: 1px solid var(--border); border-radius: var(--radius-full); background: var(--surface-1); box-shadow: var(--shadow-1); }
.ins-tab { font-family: inherit; display: inline-flex; align-items: center; justify-content: center; gap: var(--space-xs); height: 44px; min-width: 44px; padding: 0 10px; border: 0; border-radius: var(--radius-full); background: transparent; color: var(--text-muted); cursor: pointer; transition: background-color .18s ease, color .18s ease; }
.ins-tab.has-label { padding: 0 16px 0 12px; }
.ins-tab:hover { color: var(--text); }
.ins-tab.is-active { background: var(--selected); color: var(--on-selected); }
.ins-tab__label { font-size: 13px; line-height: 16px; font-weight: 700; letter-spacing: .006em; }

/* Badge */
.ins-badge { display: inline-flex; align-items: center; gap: 6px; height: 24px; padding: 0 10px; border-radius: var(--radius-full); background: var(--surface-3); color: var(--text-muted); font-size: 13px; line-height: 16px; font-weight: 700; letter-spacing: .006em; white-space: nowrap; }
.ins-badge .ins-icon { margin-left: -3px; }
.ins-badge--brand { background: var(--accent-soft); color: var(--accent-text); }
.ins-badge--success { color: var(--success); }
.ins-badge--warning { color: var(--warning); }
.ins-badge--danger { color: var(--danger); }
.ins-badge__dot { width: 8px; height: 8px; border-radius: var(--radius-full); background: var(--live); box-shadow: 0 0 0 3px rgba(16, 185, 129, .2); }

/* Métrica */
.ins-metric { display: grid; gap: 4px; max-width: 168px; }
.ins-metric__value { font-size: 48px; line-height: 52px; font-weight: 800; letter-spacing: -.028em; font-variant-numeric: tabular-nums; color: var(--accent-text); }
.ins-metric__label { font-size: 13px; line-height: 18px; font-weight: 500; letter-spacing: .006em; color: var(--text-muted); }
.ins-metric--brand .ins-metric__value { color: var(--on-brand); }
.ins-metric--brand .ins-metric__label { color: var(--on-brand-muted); }

/* Bolha de chat */
.ins-bubble { display: grid; gap: 2px; max-width: 78%; padding: 10px 14px; border-radius: var(--radius-bubble); font-size: 15px; line-height: 22px; font-weight: 500; }
.ins-bubble--lead { justify-self: start; background: var(--surface-3); color: var(--text); border-bottom-left-radius: var(--radius-bubble-tail); }
.ins-bubble--insonai { justify-self: end; background: var(--accent); color: var(--on-accent); border-bottom-right-radius: var(--radius-bubble-tail); }
.ins-bubble__time { justify-self: end; font-size: 12px; line-height: 16px; letter-spacing: .01em; color: var(--text-muted); }
.ins-bubble--insonai .ins-bubble__time { color: var(--on-brand-muted); }

/* Foco */
.ins-btn:focus-visible, .ins-ib:focus-visible, .ins-chip:focus-visible, .ins-tab:focus-visible { outline: none; box-shadow: var(--focus-ring); }

@media (prefers-reduced-motion: reduce) {
  .ins-btn, .ins-ib, .ins-chip, .ins-tab, .ins-progress__fill, .ins-search { transition: none; }
  .ins-btn--cta:hover, .ins-btn:active { transform: none; }
}
