/*
 * Estilos da aplicacao web — Jarbas Versao 1
 * Usa exclusivamente tokens de /static/tokens.css (nunca cor literal).
 */

:root {
  --on-solid: var(--bg);
  --brand-accent: var(--azul);
  --logo-bg: var(--surface);
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --on-solid: var(--ink);
    --brand-accent: var(--ink);
    --logo-bg: var(--ink);
  }
}

:root[data-theme="dark"] {
  --on-solid: var(--ink);
  --brand-accent: var(--ink);
  --logo-bg: var(--ink);
}

*, *::before, *::after {
  box-sizing: border-box;
}

html, body {
  margin: 0;
  padding: 0;
  height: 100%;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--f-body);
  font-size: var(--text-base);
  line-height: 1.5;
}

button, input, textarea, select {
  font: inherit;
  color: inherit;
}

/* Logo oficial acsBrasil (altura fixa, largura automatica, pilula clara no escuro) */
.logo-pill {
  height: 38px;
  padding: 4px 10px;
  border-radius: var(--radius-sm);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  background: var(--logo-bg);
  text-decoration: none;
}

.logo-pill.logo-lg {
  height: 58px;
  padding: 6px 14px;
  border-radius: var(--radius-md);
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .logo-pill {
    box-shadow: var(--shadow-sm);
  }
}

:root[data-theme="dark"] .logo-pill {
  box-shadow: var(--shadow-sm);
}

.logo-pill img {
  height: 30px;
  width: auto;
  display: block;
}

.logo-pill.logo-lg img {
  height: 46px;
  width: auto;
}

/* Estrutura principal */
.workspace {
  display: flex;
  min-height: 100vh;
  width: 100%;
  background: var(--bg);
}

.main-column {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  background: var(--bg);
}

/* Topbar */
.topbar {
  position: sticky;
  top: 0;
  z-index: 50;
  height: 60px;
  padding: 0 var(--space-4);
  background: var(--bg);
  border-bottom: 1px solid var(--line-light);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
}

.topbar-left {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  min-width: 0;
}

.topbar-brand {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
}

.topbar-right {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  position: relative;
  flex-shrink: 0;
}

.icon-btn {
  width: 38px;
  height: 38px;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  background: transparent;
  color: var(--ink-secondary);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  position: relative;
}

.icon-btn:hover {
  background: var(--bg-alt);
  color: var(--ink);
  border-color: var(--line);
}

/* Botao e menu do Avatar */
.avatar-btn {
  height: 38px;
  padding: 0 var(--space-2) 0 var(--space-1);
  border-radius: var(--radius-pill);
  border: 1px solid var(--line);
  background: var(--surface);
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  cursor: pointer;
}

.avatar-btn:hover {
  border-color: var(--azul);
  background: var(--bg-alt);
}

.avatar-circle {
  width: 28px;
  height: 28px;
  border-radius: var(--radius-pill);
  background: var(--azul);
  color: var(--on-solid);
  font-family: var(--f-display);
  font-weight: 700;
  font-size: var(--text-xs);
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.avatar-name-short {
  font-family: var(--f-display);
  font-weight: 600;
  font-size: var(--text-xs);
  color: var(--ink);
}

@media (max-width: 480px) {
  .topbar-brand {
    gap: var(--space-1);
  }
  .topbar .logo-pill {
    height: 28px;
    padding: 3px 6px;
  }
  .topbar .logo-pill img {
    height: 22px;
    width: auto;
  }
  .new-chat-label {
    display: none;
  }
  .avatar-name-short {
    display: none;
  }
  .avatar-btn {
    padding: 0 4px;
  }
}

.dropdown-panel {
  position: absolute;
  top: calc(100% + var(--space-2));
  right: 0;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  z-index: 90;
  display: none;
}

.dropdown-panel.open {
  display: block;
}

.avatar-dropdown {
  width: 264px;
  padding: var(--space-2);
}

.avatar-menu-header {
  padding: var(--space-3);
  border-bottom: 1px solid var(--line-light);
  margin-bottom: var(--space-1);
}

.avatar-menu-name {
  font-family: var(--f-display);
  font-weight: 700;
  font-size: var(--text-sm);
  color: var(--ink);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-2);
}

.avatar-menu-email {
  font-family: var(--f-mono);
  font-size: var(--text-xs);
  color: var(--ink-muted);
  margin-top: 2px;
  word-break: break-all;
}

.menu-section-title {
  font-family: var(--f-mono);
  font-size: 11px;
  color: var(--ink-muted);
  padding: var(--space-2) var(--space-3) var(--space-1);
  text-transform: uppercase;
}

.menu-item {
  width: 100%;
  background: transparent;
  border: none;
  border-radius: var(--radius-sm);
  padding: var(--space-2) var(--space-3);
  font-family: var(--f-body);
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--ink);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-2);
  text-align: left;
  text-decoration: none;
}

.menu-item:hover {
  background: var(--bg-alt);
}

.menu-divider {
  height: 1px;
  background: var(--line-light);
  margin: var(--space-1) 0;
}

.logout-form {
  margin: 0;
}

.view-panel {
  display: none;
  flex: 1;
  flex-direction: column;
}

.view-panel.active {
  display: flex;
}

/* Chat */
.chat-stage {
  flex: 1;
  display: flex;
  flex-direction: column;
  max-width: 800px;
  width: 100%;
  margin: 0 auto;
  padding: var(--space-4);
}

.chat-stage.is-empty {
  justify-content: center;
}

.welcome-hero {
  text-align: center;
  margin-bottom: var(--space-5);
}

.chat-stage:not(.is-empty) .welcome-hero,
.chat-stage:not(.is-empty) .suggestions-grid {
  display: none;
}

.welcome-greeting {
  font-family: var(--f-display);
  font-weight: 700;
  font-size: var(--text-2xl);
  color: var(--ink);
  margin: 0;
  line-height: 1.25;
}

@media (min-width: 768px) {
  .welcome-greeting {
    font-size: var(--text-3xl);
  }
}

.conversation-list {
  display: flex;
  flex-direction: column;
  gap: var(--space-5);
  padding-bottom: var(--space-5);
}

.chat-stage.is-empty .conversation-list {
  display: none;
}

.turn-user {
  align-self: flex-end;
  max-width: 82%;
  background: var(--azul);
  color: var(--on-solid);
  padding: var(--space-3) var(--space-4);
  border-radius: var(--radius-lg) var(--radius-lg) var(--radius-sm) var(--radius-lg);
  font-size: var(--text-base);
  box-shadow: var(--shadow-sm);
}

.answer-card {
  align-self: flex-start;
  width: 100%;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: var(--space-4) var(--space-5);
  box-shadow: var(--shadow-sm);
}

.answer-card.answer-lei {
  border-left: 4px solid var(--info);
}

.answer-card-header {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-2);
  margin-bottom: var(--space-3);
  padding-bottom: var(--space-2);
  border-bottom: 1px solid var(--line-light);
}

.answer-card-label {
  font-family: var(--f-display);
  font-weight: 700;
  font-size: var(--text-sm);
  color: var(--ok);
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
}

.answer-card-label.law-label {
  color: var(--info);
}

.answer-article-title {
  font-family: var(--f-display);
  font-weight: 700;
  font-size: var(--text-base);
  color: var(--ink);
  margin: 0 0 var(--space-2) 0;
}

.answer-literal-text {
  margin: 0 0 var(--space-4) 0;
  font-size: var(--text-base);
  color: var(--ink);
  line-height: 1.6;
  white-space: pre-line;
}

.answer-card-footer {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
  padding-top: var(--space-3);
  border-top: 1px solid var(--line-light);
}

.answer-meta-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
  font-family: var(--f-mono);
  font-size: var(--text-xs);
  color: var(--ink-secondary);
  min-width: 0;
}

.law-link {
  color: var(--info);
  text-decoration: underline;
  word-break: break-all;
}

.law-link:hover {
  color: var(--brand-accent);
}

/* Cartao neutro de recusa */
.refusal-card {
  align-self: flex-start;
  width: 100%;
  background: var(--bg-alt);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: var(--space-4) var(--space-5);
}

.refusal-exact {
  margin: 0 0 var(--space-1) 0;
  font-family: var(--f-display);
  font-weight: 700;
  font-size: var(--text-base);
  color: var(--ink);
}

.refusal-hint {
  margin: 0;
  font-size: var(--text-sm);
  color: var(--ink-secondary);
}

/* Caixa de pergunta (Composer) */
.composer-dock {
  width: 100%;
  margin-top: auto;
}

.chat-stage.is-empty .composer-dock {
  margin-top: 0;
}

.composer-box {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: var(--space-3) var(--space-3) var(--space-3) var(--space-4);
  box-shadow: var(--shadow-md);
  display: flex;
  align-items: flex-end;
  gap: var(--space-2);
  transition: border-color 0.15s ease;
}

.composer-box:focus-within {
  border-color: var(--brand-accent);
}

.composer-textarea {
  flex: 1;
  border: none;
  background: transparent;
  resize: none;
  min-height: 52px;
  max-height: 160px;
  padding: var(--space-1) 0;
  font-size: var(--text-base);
  line-height: 1.45;
  color: var(--ink);
  outline: none;
}

.chat-stage:not(.is-empty) .composer-textarea {
  min-height: 36px;
}

.composer-textarea::placeholder {
  color: var(--ink-muted);
}

.btn-send {
  width: 42px;
  height: 42px;
  border-radius: var(--radius-md);
  border: none;
  background: var(--azul);
  color: var(--on-solid);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
}

.btn-send:hover:not(:disabled) {
  background: var(--azul-hover);
}

.btn-send:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.composer-disclaimer {
  margin: var(--space-2) 0 0 0;
  text-align: center;
  font-size: var(--text-xs);
  color: var(--ink-muted);
}

.suggestions-grid {
  margin-top: var(--space-5);
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-3);
}

@media (min-width: 640px) {
  .suggestions-grid {
    grid-template-columns: 1fr 1fr;
  }
}

.suggestion-card {
  text-align: left;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  padding: var(--space-3) var(--space-4);
  font-size: var(--text-sm);
  color: var(--ink);
  cursor: pointer;
  transition: border-color 0.15s ease, background 0.15s ease;
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
}

.suggestion-card:hover {
  border-color: var(--azul);
  background: var(--azul-surface);
}

.suggestion-topic {
  font-family: var(--f-mono);
  font-size: 11px;
  color: var(--ink-muted);
}

/* Mobile: caixa de pergunta fixa embaixo */
@media (max-width: 767px) {
  .chat-stage {
    padding: var(--space-4) var(--space-4) 176px;
  }

  .chat-stage.is-empty {
    justify-content: flex-start;
    padding-top: var(--space-5);
  }

  .composer-dock {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 45;
    background: var(--bg);
    border-top: 1px solid var(--line);
    padding: var(--space-3) var(--space-4);
  }

  .composer-textarea {
    min-height: 36px;
  }
}

/* Componentes de Gestao (ADM) */
.admin-container {
  max-width: 980px;
  width: 100%;
  margin: 0 auto;
  padding: var(--space-5) var(--space-4);
  flex: 1;
}

.back-link {
  background: none;
  border: none;
  padding: 0;
  margin-bottom: var(--space-3);
  color: var(--brand-accent);
  font-family: var(--f-display);
  font-weight: 700;
  font-size: var(--text-sm);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
  text-decoration: none;
}

.back-link:hover {
  text-decoration: underline;
}

.page-title {
  font-family: var(--f-display);
  font-weight: 700;
  font-size: var(--text-2xl);
  margin: 0 0 var(--space-1) 0;
}

.page-subtitle {
  margin: 0 0 var(--space-4) 0;
  color: var(--ink-secondary);
  font-size: var(--text-sm);
}

.btn {
  font-family: var(--f-display);
  font-weight: 600;
  font-size: var(--text-sm);
  border-radius: var(--radius-sm);
  padding: var(--space-2) var(--space-3);
  border: 1px solid transparent;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  white-space: nowrap;
  text-decoration: none;
}

.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.btn-primary {
  background: var(--azul);
  color: var(--on-solid);
}

.btn-primary:hover:not(:disabled) {
  background: var(--azul-hover);
}

.btn-ok {
  background: var(--ok);
  color: var(--bg);
}

.btn-outline {
  background: var(--surface);
  color: var(--ink);
  border-color: var(--line);
}

.btn-outline:hover:not(:disabled) {
  background: var(--bg-alt);
}

.btn-sm {
  padding: 4px var(--space-2);
  font-size: var(--text-xs);
}

.btn-block {
  width: 100%;
  padding: var(--space-3);
}

.pill {
  display: inline-flex;
  align-items: center;
  padding: 2px var(--space-2);
  border-radius: var(--radius-pill);
  font-family: var(--f-mono);
  font-size: var(--text-xs);
  font-weight: 500;
}

.pill-aprovado {
  color: var(--status-aprovado);
  background: var(--status-aprovado-bg);
}

.pill-a_revisar {
  color: var(--status-revisar);
  background: var(--status-revisar-bg);
}

.pill-desatualizado {
  color: var(--status-desatualizado);
  background: var(--status-desatualizado-bg);
}

.pill-retirado {
  color: var(--status-retirado);
  background: var(--status-retirado-bg);
}

.pill-info {
  color: var(--info);
  background: var(--info-soft);
}

.filter-row {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
  margin-bottom: var(--space-3);
}

.filter-chip {
  font-family: var(--f-display);
  font-weight: 600;
  font-size: var(--text-xs);
  padding: var(--space-2) var(--space-3);
  border-radius: var(--radius-pill);
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--ink-secondary);
  cursor: pointer;
}

.filter-chip.active {
  background: var(--azul);
  color: var(--on-solid);
  border-color: var(--azul);
}

.bulk-bar {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  padding: var(--space-3) var(--space-4);
  margin-bottom: var(--space-3);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
}

.check-row {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  font-size: var(--text-sm);
  font-weight: 600;
  cursor: pointer;
}

.check-row input,
.item-check {
  width: 18px;
  height: 18px;
  accent-color: var(--azul);
  cursor: pointer;
}

.feedback-banner {
  display: none;
  margin-bottom: var(--space-3);
  padding: var(--space-3) var(--space-4);
  border-radius: var(--radius-sm);
  background: var(--ok-soft);
  color: var(--ok);
  border-left: 4px solid var(--ok);
  font-size: var(--text-sm);
  font-weight: 600;
}

.feedback-banner.error-banner {
  background: var(--danger-soft);
  color: var(--danger);
  border-left-color: var(--danger);
}

.feedback-banner.visible {
  display: block;
}

.items-stack {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}

.item-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  padding: var(--space-4);
  display: flex;
  gap: var(--space-3);
  align-items: flex-start;
}

.item-card.just-approved {
  border-color: var(--ok);
}

.item-body {
  flex: 1;
  min-width: 0;
}

.item-top {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-2);
  margin-bottom: var(--space-2);
}

.mono {
  font-family: var(--f-mono);
  font-size: var(--text-xs);
}

.item-tema,
.item-wait-label {
  color: var(--ink-muted);
}

.item-source {
  color: var(--ink-secondary);
}

.item-q {
  font-family: var(--f-display);
  font-weight: 700;
  font-size: var(--text-base);
  margin: 0 0 var(--space-2) 0;
}

.item-a {
  margin: 0 0 var(--space-2) 0;
  padding: var(--space-3);
  background: var(--bg-alt);
  border-radius: var(--radius-sm);
  font-size: var(--text-sm);
  white-space: pre-line;
}

.item-foot {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-2);
  padding-top: var(--space-2);
  margin-top: var(--space-2);
  border-top: 1px solid var(--line-light);
}

.approval-stamp {
  font-family: var(--f-mono);
  font-size: var(--text-xs);
  color: var(--ok);
  background: var(--ok-soft);
  padding: 2px var(--space-2);
  border-radius: var(--radius-sm);
}

.card-box {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  padding: var(--space-4);
}

.empty-filter-text {
  margin: 0;
  color: var(--ink-secondary);
}

/* Tela de Login */
.login-screen {
  position: relative;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: var(--space-7) var(--space-4) var(--space-4);
  background: var(--bg-alt);
}

.login-theme-btn {
  position: absolute;
  top: var(--space-4);
  right: var(--space-4);
  background: var(--surface);
  border: 1px solid var(--line);
  color: var(--ink);
  box-shadow: var(--shadow-sm);
}

.login-card {
  width: 100%;
  max-width: 420px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: var(--space-6);
  box-shadow: var(--shadow-md);
}

.login-brand {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: var(--space-3);
  margin-bottom: var(--space-5);
}

.login-title {
  font-family: var(--f-display);
  font-size: var(--text-xl);
  margin: 0;
}

.login-subtitle {
  margin: 4px 0 0;
  font-size: var(--text-xs);
  color: var(--ink-muted);
}

.login-alert {
  display: none;
  padding: var(--space-3);
  border-radius: var(--radius-sm);
  margin-bottom: var(--space-4);
  font-size: var(--text-sm);
}

.login-alert.warn {
  display: block;
  background: var(--warn-soft);
  color: var(--warn);
  border-left: 4px solid var(--warn);
}

.login-alert.blocked {
  display: block;
  background: var(--danger-soft);
  color: var(--danger);
  border-left: 4px solid var(--danger);
  font-weight: 600;
}

.field-group {
  margin-bottom: var(--space-3);
}

.field-group-last {
  margin-bottom: var(--space-4);
}

.field-label {
  display: block;
  font-family: var(--f-display);
  font-weight: 600;
  font-size: var(--text-xs);
  margin-bottom: 4px;
  color: var(--ink-secondary);
}

.field-input {
  width: 100%;
  padding: var(--space-2) var(--space-3);
  border-radius: var(--radius-sm);
  border: 1px solid var(--line);
  background: var(--bg);
  font-size: var(--text-sm);
}

.field-input:focus {
  outline: 2px solid var(--brand-accent);
  outline-offset: 1px;
}


/* ===========================
   Login como landing page · 09/11 v3
   =========================== */
.lp {
  position: relative;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
  background:
    radial-gradient(600px 400px at 0% 0%, rgba(246, 178, 2, .16), transparent 70%),
    radial-gradient(700px 500px at 100% 20%, rgba(3, 43, 145, .10), transparent 70%),
    var(--bg-alt);
}

.lp-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
  max-width: 1240px;
  width: 100%;
  margin: 0 auto;
  padding: var(--space-4);
}
.lp-brand { display: flex; align-items: center; gap: var(--space-3); min-width: 0; }
.lp-brand-sep { width: 1px; height: 24px; background: var(--line); }
.lp-brand-name {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  font: 700 var(--text-lg)/1 var(--f-display);
  color: var(--ink);
}
.lp .lp-mark { width: 28px; height: 28px; font-size: 14px; border-radius: 8px; }
.lp .login-theme-btn {
  position: static;
  background: var(--surface);
  border: 1px solid var(--line);
  color: var(--ink);
  box-shadow: var(--shadow-sm);
}

.lp-hero {
  flex: 1;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  grid-template-areas: "copy" "login" "demo";
  gap: var(--space-6);
  max-width: 1240px;
  width: 100%;
  margin: 0 auto;
  padding: var(--space-4) var(--space-4) var(--space-7);
}
.lp-copy { grid-area: copy; }
.lp-demo { grid-area: demo; position: relative; }
.lp-login { grid-area: login; }

.lp-kicker {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  padding: 6px 12px;
  border-radius: var(--radius-pill);
  background: rgba(246, 178, 2, .18);
  color: var(--ink);
  font: 600 var(--text-xs)/1.2 var(--f-body);
}
.lp-title {
  margin: var(--space-4) 0 0;
  font: 700 2.25rem/1.05 var(--f-display);
  letter-spacing: -.02em;
  color: var(--ink);
}
.lp-title mark {
  white-space: nowrap;
  background: linear-gradient(transparent 62%, rgba(246, 178, 2, .75) 62%, rgba(246, 178, 2, .75) 92%, transparent 92%);
  color: inherit;
  padding: 0 2px;
}
.lp-sub {
  margin: var(--space-4) 0 0;
  max-width: 46ch;
  font-size: var(--text-lg);
  line-height: 1.5;
  color: var(--ink-secondary);
}

/* Janela de demonstração */
.demo-window {
  position: relative;
  z-index: 1;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--surface);
  box-shadow: 0 30px 60px -20px rgba(6, 22, 74, .35), 0 2px 6px rgba(6, 22, 74, .06);
  overflow: hidden;
}
.demo-bar {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: 10px 14px;
  border-bottom: 1px solid var(--line-light);
  background: var(--bg-alt);
}
.demo-dots { display: inline-flex; gap: 6px; }
.demo-dots i { width: 9px; height: 9px; border-radius: 50%; background: var(--line); }
.demo-dots i:first-child { background: #F6B202; }
.demo-url {
  flex: 1;
  max-width: 220px;
  padding: 3px 10px;
  border-radius: var(--radius-pill);
  background: var(--surface);
  border: 1px solid var(--line-light);
  font: 500 11px/1.5 var(--f-mono);
  color: var(--ink-muted);
}
.demo-body {
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
  min-height: 250px;
  padding: var(--space-5);
}
.demo-q {
  align-self: flex-end;
  max-width: 85%;
  min-height: 1.4em;
  padding: 10px 14px;
  border-radius: 16px 16px 4px 16px;
  background: var(--azul);
  color: #FFFFFF;
  font-size: var(--text-sm);
  line-height: 1.4;
}
.demo-q.typing::after {
  content: "";
  display: inline-block;
  width: 2px;
  height: 1em;
  margin-left: 2px;
  vertical-align: -2px;
  background: currentColor;
  animation: demo-caret .8s steps(1) infinite;
}
@keyframes demo-caret { 50% { opacity: 0; } }

.demo-turn { display: flex; align-items: flex-start; gap: var(--space-3); }
.demo-avatar { flex: none; }
.demo-typing {
  display: inline-flex;
  gap: 5px;
  padding: 14px 16px;
  border-radius: 4px 16px 16px 16px;
  background: var(--bg-alt);
}
.demo-typing[hidden] { display: none; }
.demo-typing i {
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--ink-muted);
  animation: demo-dot 1s ease-in-out infinite;
}
.demo-typing i:nth-child(2) { animation-delay: .15s; }
.demo-typing i:nth-child(3) { animation-delay: .3s; }
@keyframes demo-dot { 0%, 100% { opacity: .3; transform: translateY(0); } 50% { opacity: 1; transform: translateY(-3px); } }

.demo-card {
  flex: 1;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-left: 4px solid var(--ok);
  border-radius: 4px 16px 16px 16px;
  background: var(--surface);
  box-shadow: var(--shadow-md);
  transition: opacity .35s ease, transform .35s ease;
}
.demo-card.is-hidden { opacity: 0; transform: translateY(8px); }
.demo-card[hidden] { display: none; }
.demo-seal {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 2px 10px;
  border-radius: var(--radius-pill);
  background: var(--ok-soft);
  color: var(--ok);
  font: 700 10px/1.7 var(--f-mono);
  letter-spacing: .06em;
  text-transform: uppercase;
}
.demo-seal::before { content: "✓"; font-weight: 700; }
.demo-text {
  margin: 8px 0 6px;
  font: 600 var(--text-base)/1.4 var(--f-body);
  color: var(--ink);
}
.demo-meta { margin: 0; font: 500 11px/1.5 var(--f-mono); color: var(--ink-muted); }

.demo-card[data-tipo="lei"] { border-left-color: #F6B202; }
.demo-card[data-tipo="lei"] .demo-seal { background: rgba(246, 178, 2, .18); color: #9A6A00; }
.demo-card[data-tipo="lei"] .demo-seal::before { content: "§"; }
.demo-card[data-tipo="lei"] .demo-text { font-family: Georgia, "Times New Roman", serif; font-weight: 400; font-style: italic; font-size: var(--text-sm); }
.demo-card[data-tipo="recusa"] { border-left-color: var(--ink-muted); border-style: dashed; border-left-style: solid; box-shadow: none; }
.demo-card[data-tipo="recusa"] .demo-seal { background: var(--bg-alt); color: var(--ink-secondary); }
.demo-card[data-tipo="recusa"] .demo-seal::before { content: "○"; }

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .demo-card[data-tipo="lei"] .demo-seal { color: #F6B202; }
}
:root[data-theme="dark"] .demo-card[data-tipo="lei"] .demo-seal { color: #F6B202; }

.demo-steps {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
  margin-top: var(--space-4);
}
.demo-step {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  padding: 6px 12px 6px 6px;
  border: 1px solid var(--line);
  border-radius: var(--radius-pill);
  background: var(--surface);
  color: var(--ink-secondary);
  font: 600 var(--text-xs)/1.2 var(--f-body);
  cursor: pointer;
}
.demo-step b {
  display: inline-flex; align-items: center; justify-content: center;
  width: 20px; height: 20px; border-radius: 50%;
  background: var(--bg-alt);
  font: 700 11px/1 var(--f-mono);
}
.demo-step.active { border-color: var(--azul); color: var(--ink); }
.demo-step.active b { background: #F6B202; color: #06164A; }

.demo-float {
  position: absolute;
  z-index: 2;
  display: none;
  align-items: center;
  gap: var(--space-2);
  padding: 8px 14px 8px 8px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface);
  box-shadow: var(--shadow-lg);
  font: 700 var(--text-sm)/1 var(--f-display);
  color: var(--ink);
}
.demo-float-icon {
  display: inline-flex; align-items: center; justify-content: center;
  width: 30px; height: 30px; border-radius: 9px;
  background: var(--azul); color: #FFFFFF;
}
.demo-float-icon.gold { background: #F6B202; color: #06164A; }

/* Cartão de login */
.lp .login-card {
  max-width: 420px;
  margin: 0 auto;
  padding: var(--space-6);
  border: 1px solid var(--line);
  border-radius: 20px;
  background: var(--surface);
  box-shadow: 0 24px 48px -16px rgba(6, 22, 74, .22);
}
.lp .login-title { font-size: var(--text-2xl); letter-spacing: -.01em; }
.lp .login-subtitle { margin: 4px 0 var(--space-5); font-size: var(--text-sm); }
.lp .field-input {
  padding: 12px 14px;
  border-radius: var(--radius-md);
  font-size: var(--text-base);
}
.lp .btn-block {
  padding: 13px 16px;
  border-radius: var(--radius-md);
  font-size: var(--text-base);
}

.field-password { position: relative; }
.field-password .field-input { padding-right: 84px; }
.field-password-btn {
  position: absolute;
  top: 50%;
  right: 8px;
  transform: translateY(-50%);
  padding: 6px 10px;
  border: 0;
  border-radius: var(--radius-sm);
  background: var(--azul-light);
  color: var(--azul);
  font: 600 var(--text-xs)/1 var(--f-body);
  cursor: pointer;
}
.field-password-btn:disabled { opacity: .5; cursor: not-allowed; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .field-password-btn { color: #C9D3F0; }
}
:root[data-theme="dark"] .field-password-btn { color: #C9D3F0; }

.login-help {
  margin: var(--space-5) 0 0;
  font-size: var(--text-xs);
  color: var(--ink-muted);
  text-align: center;
}

.dot-ok { background: #34D399; }
.dot-gold { background: #F6B202; }
.dot-light { background: #93A9F5; }

/* Faixa de diferenciais */
.lp-band {
  position: relative;
  overflow: hidden;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--space-5) var(--space-4);
  padding: var(--space-6) var(--space-4);
  background: #06164A;
  color: #FFFFFF;
}
.lp-band-item { display: flex; flex-direction: column; gap: 4px; text-align: center; }
.lp-band-item strong {
  font: 700 1.75rem/1.1 var(--f-display);
  color: #F6B202;
}
.lp-band-item span { font-size: var(--text-sm); color: #C9D3F0; }

@media (min-width: 720px) {
  .lp-title { font-size: 3.25rem; }
  .lp-band {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    padding: var(--space-6) max(var(--space-6), calc((100vw - 1240px) / 2));
  }
  .lp-band-item + .lp-band-item { border-left: 1px solid rgba(255, 255, 255, .14); }
}

@media (min-width: 1100px) {
  .lp-top { padding: var(--space-5) var(--space-6); }
  .lp-hero {
    grid-template-columns: minmax(0, 1fr) 400px;
    grid-template-areas: "copy login" "demo login";
    grid-template-rows: auto 1fr;
    column-gap: var(--space-8);
    row-gap: var(--space-6);
    align-items: start;
    padding: var(--space-5) var(--space-6) var(--space-7);
  }
  .lp-login { align-self: center; position: sticky; top: var(--space-6); }
  .lp .login-card { margin: 0; }
  .lp-title { font-size: 3.6rem; }
  .lp-demo { max-width: 620px; margin-left: 40px; }
  .demo-float { display: inline-flex; }
  .demo-float-a { left: -44px; top: 70px; }
  .demo-float-b { right: -34px; bottom: 22px; }
}

@media (prefers-reduced-motion: no-preference) {
  .demo-float-a { animation: lp-float 6s ease-in-out infinite; }
  .demo-float-b { animation: lp-float 7s ease-in-out -2s infinite; }
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .lp .jarbas-mark { background: #2747B8; }
}
:root[data-theme="dark"] .lp .jarbas-mark { background: #2747B8; }

@keyframes lp-float { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-8px); } }

/* ===========================
   Chat estilo assistente moderno · 09/11
   =========================== */
.jarbas-mark {
  position: relative;
  flex: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 10px;
  background: #06164A;
  color: #FFFFFF;
  font: 700 16px/1 var(--f-display);
}
.jarbas-mark::after {
  content: "";
  position: absolute;
  bottom: -3px;
  left: 50%;
  width: 14px;
  height: 6px;
  transform: translateX(-50%);
  border-radius: 3px;
  background: #F6B202;
}
.jarbas-mark-lg {
  width: 56px;
  height: 56px;
  border-radius: 16px;
  font-size: 28px;
  margin-bottom: var(--space-4);
}
.jarbas-mark-lg::after { width: 22px; height: 8px; bottom: -4px; }

/* Barra lateral */
.sidebar { display: none; }

@media (min-width: 1024px) {
  .sidebar {
    position: sticky;
    top: 0;
    height: 100vh;
    flex: 0 0 264px;
    display: flex;
    flex-direction: column;
    gap: var(--space-5);
    padding: var(--space-5) var(--space-4);
    background: var(--bg-alt);
    border-right: 1px solid var(--line-light);
    overflow-y: auto;
  }
  .topbar .logo-pill { display: none; }
}

.sidebar-brand { display: flex; align-items: center; gap: var(--space-3); }
.sidebar-title { font: 700 var(--text-lg)/1.1 var(--f-display); color: var(--ink); }
.sidebar-sub { font-size: var(--text-xs); color: var(--ink-muted); }

.sidebar-new {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  width: 100%;
  padding: 10px 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--surface);
  color: var(--ink);
  font: 600 var(--text-sm)/1 var(--f-body);
  cursor: pointer;
  box-shadow: var(--shadow-sm);
}
.sidebar-new:hover { border-color: var(--azul); }

.sidebar-section { display: flex; flex-direction: column; gap: 2px; }
.sidebar-label {
  margin-bottom: var(--space-1);
  padding: 0 var(--space-2);
  font: 500 11px/1.4 var(--f-mono);
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--ink-muted);
}
.sidebar-item {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  padding: 8px var(--space-2);
  border-radius: var(--radius-sm);
  font-size: var(--text-sm);
  color: var(--ink);
}
.sidebar-item.active { background: var(--azul-light); color: var(--azul); font-weight: 600; }
.sidebar-item.soon { color: var(--ink-muted); }
.sidebar-item em,
.tool-chip.soon::after {
  margin-left: auto;
  padding: 1px 6px;
  border: 1px dashed var(--line);
  border-radius: var(--radius-pill);
  font: normal 500 10px/1.5 var(--f-mono);
  color: var(--ink-muted);
}
.sidebar-foot {
  margin-top: auto;
  display: flex;
  align-items: center;
  gap: var(--space-2);
  font-size: var(--text-xs);
  color: var(--ink-muted);
}
.dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; flex: none; }

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .sidebar-item.active { color: #C9D3F0; }
}
:root[data-theme="dark"] .sidebar-item.active { color: #C9D3F0; }

/* Boas-vindas */
.welcome-hero { display: flex; flex-direction: column; align-items: center; }
.welcome-sub {
  max-width: 52ch;
  margin: var(--space-3) auto 0;
  font-size: var(--text-base);
  color: var(--ink-secondary);
}

/* Caixa de pergunta */
.composer-box {
  border-radius: 24px;
  padding: var(--space-3) var(--space-3) var(--space-3) var(--space-5);
}
.btn-send { border-radius: 50%; }

.composer-tools {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-2);
  margin-top: var(--space-2);
  padding: 0 var(--space-2);
}
.tool-chip {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius-pill);
  background: transparent;
  font: 500 var(--text-xs)/1.4 var(--f-body);
  color: var(--ink-secondary);
}
.tool-chip.active { background: var(--azul-light); border-color: transparent; color: var(--azul); font-weight: 600; }
.tool-chip.soon { border-style: dashed; color: var(--ink-muted); cursor: not-allowed; }
.composer-hint { margin-left: auto; font-size: 11px; color: var(--ink-muted); }

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .tool-chip.active { color: #C9D3F0; }
}
:root[data-theme="dark"] .tool-chip.active { color: #C9D3F0; }

@media (min-width: 768px) {
  .chat-stage:not(.is-empty) .composer-dock {
    position: sticky;
    bottom: 0;
    padding: var(--space-5) 0 var(--space-3);
    background: linear-gradient(to bottom, transparent, var(--bg) 35%);
  }
}

@media (max-width: 767px) {
  .composer-hint { display: none; }
}

/* Sugestões */
.suggestion-card {
  border-radius: var(--radius-lg);
  padding: var(--space-4);
  font-size: var(--text-base);
  box-shadow: var(--shadow-sm);
  transition: transform .15s ease, border-color .15s ease, background .15s ease;
}
.suggestion-card:hover { transform: translateY(-1px); }

/* Conversa */
.turn-user { border-radius: 20px 20px 6px 20px; }

.turn-bot {
  display: flex;
  align-items: flex-start;
  gap: var(--space-3);
  width: 100%;
}
.turn-bot-body { flex: 1; min-width: 0; }
.turn-bot .answer-card,
.turn-bot .refusal-card { box-shadow: none; }

.answer-card-label { text-transform: uppercase; letter-spacing: .04em; font-size: var(--text-xs); }

.refusal-actions { display: flex; flex-wrap: wrap; gap: var(--space-2); margin-top: var(--space-3); }

.typing-card {
  display: inline-flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-3) var(--space-4);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--surface);
  font-size: var(--text-sm);
  color: var(--ink-secondary);
}
.typing-dots { display: inline-flex; gap: 4px; }
.typing-dots i {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--azul);
  animation: jarbas-dot 1s infinite ease-in-out;
}
.typing-dots i:nth-child(2) { animation-delay: .15s; }
.typing-dots i:nth-child(3) { animation-delay: .3s; }
@keyframes jarbas-dot {
  0%, 80%, 100% { opacity: .25; transform: translateY(0); }
  40% { opacity: 1; transform: translateY(-3px); }
}
@media (prefers-reduced-motion: reduce) {
  .typing-dots i { animation: none; opacity: .6; }
}
.sidebar-item em, .tool-chip.soon { white-space: nowrap; }

/* ===========================
   Seletor de departamento (só os liberados) · 09/11 v2
   =========================== */
.dept-switch { position: relative; }
.dept-btn {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  width: 100%;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--surface);
  color: var(--ink);
  font: 600 var(--text-sm)/1.2 var(--f-body);
  text-align: left;
  cursor: pointer;
}
.dept-btn:hover, .dept-btn[aria-expanded="true"] { border-color: var(--azul); }
.dept-name { flex: 1; }
.dept-chevron { color: var(--ink-muted); transition: transform .15s ease; }
.dept-btn[aria-expanded="true"] .dept-chevron { transform: rotate(180deg); }
.dept-icon {
  flex: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 8px;
  background: #F6B202;
  color: #06164A;
  font: 700 11px/1 var(--f-mono);
}
.dept-menu {
  position: absolute;
  z-index: 20;
  top: calc(100% + 6px);
  left: 0;
  right: 0;
  padding: var(--space-2);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--surface);
  box-shadow: var(--shadow-lg);
}
.dept-menu[hidden] { display: none; }
.dept-menu-label {
  padding: 4px 8px 6px;
  font: 500 11px/1.4 var(--f-mono);
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--ink-muted);
}
.dept-opt {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  width: 100%;
  padding: 6px 8px;
  border: 0;
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--ink);
  font: 600 var(--text-sm)/1.2 var(--f-body);
  text-align: left;
  cursor: pointer;
}
.dept-opt span:not(.dept-icon) { flex: 1; }
.dept-opt.active { background: var(--azul-light); }
.dept-check { color: var(--azul); }
.dept-menu-note {
  margin: var(--space-2) 0 0;
  padding: var(--space-2) 8px 2px;
  border-top: 1px solid var(--line-light);
  font-size: var(--text-xs);
  color: var(--ink-muted);
}
.sidebar-item.soon svg { flex: none; opacity: .7; }
.sidebar-item.soon { cursor: default; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .dept-opt.active { background: rgba(147, 169, 245, .14); }
  :root:not([data-theme="light"]) .dept-check { color: #C9D3F0; }
}
:root[data-theme="dark"] .dept-opt.active { background: rgba(147, 169, 245, .14); }
:root[data-theme="dark"] .dept-check { color: #C9D3F0; }

/* ===========================
   Turma do Jarbas (personagens) + movimento · 09/11 v5
   =========================== */
.persona { display: block; flex: none; object-fit: contain; }
.lp-mark-img { width: 34px; height: 34px; }
.demo-avatar.persona { width: 42px; height: 42px; margin-top: -4px; }
.bot-persona { width: 38px; height: 38px; margin-top: -4px; }
.user-persona { width: 32px; height: 32px; }
.welcome-persona { width: 96px; height: 96px; margin: 0 auto var(--space-2); }

.lp .login-card { position: relative; margin-top: 64px; }
.card-turma {
  position: absolute;
  top: -66px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  align-items: flex-end;
  gap: 2px;
  pointer-events: none;
}
.card-turma .persona { width: 64px; height: 64px; }
.card-turma .persona:nth-child(2) { width: 78px; height: 78px; }

.avatar-circle.has-persona { background: transparent; width: 32px; height: 32px; padding: 0; }
.avatar-circle.has-persona img { width: 100%; height: 100%; object-fit: contain; }
.avatar-circle.is-logo { width: 46px; border-radius: 8px; background: #FFFFFF; border: 1px solid var(--line); }
.avatar-circle.is-logo img { padding: 2px 3px; }
.turn-user-row > .user-persona { margin-bottom: 0; }

/* Demo: pergunta com avatar e turma espiando na base da janela */
.demo-ask { display: flex; align-items: flex-end; justify-content: flex-end; gap: var(--space-2); }
.demo-ask .demo-q { max-width: 80%; }
.demo-user.persona { width: 34px; height: 34px; }
.demo-body { min-height: 236px; }


/* Entrada da página */
@media (prefers-reduced-motion: no-preference) {
  .lp-in { opacity: 0; transform: translateY(14px); animation: lp-in .6s cubic-bezier(.2, .7, .2, 1) forwards; }
  .lp-in.d1 { animation-delay: 0ms; }
  .lp-in.d2 { animation-delay: 90ms; }
  .lp-in.d3 { animation-delay: 180ms; }
  .lp-in.d4 { animation-delay: 260ms; }
  .lp-in.d5 { animation-delay: 340ms; }

  .lp-title mark {
    background-size: 0% 100%;
    background-repeat: no-repeat;
    animation: lp-mark .7s .55s ease-out forwards;
  }

  .card-turma .persona { animation: lp-bob 3.2s ease-in-out infinite; }
  .card-turma .persona:nth-child(2) { animation-delay: .3s; }
  .card-turma .persona:nth-child(3) { animation-delay: .6s; }
  .card-turma .persona:nth-child(4) { animation-delay: .9s; }
  .welcome-persona { animation: lp-bob 3.6s ease-in-out infinite; }

  .demo-user.pop { animation: lp-pop .45s cubic-bezier(.3, 1.6, .5, 1); }
  .demo-card:not(.is-hidden) { animation: lp-card .45s cubic-bezier(.3, 1.4, .5, 1); }

  .demo-step.active::after { animation: lp-progress var(--cena-ms, 4800ms) linear forwards; }
}
@keyframes lp-in { to { opacity: 1; transform: none; } }
@keyframes lp-mark { to { background-size: 100% 100%; } }
@keyframes lp-bob { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-5px) rotate(-2deg); } }
@keyframes lp-pop { 0% { transform: scale(.4); } 100% { transform: scale(1); } }
@keyframes lp-card { 0% { transform: translateY(10px) scale(.97); } 100% { transform: none; } }
@keyframes lp-progress { from { transform: scaleX(0); } to { transform: scaleX(1); } }

/* Barra de progresso no passo ativo */
.demo-step { position: relative; overflow: hidden; }
.demo-step::after {
  content: "";
  position: absolute;
  left: 0; right: 0; bottom: 0;
  height: 2px;
  background: #F6B202;
  transform: scaleX(0);
  transform-origin: left;
}

/* Fundo com brilho que se move devagar */
.lp::before {
  content: "";
  position: absolute;
  inset: -20% -10% auto auto;
  width: 640px;
  height: 640px;
  border-radius: 50%;
  background: conic-gradient(from 90deg, rgba(59, 130, 246, .16), rgba(246, 178, 2, .18), rgba(52, 211, 153, .12), rgba(244, 114, 182, .12), rgba(59, 130, 246, .16));
  filter: blur(60px);
  pointer-events: none;
}
@media (prefers-reduced-motion: no-preference) {
  .lp::before { animation: lp-spin 24s linear infinite; }
}
@keyframes lp-spin { to { transform: rotate(360deg); } }
.lp > * { position: relative; }

/* Chat: escolha de avatar */
.avatar-circle.blob { border-radius: 52% 48% 46% 54% / 58% 56% 44% 42%; color: transparent; font-size: 0; width: 30px; height: 28px; }
.avatar-pick { padding: var(--space-2) var(--space-3) var(--space-3); }
.avatar-pick-title {
  margin-bottom: var(--space-2);
  font: 500 11px/1.4 var(--f-mono);
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--ink-muted);
}
.avatar-pick-grid { display: flex; flex-wrap: wrap; gap: 8px; }
.avatar-pick-btn {
  display: inline-flex; align-items: center; justify-content: center;
  width: 42px; height: 42px;
  border: 2px solid transparent;
  border-radius: 12px;
  background: var(--bg-alt);
  cursor: pointer;
}
.avatar-pick-btn[aria-pressed="true"] { border-color: var(--azul); background: var(--azul-light); }
.avatar-pick-btn:hover img { transform: translateY(-3px) scale(1.08); }
.avatar-pick-btn img { width: 32px; height: 32px; object-fit: contain; transition: transform .2s cubic-bezier(.3, 1.6, .5, 1); }
.avatar-pick-btn[data-avatar="acs"] { width: 64px; }
.avatar-pick-btn[data-avatar="acs"] img { width: 54px; }
.avatar-pick-btn.initials { font: 700 11px/1 var(--f-display); color: var(--ink-secondary); }
.turn-user-row { display: flex; align-items: flex-end; justify-content: flex-end; gap: var(--space-2); align-self: flex-end; max-width: 88%; }
.turn-user-row .turn-user { max-width: none; }
.turn-user-row > .blob { width: 28px; height: 26px; margin-bottom: 2px; }

/* Faixa com brilho neon nas cores da marca */
.lp-band::before {
  content: "";
  position: absolute;
  inset: -60% -10% auto;
  height: 160%;
  background:
    radial-gradient(40% 60% at 15% 100%, rgba(52, 211, 153, .28), transparent 70%),
    radial-gradient(40% 60% at 50% 100%, rgba(246, 178, 2, .22), transparent 70%),
    radial-gradient(40% 60% at 85% 100%, rgba(244, 114, 182, .26), transparent 70%);
  pointer-events: none;
}
.lp-band-item { position: relative; }
.sidebar-persona { width: 40px; height: 40px; }

/* ===========================
   Autocompletar + "Você quis dizer" · 10/11
   =========================== */
.composer-box { position: relative; }
.autocomplete {
  position: absolute;
  z-index: 30;
  left: 0;
  right: 0;
  bottom: calc(100% + 8px);
  max-height: 340px;
  overflow-y: auto;
  padding: 6px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--surface);
  box-shadow: 0 18px 40px -12px rgba(6, 22, 74, .28);
  text-align: left;
}
.autocomplete[hidden] { display: none; }
.autocomplete-head {
  padding: 6px 10px 4px;
  font: 500 11px/1.4 var(--f-mono);
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--ink-muted);
}
.autocomplete-item {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 10px;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: var(--ink);
  font: 500 var(--text-sm)/1.35 var(--f-body);
  text-align: left;
  cursor: pointer;
}
.autocomplete-item:hover,
.autocomplete-item.active { background: var(--azul-light); }
.autocomplete-icon {
  flex: none;
  display: inline-flex; align-items: center; justify-content: center;
  width: 22px; height: 22px;
  border-radius: 50%;
  background: var(--ok-soft);
  color: var(--ok);
  font-size: 12px; font-weight: 700;
}
.autocomplete-text { flex: 1; min-width: 0; }
.autocomplete-tema {
  flex: none;
  max-width: 34%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  padding: 2px 8px;
  border-radius: var(--radius-pill);
  background: var(--bg-alt);
  font: 500 10px/1.6 var(--f-mono);
  color: var(--ink-muted);
}
@media (max-width: 560px) { .autocomplete-tema { display: none; } }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .autocomplete-item:hover,
  :root:not([data-theme="light"]) .autocomplete-item.active { background: rgba(147, 169, 245, .14); }
}
:root[data-theme="dark"] .autocomplete-item:hover,
:root[data-theme="dark"] .autocomplete-item.active { background: rgba(147, 169, 245, .14); }

.turn-stack { display: flex; flex-direction: column; gap: var(--space-3); }
.did-you-mean {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.did-you-mean-title {
  margin: 0 0 2px;
  font: 500 11px/1.4 var(--f-mono);
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--ink-muted);
}
.did-you-mean-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
  width: 100%;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface);
  color: var(--ink);
  font: 600 var(--text-sm)/1.35 var(--f-body);
  text-align: left;
  cursor: pointer;
  transition: border-color .15s ease, transform .15s ease, box-shadow .15s ease;
}
.did-you-mean-item:hover {
  border-color: var(--azul);
  transform: translateY(-1px);
  box-shadow: var(--shadow-md);
}
.did-you-mean-arrow { color: var(--azul); font-weight: 700; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .did-you-mean-arrow { color: #C9D3F0; }
}
:root[data-theme="dark"] .did-you-mean-arrow { color: #C9D3F0; }

/* Histórico local (7 dias) · 10/11 */
.history-list { display: flex; flex-direction: column; gap: 2px; max-height: 38vh; overflow-y: auto; }
.history-item {
  display: flex;
  flex-direction: column;
  gap: 2px;
  width: 100%;
  padding: 8px 10px;
  border: 0;
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--ink);
  text-align: left;
  cursor: pointer;
}
.history-item:hover { background: var(--line-light); }
.history-item.active { background: var(--azul-light); }
.history-title {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font: 600 var(--text-sm)/1.3 var(--f-body);
}
.history-meta { font: 500 11px/1.3 var(--f-mono); color: var(--ink-muted); }
.history-empty { margin: 0; padding: 0 var(--space-2); font-size: var(--text-xs); color: var(--ink-muted); }
.history-empty[hidden] { display: none; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .history-item.active { background: rgba(147, 169, 245, .14); }
}
:root[data-theme="dark"] .history-item.active { background: rgba(147, 169, 245, .14); }

/* ===== Gaveta do menu lateral no celular/tablet (10/11) ===== */
.btn-menu { display: inline-flex; }
.sidebar-backdrop { display: none; }
@media (max-width: 1023px) {
  body.sidebar-open .sidebar {
    display: flex;
    flex-direction: column;
    gap: var(--space-5);
    position: fixed;
    inset: 0 auto 0 0;
    z-index: 120;
    width: min(300px, 86vw);
    height: 100dvh;
    padding: var(--space-5) var(--space-4);
    background: var(--bg-alt);
    border-right: 1px solid var(--line-light);
    box-shadow: 0 20px 60px rgba(10, 20, 50, .28);
    overflow-y: auto;
    animation: gaveta-entra .18s ease-out;
  }
  body.sidebar-open .sidebar-backdrop:not([hidden]) {
    display: block;
    position: fixed;
    inset: 0;
    z-index: 110;
    background: rgba(10, 20, 50, .38);
  }
  body.sidebar-open { overflow: hidden; }
}
@media (min-width: 1024px) { .btn-menu { display: none; } }
@keyframes gaveta-entra { from { transform: translateX(-16px); opacity: 0; } to { transform: none; opacity: 1; } }
@media (prefers-reduced-motion: reduce) { body.sidebar-open .sidebar { animation: none; } }

/* ===== Temas verificados (sem resposta nunca é beco sem saída) — 10/11 ===== */
.topic-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.topic-chip {
  padding: 8px 14px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
  color: var(--ink);
  font: 600 var(--text-sm)/1.2 var(--f-body);
  cursor: pointer;
  transition: border-color .15s ease;
}
.topic-chip:hover { border-color: var(--azul); }
.topic-chip[aria-pressed="true"] { background: var(--azul); border-color: var(--azul); color: #fff; }
.topic-list { display: flex; flex-direction: column; gap: 6px; }
.topic-list:not(:empty) { margin-top: 6px; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .topic-chip[aria-pressed="true"] { background: #C9D3F0; border-color: #C9D3F0; color: #0B1430; }
}
:root[data-theme="dark"] .topic-chip[aria-pressed="true"] { background: #C9D3F0; border-color: #C9D3F0; color: #0B1430; }

/* ===== Explorar temas + guia da Gestão (10/11) ===== */
.sidebar-explore {
  display: inline-flex; align-items: center; gap: var(--space-2);
  width: 100%; margin-top: calc(var(--space-3) * -1);
  padding: 9px 14px; border: 1px dashed var(--line); border-radius: var(--radius-md);
  background: transparent; color: var(--azul);
  font: 600 var(--text-sm)/1.2 var(--f-body); cursor: pointer; text-align: left;
}
.sidebar-explore:hover { border-style: solid; border-color: var(--azul); background: var(--surface); }
.welcome-explore {
  margin-top: var(--space-4); padding: 8px 16px;
  border: 1px solid var(--line); border-radius: 999px; background: var(--surface);
  color: var(--azul); font: 600 var(--text-sm)/1.2 var(--f-body); cursor: pointer;
}
.welcome-explore:hover { border-color: var(--azul); }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .sidebar-explore,
  :root:not([data-theme="light"]) .welcome-explore { color: #C9D3F0; }
}
:root[data-theme="dark"] .sidebar-explore, :root[data-theme="dark"] .welcome-explore { color: #C9D3F0; }

.guide-box {
  margin: var(--space-4) 0; padding: var(--space-4) var(--space-5);
  border: 1px solid var(--line); border-left: 4px solid var(--azul);
  border-radius: var(--radius-md); background: var(--surface);
}
.guide-box summary { cursor: pointer; font: 700 var(--text-base)/1.4 var(--f-body); color: var(--ink); }
.guide-hint { font-weight: 400; color: var(--ink-muted); font-size: var(--text-sm); }
.guide-steps { margin: var(--space-3) 0 0; padding-left: 1.3em; display: grid; gap: 8px; color: var(--ink-secondary); font-size: var(--text-sm); line-height: 1.5; }
.guide-steps b { color: var(--ink); }
.guide-note { margin: var(--space-3) 0 0; font-size: var(--text-sm); color: var(--ink-muted); }

/* ===== Seletor de fonte (estilo seletor de modelo) — 10/11 ===== */
.source-picker { position: relative; }
.source-btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 6px 12px; border: 1px solid transparent; border-radius: 999px;
  background: var(--azul-light); color: var(--azul);
  font: 600 var(--text-sm)/1.2 var(--f-body); cursor: pointer;
}
.source-btn:hover { border-color: var(--azul); }
.source-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--ok, #16A34A); }
.source-picker[data-fonte="amolando"] .source-dot { background: var(--amarelo); }
.source-picker[data-fonte="externas"] .source-dot { background: var(--azul); }
.source-menu {
  position: absolute; bottom: calc(100% + 8px); left: 0; z-index: 60;
  min-width: 260px; padding: 6px;
  border: 1px solid var(--line); border-radius: 16px; background: var(--surface);
  box-shadow: var(--shadow-lg, 0 18px 48px rgba(10, 20, 50, .18));
}
.source-opt {
  display: grid; gap: 2px; width: 100%; padding: 10px 12px 10px 34px; position: relative;
  border: 0; border-radius: 10px; background: transparent; text-align: left; cursor: pointer; color: var(--ink);
}
.source-opt:hover { background: var(--bg-alt); }
.source-opt[aria-checked="true"]::before {
  content: "✓"; position: absolute; left: 12px; top: 10px; color: var(--azul); font-weight: 700;
}
.source-opt-name { font: 600 var(--text-sm)/1.3 var(--f-body); }
.source-opt-sub { font-size: 12px; color: var(--ink-muted); }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .source-btn { color: #C9D3F0; }
  :root:not([data-theme="light"]) .source-opt[aria-checked="true"]::before { color: #C9D3F0; }
}
:root[data-theme="dark"] .source-btn { color: #C9D3F0; }
:root[data-theme="dark"] .source-opt[aria-checked="true"]::before { color: #C9D3F0; }

/* Cartão de treinamento (Amolando o Machado) e links oficiais */
.answer-training { border-left: 4px solid var(--amarelo); }
.training-label { color: var(--warn); }
.date-badge {
  display: inline-flex; align-items: center; padding: 3px 10px; border-radius: 999px;
  background: var(--amarelo-light); color: var(--warn); font: 700 12px/1.3 var(--f-body); white-space: nowrap;
}
.date-badge.old { background: var(--warn-soft); color: var(--warn); outline: 1px dashed var(--warn); }
.answer-training .answer-literal-text, .training-more .answer-literal-text { white-space: pre-line; }
.training-note { margin: var(--space-3) 0 0; font-size: 12px; color: var(--ink-muted); }
.training-videos { display: flex; flex-wrap: wrap; gap: 8px; margin-top: var(--space-3); }
.training-videos a { text-decoration: none; }
.training-more {
  border: 1px solid var(--line); border-radius: 14px; background: var(--surface); padding: 10px 14px;
}
.training-more summary {
  display: flex; justify-content: space-between; align-items: center; gap: 10px;
  cursor: pointer; font: 600 var(--text-sm)/1.35 var(--f-body); color: var(--ink);
}
.training-more .answer-literal-text { margin: 10px 0 0; font-size: var(--text-sm); }
a.link-item { text-decoration: none; }
.link-org { font: 500 12px/1.2 var(--f-mono); color: var(--ink-muted); white-space: nowrap; }

/* ===== Refinamento 10/11 noite: fontes, painel de temas, biblioteca e treino ===== */
.dot-base { background: var(--ok) !important; }
.dot-amolando { background: var(--amarelo) !important; }
.dot-lei { background: var(--azul) !important; }
.source-menu-title { margin: 4px 12px 6px; font: 600 11px/1.3 var(--f-mono); letter-spacing: .06em; text-transform: uppercase; color: var(--ink-muted); }
.source-opt-name { display: inline-flex; align-items: center; gap: 8px; }
.source-opt-name .source-dot { flex: 0 0 8px; }
.sidebar-explore { justify-content: flex-start; }
.sidebar-explore .kbd-hint { margin-left: auto; }
kbd, .kbd-hint {
  display: inline-block; min-width: 18px; padding: 0 5px; border: 1px solid var(--line); border-bottom-width: 2px;
  border-radius: 5px; font: 600 11px/16px var(--f-mono); color: var(--ink-muted); text-align: center; background: var(--surface);
}
.sidebar-link {
  display: flex; align-items: center; gap: var(--space-2); width: 100%; margin-top: 6px;
  padding: 9px 14px; border-radius: var(--radius-md); color: var(--ink-secondary); text-decoration: none;
  font: 600 var(--text-sm)/1.2 var(--f-body);
}
.sidebar-link:hover { background: var(--surface); color: var(--azul); }

.temas-picker { position: relative; }
.temas-btn { gap: 6px; cursor: pointer; padding: 6px 12px; font-size: var(--text-sm); font-weight: 600; color: var(--ink-secondary); }
.temas-btn:hover, .temas-btn[aria-expanded="true"] { border-color: var(--azul); color: var(--azul); }
.temas-panel {
  position: absolute; bottom: calc(100% + 8px); left: 0; z-index: 61;
  width: min(560px, calc(100vw - 32px)); max-height: min(62vh, 520px);
  display: flex; flex-direction: column; gap: 10px; padding: 14px;
  border: 1px solid var(--line); border-radius: 16px; background: var(--surface);
  box-shadow: var(--shadow-lg, 0 18px 48px rgba(10, 20, 50, .18));
}
.temas-panel[hidden] { display: none; }
.temas-panel-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.temas-panel-title { margin: 0; font: 700 var(--text-sm)/1.3 var(--f-body); color: var(--ink); }
.temas-close { width: 30px; height: 30px; font-size: 20px; line-height: 1; border: 0; background: transparent; color: var(--ink-muted); cursor: pointer; border-radius: 8px; }
.temas-close:hover { background: var(--bg-alt); }
.temas-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.temas-chips .topic-chip { padding: 6px 12px; font-size: 13px; }
.temas-list { overflow-y: auto; display: flex; flex-direction: column; gap: 4px; min-height: 0; }
.temas-item {
  display: flex; align-items: center; justify-content: space-between; gap: 10px; width: 100%;
  padding: 9px 12px; border: 0; border-radius: 10px; background: var(--bg-alt); color: var(--ink);
  font: 500 var(--text-sm)/1.35 var(--f-body); text-align: left; cursor: pointer; text-decoration: none;
}
.temas-item:hover, .temas-item:focus-visible { background: var(--azul-light); color: var(--azul); outline: none; }
.temas-link { color: var(--azul); font-weight: 600; background: transparent; }
@media (max-width: 600px) {
  .temas-panel { position: fixed; left: 16px; right: 16px; bottom: 150px; width: auto; max-height: 60vh; }
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .temas-item:hover { color: #C9D3F0; }
}
:root[data-theme="dark"] .temas-item:hover { color: #C9D3F0; }

.chat-scope {
  display: flex; flex-wrap: wrap; align-items: center; gap: 8px 18px; margin: 0 0 var(--space-4);
  padding: 12px 16px; border-radius: var(--radius-md); background: var(--bg-alt); font-size: var(--text-sm); color: var(--ink-secondary);
}
.chat-scope-in b { color: var(--ok); }
.chat-scope-out b { color: var(--warn); }
.chat-scope-link { margin-left: auto; color: var(--azul); font-weight: 600; text-decoration: none; }

/* Biblioteca: O que o Jarbas sabe */
.lib-stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; margin: 0 0 var(--space-5); }
.lib-stat {
  display: grid; grid-template-columns: auto 1fr; grid-template-rows: auto auto; column-gap: 10px; align-items: center;
  padding: 16px; border: 1px solid var(--line); border-radius: 16px; background: var(--surface); color: var(--ink); text-decoration: none;
}
.lib-stat:hover { border-color: var(--azul); }
.lib-stat .lib-dot { grid-row: 1; }
.lib-num { font: 700 2rem/1 var(--f-display); }
.lib-label { grid-column: 1 / -1; margin-top: 6px; font-size: var(--text-sm); color: var(--ink-secondary); line-height: 1.35; }
.lib-label small { color: var(--ink-muted); font-size: 12px; }
.lib-dot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; }
.lib-adm { margin: 0 0 var(--space-5); padding: 12px 16px; border-radius: var(--radius-md); background: var(--amarelo-light); font-size: var(--text-sm); }
.lib-adm a { color: var(--azul); font-weight: 600; }
.lib-section { margin: 0 0 var(--space-6); }
.lib-section h2 { display: flex; align-items: center; gap: 10px; margin: 0 0 4px; font: 700 var(--text-xl)/1.3 var(--f-display); }
.lib-sub { margin: 0 0 var(--space-3); color: var(--ink-muted); font-size: var(--text-sm); }
.lib-group { border: 1px solid var(--line); border-radius: 12px; background: var(--surface); margin-bottom: 8px; padding: 10px 14px; }
.lib-group summary { cursor: pointer; font-weight: 700; display: flex; justify-content: space-between; gap: 8px; }
.lib-count { font: 500 12px/1.6 var(--f-mono); color: var(--ink-muted); }
.lib-list { list-style: none; margin: 8px 0 0; padding: 0; display: grid; gap: 6px; }
.lib-list li { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding: 6px 0; border-bottom: 1px solid var(--line-light); font-size: var(--text-sm); }
.lib-list li:last-child { border-bottom: 0; }
.lib-list a { color: var(--azul); text-decoration: none; }
.lib-list a:hover { text-decoration: underline; }
.lib-t-title { font-weight: 600; color: var(--ink); }
.lib-video { font-size: 12px; color: var(--ink-muted); }
.lib-empty { color: var(--ink-muted); font-size: var(--text-sm); }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .lib-list a, :root:not([data-theme="light"]) .lib-adm a,
  :root:not([data-theme="light"]) .chat-scope-link { color: #C9D3F0; }
}
:root[data-theme="dark"] .lib-list a, :root[data-theme="dark"] .lib-adm a, :root[data-theme="dark"] .chat-scope-link { color: #C9D3F0; }

/* Treino */
.quiz-container { max-width: 760px; }
.quiz-head { display: flex; align-items: center; gap: 14px; margin-bottom: var(--space-4); }
.quiz-head .page-subtitle { margin: 0; }
.quiz-label { margin: 0 0 8px; font: 600 11px/1.3 var(--f-mono); letter-spacing: .06em; text-transform: uppercase; color: var(--ink-muted); }
.quiz-setup .topic-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.quiz-start { margin-top: var(--space-4); padding: 10px 22px; }
.quiz-best { margin-top: var(--space-3); font-size: var(--text-sm); color: var(--ink-muted); }
.quiz-progress { height: 6px; border-radius: 999px; background: var(--bg-alt); overflow: hidden; }
.quiz-progress span { display: block; height: 100%; width: 0; background: var(--azul); transition: width .3s ease; }
.quiz-meta { margin: 14px 0 6px; font: 500 12px/1.4 var(--f-mono); color: var(--ink-muted); }
.quiz-tag { margin-left: 6px; padding: 2px 8px; border-radius: 999px; background: var(--amarelo-light); color: var(--warn); font-weight: 700; }
.quiz-question { margin: 0 0 var(--space-4); font: 700 var(--text-xl)/1.35 var(--f-display); }
.quiz-options { display: grid; gap: 10px; }
.quiz-opt {
  display: flex; align-items: flex-start; gap: 12px; width: 100%; padding: 14px 16px;
  border: 1px solid var(--line); border-radius: 14px; background: var(--surface); color: var(--ink);
  font: 400 var(--text-base)/1.45 var(--f-body); text-align: left; cursor: pointer;
}
.quiz-opt:hover:not(:disabled) { border-color: var(--azul); }
.quiz-opt:disabled { cursor: default; }
.quiz-letter { flex: 0 0 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; background: var(--bg-alt); font: 700 13px/1 var(--f-display); }
.quiz-opt.is-right { border-color: var(--ok); background: var(--ok-soft); }
.quiz-opt.is-right .quiz-letter { background: var(--ok); color: #fff; }
.quiz-opt.is-wrong { border-color: var(--danger); background: var(--danger-soft); }
.quiz-opt.is-wrong .quiz-letter { background: var(--danger); color: #fff; }
.quiz-feedback { margin: var(--space-4) 0; padding: 14px 16px; border-left: 4px solid var(--ok); border-radius: 10px; background: var(--bg-alt); }
.quiz-fb-title { margin: 0 0 6px; font-weight: 700; }
.quiz-fb-title.ok { color: var(--ok); }
.quiz-fb-title.erro { color: var(--warn); }
.quiz-fb-text { margin: 0; white-space: pre-line; line-height: 1.5; }
.quiz-fb-source { margin: 8px 0 0; font: 400 12px/1.4 var(--f-mono); color: var(--ink-muted); }
.quiz-end { text-align: center; padding: var(--space-6) 0; }
.quiz-score { font: 700 1.8rem/1.2 var(--f-display); margin: 0 0 8px; }
.quiz-sub { color: var(--ink-secondary); margin: 0 0 var(--space-4); }
.quiz-end-actions { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; }
.quiz-empty { color: var(--ink-muted); }

.sidebar-nav { display: flex; flex-direction: column; gap: 2px; margin-top: calc(var(--space-3) * -1); }
.sidebar-nav .sidebar-explore { margin-top: 0; margin-bottom: 4px; }
.sidebar-nav .sidebar-link { margin-top: 0; padding: 7px 14px; }
@media (max-width: 600px) {
  .lib-stats { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
  .lib-stat { padding: 12px 10px; }
  .lib-num { font-size: 1.5rem; }
  .lib-label { font-size: 12px; }
}

/* ===== Versão final 1.0: 2 fontes, explicação de IA, Treino e Biblioteca didáticos ===== */
.source-rec { margin-left: 6px; padding: 1px 7px; border-radius: 99px; background: var(--azul-light); color: var(--azul); font: 600 10.5px/1.6 var(--f-mono); letter-spacing: .04em; text-transform: uppercase; }
.source-how { display: block; margin: 6px 4px 2px; padding: 8px 10px; border-top: 1px solid var(--line, #E6E9F2); color: var(--azul); font: 600 var(--text-sm)/1.3 var(--f-body); text-decoration: none; }
.source-how:hover, .source-how:focus-visible { text-decoration: underline; }
.temas-sep { margin: 14px 4px 6px; font: 600 11px/1.3 var(--f-mono); letter-spacing: .06em; text-transform: uppercase; color: var(--ink-muted); }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }

/* O que o Jarbas sabe */
.lib-sector { display: inline-flex; align-items: center; gap: 8px; margin: 0 0 var(--space-4); font-weight: 600; font-size: var(--text-sm); }
.lib-sector .dept-icon { width: 24px; height: 24px; font-size: 11px; }
.lib-sector-note { font-weight: 400; color: var(--ink-muted); }
.lib-plus { font-size: 1.1rem; color: var(--ink-muted); font-weight: 600; }
.lib-stat-how { align-content: center; }
.lib-how-icon { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 50%; background: var(--azul); color: #fff; font: 700 18px/1 var(--f-display); }
.lib-how { padding: var(--space-4); border: 1px solid var(--line); border-radius: 16px; background: var(--surface); scroll-margin-top: 16px; }
.lib-steps { list-style: none; margin: var(--space-3) 0; padding: 0; display: grid; gap: 10px; }
.lib-steps li { display: flex; gap: 12px; align-items: flex-start; line-height: 1.5; }
.lib-step-n { flex: 0 0 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; background: var(--azul-light); color: var(--azul); font: 700 14px/1 var(--f-display); }
.lib-table-wrap { overflow-x: auto; margin: var(--space-3) 0; border: 1px solid var(--line); border-radius: 12px; }
.lib-compare { width: 100%; border-collapse: collapse; font-size: var(--text-sm); min-width: 520px; }
.lib-compare caption { text-align: left; padding: 10px 14px; font-weight: 700; background: var(--bg-alt); }
.lib-compare th, .lib-compare td { text-align: left; padding: 9px 14px; border-top: 1px solid var(--line-light); vertical-align: top; }
.lib-compare thead th { font: 600 11px/1.3 var(--f-mono); text-transform: uppercase; letter-spacing: .05em; color: var(--ink-muted); }
.lib-compare tbody th { font-weight: 600; color: var(--ink); width: 26%; }
.lib-compare td:nth-child(2) { color: var(--ink); font-weight: 600; }
.lib-compare td:nth-child(3) { color: var(--ink-secondary); }
.lib-tip { margin: 0; padding: 10px 14px; border-radius: 10px; background: var(--amarelo-light); font-size: var(--text-sm); line-height: 1.5; }
.lib-search { position: sticky; top: 0; z-index: 2; padding: 10px 0; background: var(--bg); }
.lib-search-input { width: 100%; padding: 11px 14px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); color: var(--ink); font: inherit; }
.lib-search-input:focus { outline: 2px solid var(--azul); outline-offset: 1px; }
.lib-search-info { margin: 6px 2px 0; font-size: 12px; color: var(--ink-muted); min-height: 1em; }
.lib-h3 { display: flex; align-items: baseline; gap: 10px; margin: var(--space-4) 0 2px; font: 700 var(--text-lg, 1.1rem)/1.3 var(--f-display); }
.lib-group summary span:first-child { flex: 1; }
.lib-progress { display: inline-flex; align-items: center; gap: 8px; font-weight: 400; }
.lib-progress-bar { width: 64px; height: 6px; border-radius: 99px; background: var(--bg-alt); overflow: hidden; }
.lib-progress-bar i { display: block; height: 100%; width: 0; background: var(--ok); transition: width .3s; }
.lib-progress.is-done .lib-progress-txt { color: var(--ok); font-weight: 700; }
.lib-list li.is-seen a::before { content: "✓ "; color: var(--ok); font-weight: 700; }
.lib-next { padding: var(--space-3) var(--space-4); border: 1px dashed var(--line); border-radius: 12px; }
.lib-next h2 { font-size: var(--text-lg, 1.1rem); }
@media (max-width: 600px) {
  .lib-stats.lib-stats-2 { grid-template-columns: 1fr; }
  .lib-stat-how { display: flex; align-items: center; gap: 10px; }
  .lib-progress-bar { display: none; }
  .lib-how { padding: var(--space-3); }
}

/* Treino, no estilo de app de idiomas: progresso, sequência, retorno imediato */
.quiz-stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; margin: 0 0 var(--space-4); }
.quiz-stat { display: grid; justify-items: center; gap: 2px; padding: 14px 8px; border: 1px solid var(--line); border-radius: 14px; background: var(--surface); text-align: center; }
.quiz-stat-icon { font-size: 22px; line-height: 1; }
.quiz-stat-num { font: 700 1.6rem/1.1 var(--f-display); color: var(--ink); }
.quiz-stat-lbl { font-size: 12px; color: var(--ink-muted); }
.quiz-start { width: 100%; max-width: 320px; padding: 14px 22px; font-size: 1rem; border-radius: 14px; }
.quiz-progress { height: 12px; }
.quiz-progress span { background: var(--ok); border-radius: 999px; }
.quiz-combo { margin-left: 6px; padding: 2px 8px; border-radius: 999px; background: var(--ok-soft); color: var(--ok); font-weight: 700; }
.quiz-opt { border-width: 2px; border-radius: 14px; transition: transform .08s ease, border-color .15s; }
.quiz-opt:active:not(:disabled) { transform: translateY(1px); }
.quiz-feedback { border-left: 0; border-radius: 14px; padding: 16px 18px; }
.quiz-feedback.is-ok { background: var(--ok-soft); }
.quiz-feedback.is-erro { background: var(--danger-soft); }
.quiz-feedback.is-erro .quiz-fb-title { color: var(--danger); }
.quiz-fb-title { font-size: 1.05rem; }
.quiz-next { width: 100%; padding: 14px 22px; font-size: 1rem; border-radius: 14px; }
.quiz-keys { margin: 10px 0 0; text-align: center; font-size: 12px; color: var(--ink-muted); }
.quiz-medal { font-size: 56px; line-height: 1; margin-bottom: 8px; }
.quiz-gains { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; margin: 0 0 var(--space-4); }
.quiz-gain { padding: 6px 14px; border-radius: 999px; background: var(--amarelo-light); font-weight: 700; font-size: var(--text-sm); }
.quiz-review { max-width: 560px; margin: 0 auto var(--space-4); text-align: left; display: grid; gap: 6px; }
.quiz-review-title { margin: 0 0 4px; font-weight: 700; }
.quiz-review-item { display: block; padding: 10px 14px; border: 1px solid var(--line); border-radius: 12px; color: var(--azul); text-decoration: none; background: var(--surface); }
.quiz-review-item:hover { border-color: var(--azul); }
@media (hover: none), (max-width: 600px) { .quiz-keys { display: none; } }
@media (prefers-reduced-motion: reduce) { .quiz-opt, .lib-progress-bar i { transition: none; } }

/* ==========================================================
   10/11 · Convenções coletivas + tela mais visual + modo escuro
   ========================================================== */
:root { --conv: #6A3FD0; --conv-soft: #F0EBFC; }

/* Tela inicial maior, estilo landing */
.welcome-greeting { font-size: clamp(30px, 4.2vw, 46px); letter-spacing: -0.02em; line-height: 1.12; }
.welcome-sub { font-size: clamp(17px, 1.6vw, 20px); }
.welcome-persona { width: 104px; height: 104px; }
.suggestion-card { font-size: 17px; padding: 20px 22px; font-weight: 600; }
.suggestion-topic { font-size: 12.5px; font-weight: 700; }
.composer-textarea { font-size: 17px; }
.answer-literal-text { font-size: 17px; line-height: 1.65; }
.answer-article-title { font-size: 18px; }
.welcome-cta {
  display: flex; align-items: center; gap: 16px; width: min(560px, 100%); margin: 18px auto 0;
  padding: 16px 20px; border-radius: 18px; text-decoration: none; text-align: left;
  background: linear-gradient(120deg, var(--conv) 0%, #3D5BFF 100%); color: #fff;
  box-shadow: 0 10px 28px rgba(106, 63, 208, .28); transition: transform .15s ease, box-shadow .15s ease;
}
.welcome-cta:hover { transform: translateY(-2px); box-shadow: 0 14px 34px rgba(106, 63, 208, .36); }
.welcome-cta-icon { font-size: 34px; line-height: 1; }
.welcome-cta-text { display: flex; flex-direction: column; gap: 2px; flex: 1; }
.welcome-cta-text strong { font: 700 20px/1.2 var(--f-display); }
.welcome-cta-text span { font-size: 15px; opacity: .92; }
.welcome-cta-go { font-weight: 700; font-size: 16px; white-space: nowrap; background: rgba(255,255,255,.18); padding: 8px 14px; border-radius: 999px; }
.sidebar-new-tag, .source-new {
  margin-left: auto; padding: 1px 8px; border-radius: 999px; background: var(--conv); color: #fff;
  font: 700 10.5px/1.7 var(--f-body); text-transform: uppercase; letter-spacing: .04em;
}
.source-new { margin-left: 6px; }
.dot-conv { background: var(--conv) !important; }
.source-picker[data-fonte="convencoes"] .source-dot { background: var(--conv); }
.temas-destaque { background: var(--conv-soft); color: var(--conv); font-weight: 700; }
.temas-destaque .date-badge { background: var(--conv); color: #fff; }

/* Cartão de resposta: convenção */
.answer-conv { border-left: 5px solid var(--conv); }
.conv-label { color: var(--conv); }
.conv-sind { margin: 4px 0 0; font: 700 26px/1.15 var(--f-display); color: var(--ink); }
.conv-cat { margin: 2px 0 10px; font-size: 14px; color: var(--ink-muted); }
.conv-open { display: inline-block; margin-top: 4px; font-weight: 700; color: var(--conv); text-decoration: none; }
.conv-open:hover { text-decoration: underline; }
.conv-vig.is-ok, .date-badge.conv-vig.is-ok { background: var(--ok-soft); color: var(--ok); }
.conv-chip-all { text-decoration: none; border-color: var(--conv); color: var(--conv); font-weight: 700; }

/* Página /convencoes */
.conv-container { max-width: 1120px; }
.conv-hero { text-align: center; padding: 28px 0 8px; }
.conv-kicker { margin: 0; font: 700 13px/1.4 var(--f-body); letter-spacing: .12em; text-transform: uppercase; color: var(--conv); }
.conv-title { margin: 8px 0 6px; font: 700 clamp(36px, 6vw, 60px)/1.04 var(--f-display); letter-spacing: -0.02em; color: var(--ink); }
.conv-lead { margin: 0 auto; max-width: 40ch; font-size: clamp(18px, 2vw, 22px); color: var(--ink-secondary); }
.conv-numbers { display: flex; justify-content: center; gap: 14px; margin: 26px 0; flex-wrap: wrap; }
.conv-number { display: flex; flex-direction: column; min-width: 150px; padding: 16px 22px; border-radius: 18px; background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow-sm); }
.conv-number-n { font: 700 40px/1 var(--f-display); color: var(--conv); }
.conv-number-l { margin-top: 6px; font-size: 14px; color: var(--ink-secondary); font-weight: 600; }
.conv-search { display: flex; align-items: center; gap: 12px; max-width: 680px; margin: 0 auto; padding: 6px 8px 6px 20px; border: 2px solid var(--line); border-radius: 999px; background: var(--surface); color: var(--ink-muted); box-shadow: var(--shadow-md); }
.conv-search:focus-within { border-color: var(--conv); }
.conv-search-input { flex: 1; min-width: 0; padding: 14px 6px; border: 0; background: transparent; color: var(--ink); font: 500 18px/1.2 var(--f-body); outline: none; }
.conv-quick { justify-content: center; margin: 16px 0 6px; }
.conv-quick .topic-chip { font-size: 15px; padding: 8px 16px; }
.conv-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; margin: 28px 0; }
.conv-card {
  display: flex; flex-direction: column; gap: 10px; padding: 22px; text-align: left; cursor: pointer;
  border: 2px solid var(--line); border-radius: 20px; background: var(--surface); color: var(--ink);
  box-shadow: var(--shadow-sm); transition: transform .15s ease, border-color .15s ease, box-shadow .15s ease; font: inherit;
}
.conv-card:hover, .conv-card.is-active { transform: translateY(-3px); border-color: var(--conv); box-shadow: var(--shadow-lg); }
.conv-card-top { display: flex; flex-direction: column; gap: 8px; }
.conv-card-name { font: 700 24px/1.15 var(--f-display); }
.conv-card-cat { font-size: 14.5px; color: var(--ink-secondary); min-height: 2.6em; }
.conv-card-stats { display: flex; gap: 8px; flex-wrap: wrap; }
.conv-stat { display: flex; flex-direction: column; padding: 8px 12px; border-radius: 12px; background: var(--bg-alt); }
.conv-stat b { font: 700 17px/1.2 var(--f-display); color: var(--ink); }
.conv-stat small { font-size: 12px; color: var(--ink-muted); }
.conv-card-go { margin-top: auto; font-weight: 700; color: var(--conv); }
.conv-vig { align-self: flex-start; padding: 3px 10px; border-radius: 999px; font: 700 12.5px/1.5 var(--f-body); }
.conv-vig.is-ok { background: var(--ok-soft); color: var(--ok); }
.conv-vig.is-old { background: var(--danger-soft); color: var(--danger); }
.conv-detalhe, .conv-resultado { margin: 8px 0 28px; padding: 26px; border-radius: 22px; background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow-md); scroll-margin-top: 16px; }
.conv-det-head { display: flex; justify-content: space-between; gap: 16px; align-items: flex-start; flex-wrap: wrap; }
.conv-det-title { margin: 0; font: 700 34px/1.1 var(--f-display); color: var(--ink); }
.conv-det-cat { margin: 6px 0 0; color: var(--ink-secondary); font-size: 15px; }
.conv-temas { display: flex; flex-wrap: wrap; gap: 8px; margin: 20px 0 8px; }
.conv-tema { padding: 9px 14px; border-radius: 999px; border: 1.5px solid var(--line); background: var(--bg); color: var(--ink); font: 600 14.5px/1.2 var(--f-body); cursor: pointer; }
.conv-tema:hover { border-color: var(--conv); }
.conv-tema[aria-pressed="true"] { background: var(--conv); border-color: var(--conv); color: #fff; }
.conv-tema-h { margin: 22px 0 8px; font: 700 18px/1.3 var(--f-display); color: var(--ink); }
.conv-clausula { border: 1px solid var(--line); border-radius: 14px; margin: 8px 0; background: var(--bg); scroll-margin-top: 16px; }
.conv-clausula > summary { display: flex; gap: 12px; align-items: center; padding: 14px 16px; cursor: pointer; list-style: none; font-size: 16.5px; font-weight: 600; color: var(--ink); }
.conv-clausula > summary::-webkit-details-marker { display: none; }
.conv-clausula > summary::after { content: "+"; margin-left: auto; font-size: 22px; color: var(--conv); }
.conv-clausula[open] > summary::after { content: "–"; }
.conv-clausula[open] { border-color: var(--conv); }
.conv-cl-n { flex: 0 0 auto; min-width: 44px; padding: 3px 8px; border-radius: 8px; background: var(--conv-soft); color: var(--conv); font: 700 14px/1.4 var(--f-body); text-align: center; }
.conv-cl-texto { margin: 0 16px 10px; font-size: 16.5px; line-height: 1.65; color: var(--ink); }
.conv-cl-fonte { margin: 4px 16px 14px; font-size: 13px; color: var(--ink-muted); }
.conv-h2 { margin: 0 0 14px; font: 700 26px/1.2 var(--f-display); color: var(--ink); }
.conv-comp { padding: 14px 0; border-top: 1px solid var(--line); }
.conv-comp-head { display: flex; gap: 12px; align-items: center; justify-content: space-between; flex-wrap: wrap; }
.conv-comp-name { font: 700 20px/1.2 var(--f-display); color: var(--ink); }
.conv-comp-vazio, .conv-comp-mais { margin: 8px 0 0; color: var(--ink-muted); font-size: 15px; }
.conv-how { margin: 12px 0 40px; }
.conv-steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.conv-step { display: flex; gap: 14px; padding: 20px; border-radius: 18px; background: var(--surface); border: 1px solid var(--line); }
.conv-step p { margin: 0; color: var(--ink-secondary); font-size: 15.5px; line-height: 1.5; }
.conv-step b { display: block; color: var(--ink); font: 700 18px/1.3 var(--f-display); margin-bottom: 4px; }
.conv-step-n { flex: 0 0 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; background: var(--amarelo); color: #0B1640; font: 700 18px/1 var(--f-display); }
.conv-foot { margin: 16px 0 0; text-align: center; color: var(--ink-muted); font-size: 14.5px; }
@media (max-width: 900px) {
  .conv-grid { grid-template-columns: 1fr 1fr; }
  .conv-steps { grid-template-columns: 1fr; }
}
@media (max-width: 600px) {
  .conv-grid { grid-template-columns: 1fr; }
  .conv-detalhe, .conv-resultado { padding: 18px; }
  .conv-number { min-width: 0; flex: 1; padding: 12px; }
  .conv-number-n { font-size: 30px; }
  .welcome-cta { padding: 14px 16px; gap: 12px; }
  .welcome-cta-text strong { font-size: 17px; }
  .welcome-cta-go { display: none; }
}

/* Modo escuro: todo texto que usava o azul da marca vira azul-claro legível */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) { --conv: #B49BFF; --conv-soft: #2A2050; }
  :root:not([data-theme="light"]) .temas-btn:hover,
  :root:not([data-theme="light"]) .temas-btn[aria-expanded="true"],
  :root:not([data-theme="light"]) .temas-item:hover,
  :root:not([data-theme="light"]) .temas-item:focus,
  :root:not([data-theme="light"]) .temas-item:focus-visible,
  :root:not([data-theme="light"]) .temas-link,
  :root:not([data-theme="light"]) .sidebar-link:hover,
  :root:not([data-theme="light"]) .source-rec,
  :root:not([data-theme="light"]) .source-how,
  :root:not([data-theme="light"]) .lib-step-n,
  :root:not([data-theme="light"]) .quiz-review-item,
  :root:not([data-theme="light"]) .sidebar-item.active,
  :root:not([data-theme="light"]) .dept-check,
  :root:not([data-theme="light"]) .did-you-mean-arrow { color: #C9D3F0; }
  :root:not([data-theme="light"]) .temas-btn:hover,
  :root:not([data-theme="light"]) .temas-btn[aria-expanded="true"] { border-color: #C9D3F0; }
  :root:not([data-theme="light"]) .temas-item:focus { background: var(--azul-light); outline: none; }
  :root:not([data-theme="light"]) .conv-tema[aria-pressed="true"],
  :root:not([data-theme="light"]) .sidebar-new-tag,
  :root:not([data-theme="light"]) .source-new,
  :root:not([data-theme="light"]) .temas-destaque .date-badge { color: #140B33; }
}
:root[data-theme="dark"] { --conv: #B49BFF; --conv-soft: #2A2050; }
:root[data-theme="dark"] .temas-btn:hover,
:root[data-theme="dark"] .temas-btn[aria-expanded="true"],
:root[data-theme="dark"] .temas-item:hover,
:root[data-theme="dark"] .temas-item:focus,
:root[data-theme="dark"] .temas-item:focus-visible,
:root[data-theme="dark"] .temas-link,
:root[data-theme="dark"] .sidebar-link:hover,
:root[data-theme="dark"] .source-rec,
:root[data-theme="dark"] .source-how,
:root[data-theme="dark"] .lib-step-n,
:root[data-theme="dark"] .quiz-review-item,
:root[data-theme="dark"] .sidebar-item.active,
:root[data-theme="dark"] .dept-check,
:root[data-theme="dark"] .did-you-mean-arrow { color: #C9D3F0; }
:root[data-theme="dark"] .temas-btn:hover,
:root[data-theme="dark"] .temas-btn[aria-expanded="true"] { border-color: #C9D3F0; }
:root[data-theme="dark"] .temas-item:focus { background: var(--azul-light); outline: none; }
:root[data-theme="dark"] .conv-tema[aria-pressed="true"],
:root[data-theme="dark"] .sidebar-new-tag,
:root[data-theme="dark"] .source-new,
:root[data-theme="dark"] .temas-destaque .date-badge { color: #140B33; }
