/* SynapIA Studio â€” Premium Dark Mode (Glassmorphism & Neon)
 * Paleta deep dark blue, neon cyan/purple accents, glass effects.
 * ============================================================================ */

@import url('https://fonts.googleapis.com/css2?family=Source+Serif+4:opsz,wght@8..60,400;8..60,500;8..60,600;8..60,700&family=Geist:wght@400;500;600;700&family=Geist+Mono:wght@400;500&display=swap');

:root {
  /* Surfaces â€” Matching logo background #060a15 */
  --bg:           #060a15;
  --bg-elev:      #0a0f1c;
  --surface:      #111827;
  --surface-2:    #1f2937;
  --surface-3:    #374151;

  --border:       #1f2937;
  --border-2:     #374151;
  --border-strong:#4b5563;

  --glass-bg:     rgba(6, 10, 21, 0.75);
  --glass-border: rgba(14, 165, 233, 0.15); /* Cyan tint on borders */
  --glass-composer: rgba(10, 15, 28, 0.85);
  --glass-welcome: rgba(10, 15, 28, 0.5);
  --glass-text:   #ffffff;

  /* Text */
  --ink:          #fafafa;
  --ink-2:        #e4e4e7;
  --muted:        #a1a1aa;
  --soft:         #71717a;

  /* Accent â€” Vibrant neons */
  --accent:       #0ea5e9;
  --accent-soft:  rgba(14, 165, 233, 0.15);
  --focus-ring:   rgba(14, 165, 233, 0.3);

  /* Blue palette */
  --blue:         #0ea5e9;
  --blue-hover:   #0284c7;
  --blue-light:   rgba(14, 165, 233, 0.15);
  --blue-muted:   #38bdf8;

  /* Semantic */
  --success:      #10b981;
  --warn:         #f59e0b;
  --warn-soft:    rgba(245, 158, 11, 0.1);

  /* Mode badges */
  --agent-bg:     #8b5cf6; /* Brand Purple */
  --agent-fg:     #ffffff;
  --reason-bg:    rgba(14, 165, 233, 0.15); /* Brand Cyan */
  --reason-fg:    #0ea5e9;

  /* Shadows - Premium deep drops */
  --sh-xs: 0 1px 2px rgba(0,0,0,.3);
  --sh-sm: 0 1px 3px rgba(0,0,0,.4), 0 1px 2px rgba(0,0,0,.2);
  --sh-md: 0 4px 12px rgba(0,0,0,.4), 0 2px 4px rgba(0,0,0,.2);
  --sh-lg: 0 24px 60px rgba(0,0,0,.5), 0 6px 16px rgba(0,0,0,.3);
  --sh-xl: 0 40px 80px rgba(0,0,0,.6);

  /* Radii */
  --r-1: 8px;
  --r-2: 12px;
  --r-3: 18px;
  --r-4: 24px;
  --r-pill: 999px;

  /* Type */
  --font-ui:    'Geist', ui-sans-serif, -apple-system, BlinkMacSystemFont, system-ui, sans-serif;
  --font-serif: 'Source Serif 4', 'Charter', 'Iowan Old Style', Georgia, serif;
  --font-mono:  'Geist Mono', ui-monospace, 'SF Mono', Menlo, Consolas, monospace;
}

[data-theme="light"] {
  --bg:           #f3f4f6;
  --bg-elev:      #ffffff;
  --surface:      #e5e7eb;
  --surface-2:    #d1d5db;
  --surface-3:    #9ca3af;

  --border:       #e5e7eb;
  --border-2:     #d1d5db;
  --border-strong:#9ca3af;

  --ink:          #111827;
  --ink-2:        #1f2937;
  --muted:        #4b5563;
  --soft:         #6b7280;

  --accent:       #0ea5e9;
  --accent-soft:  rgba(14, 165, 233, 0.15);
  --focus-ring:   rgba(14, 165, 233, 0.3);

  --blue:         #0ea5e9;
  --blue-hover:   #0284c7;
  --blue-light:   rgba(14, 165, 233, 0.15);
  --blue-muted:   #38bdf8;

  --sh-xs: 0 1px 2px rgba(6,10,21,.04);
  --sh-sm: 0 1px 3px rgba(6,10,21,.06), 0 1px 2px rgba(6,10,21,.04);
  --sh-md: 0 4px 12px rgba(6,10,21,.06), 0 2px 4px rgba(6,10,21,.04);
  --sh-lg: 0 24px 60px rgba(6,10,21,.14), 0 6px 16px rgba(6,10,21,.06);
  --sh-xl: 0 40px 80px rgba(6,10,21,.18);
  
  --agent-bg:     #8b5cf6;
  --reason-bg:    rgba(14, 165, 233, 0.15);
  --reason-fg:    #0ea5e9;

  --glass-bg:     rgba(255, 255, 255, 0.85);
  --glass-border: rgba(6, 10, 21, 0.08);
  --glass-composer: rgba(255, 255, 255, 0.95);
  --glass-welcome: rgba(255, 255, 255, 0.6);
  --glass-text:   #111827;

  /* Custom overrides for Light Mode to blend logo */
  --brand-bg:     #060a15;
}

[data-theme="light"] img[src="/logo.png"] {
  content: url("/logo_light.png");
}

* { box-sizing: border-box; }
html, body, #root {
  margin: 0; padding: 0; height: 100%;
  font-family: var(--font-ui); font-size: 14.5px; color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
body { overflow: hidden; }
button { font-family: inherit; cursor: pointer; }

/* Scrollbar â€” dark neon */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb {
  background: rgba(255,255,255,.14);
  border-radius: var(--r-pill);
  border: 2px solid transparent; background-clip: padding-box;
}
::-webkit-scrollbar-thumb:hover { background: rgba(255,255,255,.24); border: 2px solid transparent; background-clip: padding-box; }

/* Ã¢â€â‚¬Ã¢â€â‚¬Ã¢â€â‚¬ Common Ã¢â€â‚¬Ã¢â€â‚¬Ã¢â€â‚¬ */
.eyebrow {
  font-family: var(--font-mono); font-size: 10px; font-weight: 500;
  letter-spacing: 1.4px; color: var(--soft);
  text-transform: uppercase;
}
.kbd {
  font-family: var(--font-mono); font-size: 10.5px;
  background: rgba(31,30,26,.06); color: var(--muted);
  padding: 1px 5px; border-radius: 4px;
  border: 1px solid rgba(31,30,26,.06);
}
.btn-primary {
  display: inline-flex; align-items: center; gap: 6px; justify-content: center;
  background: var(--ink); color: var(--bg);
  border: 0; padding: 9px 16px;
  border-radius: var(--r-2); font-size: 13px; font-weight: 500;
  transition: transform .12s, opacity .12s, box-shadow .12s;
  box-shadow: var(--sh-sm);
}
.btn-primary:hover { transform: translateY(-1px); box-shadow: var(--sh-md); }
.btn-primary:active { transform: translateY(0); opacity: .9; }
.btn-ghost {
  display: inline-flex; align-items: center; gap: 6px; justify-content: center;
  background: transparent; color: var(--muted);
  border: 1px solid var(--border-2);
  padding: 8px 14px; border-radius: var(--r-2);
  font-size: 13px; transition: background .14s, color .14s, border-color .14s;
}
.btn-ghost:hover { background: var(--surface); color: var(--ink); border-color: var(--border-strong); }

.generation-status {
  display: flex;
  align-items: center;
  gap: 14px;
  max-width: 560px;
  padding: 14px 16px;
  border: 1px solid var(--border);
  border-radius: var(--r-2);
  background: color-mix(in srgb, var(--surface) 78%, transparent);
  box-shadow: var(--sh-sm);
}
.gs-orbit {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  position: relative;
  flex: 0 0 34px;
  background: radial-gradient(circle at center, color-mix(in srgb, var(--accent) 16%, transparent), transparent 62%);
  border: 1px solid color-mix(in srgb, var(--accent) 28%, transparent);
}
.gs-orbit span {
  position: absolute;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--accent);
  top: 13px;
  left: 13px;
  transform-origin: 4px 4px;
  animation: gsOrbit 1.4s infinite ease-in-out;
}
.gs-orbit span:nth-child(2) { animation-delay: .16s; background: var(--agent-bg); }
.gs-orbit span:nth-child(3) { animation-delay: .32s; background: var(--success); }
.gs-copy { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.gs-copy strong { font-size: 13px; color: var(--ink); font-weight: 650; }
.gs-steps { display: flex; flex-wrap: wrap; gap: 6px; }
.gs-steps span {
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--muted);
  border: 1px solid var(--border-2);
  border-radius: var(--r-pill);
  padding: 2px 7px;
  opacity: .62;
  animation: gsPulse 1.8s infinite ease-in-out;
}
@keyframes gsOrbit {
  0% { transform: rotate(0deg) translateX(10px) scale(.82); opacity: .42; }
  50% { transform: rotate(180deg) translateX(10px) scale(1); opacity: 1; }
  100% { transform: rotate(360deg) translateX(10px) scale(.82); opacity: .42; }
}
@keyframes gsPulse { 0%, 100% { opacity: .48; } 45% { opacity: 1; } }

.icon-btn {
  width: 32px; height: 32px; border-radius: var(--r-2);
  background: transparent; border: 1px solid transparent;
  color: var(--muted);
  display: inline-flex; align-items: center; justify-content: center;
  transition: background .12s, color .12s, border-color .12s;
}
.icon-btn:hover { background: var(--surface); color: var(--ink); border-color: var(--border); }

/* Auth ------------------------------------------------------ */
/* ═══════════════════════════════════════════════════════════════
   AUTH — Tela de login/cadastro premium
   ═══════════════════════════════════════════════════════════════ */

/* Loader antes do auth carregar */
.auth-loading {
  min-height: 100vh;
  display: flex; align-items: center; justify-content: center; gap: 14px;
  background: var(--bg); color: var(--ink);
}
.auth-loading strong { font-size: 13px; color: var(--muted); }

/* Shell — landing + auth */
.auth-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: minmax(640px, 1.35fr) minmax(390px, .82fr);
  background: var(--bg);
  color: var(--ink);
  opacity: 0;
  transform: translateY(8px);
  transition: opacity .5s ease, transform .5s ease;
}
.auth-shell.auth-entered { opacity: 1; transform: translateY(0); }

/* ── Coluna esquerda: branding ─────────────────────────────────── */
.auth-brand-panel {
  position: relative;
  overflow: hidden;
  display: flex; align-items: stretch;
  min-height: 100vh;
  border-right: 1px solid rgba(14,165,233,.12);
  background:
    radial-gradient(ellipse 80% 60% at 10% 0%, rgba(14,165,233,.13) 0%, transparent 55%),
    radial-gradient(ellipse 60% 50% at 90% 100%, rgba(139,92,246,.12) 0%, transparent 50%),
    linear-gradient(175deg, #07101f 0%, #060a15 100%);
}

/* Canvas de partículas */
.auth-particles {
  position: absolute; inset: 0; width: 100%; height: 100%;
  pointer-events: none; z-index: 0;
}

/* Conteúdo sobre as partículas */
.auth-brand-inner {
  position: relative; z-index: 1;
  display: flex; flex-direction: column; justify-content: center;
  width: 100%;
  padding: 42px clamp(34px, 5vw, 72px);
  gap: 0;
}

.auth-hero-top {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 30px;
}
.auth-hero-top strong { display: block; font-size: 18px; color: var(--ink); letter-spacing: 0; }
.auth-hero-top span { display: block; margin-top: 2px; color: var(--muted); font-size: 12px; }
.auth-logo-img {
  width: 82px;
  border-radius: 16px;
  display: block;
  filter: drop-shadow(0 0 28px rgba(14,165,233,.4));
}

/* Badge "Copiloto Jurídico" */
.auth-badge {
  display: inline-flex; align-items: center; gap: 8px;
  font-family: var(--font-mono);
  font-size: 11px; font-weight: 600;
  text-transform: uppercase; letter-spacing: 1.4px;
  color: #34d399;
  border: 1px solid rgba(52,211,153,.28);
  background: rgba(52,211,153,.07);
  border-radius: var(--r-pill);
  padding: 7px 12px;
  width: fit-content;
  margin-bottom: 22px;
}
.auth-badge-dot {
  width: 7px; height: 7px; border-radius: 50%;
  background: #34d399;
  box-shadow: 0 0 8px #34d399;
  animation: pulse-dot 2s ease-in-out infinite;
}
@keyframes pulse-dot {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: .6; transform: scale(.8); }
}

/* Headline principal */
.auth-headline {
  margin: 0;
  font-family: var(--font-serif);
  font-size: clamp(34px, 3.8vw, 58px);
  line-height: 1.06;
  letter-spacing: -.02em;
  font-weight: 700;
  color: var(--ink);
  margin-bottom: 32px;
}
.auth-headline-accent {
  background: linear-gradient(95deg, #0ea5e9 0%, #8b5cf6 60%, #34d399 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.auth-hero-copy {
  max-width: 760px;
  margin: -12px 0 24px;
  color: #c6d1e5;
  font-size: clamp(14px, 1.15vw, 17px);
  line-height: 1.7;
}

.auth-hero-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin-bottom: 28px;
}
.auth-hero-primary,
.auth-hero-secondary {
  min-height: 42px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  padding: 10px 14px;
  font-size: 13px;
  font-weight: 750;
  text-decoration: none;
}
.auth-hero-primary {
  border: 0;
  color: #04111f;
  background: linear-gradient(135deg, #7de3ff 0%, #34d399 100%);
  box-shadow: 0 18px 45px rgba(14,165,233,.24);
}
.auth-hero-secondary {
  color: var(--ink);
  border: 1px solid rgba(255,255,255,.14);
  background: rgba(255,255,255,.045);
}

/* Lista de features */
.auth-features {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 14px;
}
.auth-feature-item {
  display: flex; align-items: flex-start; gap: 12px;
  padding: 12px 14px;
  border: 1px solid rgba(14,165,233,.1);
  background: rgba(255,255,255,.025);
  border-radius: 12px;
  backdrop-filter: blur(6px);
  transition: background .2s, border-color .2s;
}
.auth-feature-item:hover {
  background: rgba(14,165,233,.06);
  border-color: rgba(14,165,233,.22);
}
.auth-feature-icon {
  font-size: 20px; line-height: 1;
  flex-shrink: 0; margin-top: 1px;
}
.auth-feature-item strong {
  display: block; font-size: 13px; font-weight: 650;
  color: var(--ink); margin-bottom: 2px;
}
.auth-feature-item span {
  display: block; font-size: 12px; color: var(--muted);
}

.auth-module-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin: 0 0 14px;
}
.auth-module-card {
  min-height: 104px;
  border: 1px solid rgba(255,255,255,.08);
  background: linear-gradient(180deg, rgba(255,255,255,.048), rgba(255,255,255,.018));
  border-radius: 8px;
  padding: 14px;
}
.auth-module-card strong { display: block; color: var(--ink); font-size: 13px; margin-bottom: 8px; }
.auth-module-card span { display: block; color: var(--muted); font-size: 12px; line-height: 1.55; }

.auth-plan-strip {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin: 0 0 24px;
}
.auth-plan-mini {
  text-align: left;
  border: 1px solid rgba(255,255,255,.1);
  background: rgba(255,255,255,.035);
  color: var(--ink);
  border-radius: 8px;
  padding: 14px;
  min-height: 132px;
  transition: transform .14s, border-color .14s, background .14s;
}
.auth-plan-mini:hover { transform: translateY(-1px); border-color: rgba(125,227,255,.45); background: rgba(14,165,233,.075); }
.auth-plan-mini.featured { border-color: rgba(52,211,153,.5); background: linear-gradient(180deg, rgba(52,211,153,.12), rgba(14,165,233,.035)); }
.auth-plan-mini span { display: block; color: var(--muted); font-size: 11px; text-transform: uppercase; letter-spacing: .08em; }
.auth-plan-mini strong { display: block; margin: 8px 0 6px; font-size: 24px; color: #fff; }
.auth-plan-mini small { display: block; color: var(--muted); font-size: 11.5px; line-height: 1.45; }

/* Depoimento rotativo */
.auth-quote {
  position: relative;
  border-left: 3px solid rgba(139,92,246,.5);
  padding: 0 0 0 18px;
  min-height: 62px;
}
.auth-quote-inner {
  animation: fade-up .5s ease both;
}
@keyframes fade-up {
  from { opacity: 0; transform: translateY(6px); }
  to   { opacity: 1; transform: translateY(0); }
}
.auth-quote p {
  margin: 0 0 6px;
  font-size: 14px; line-height: 1.55;
  color: var(--ink-2); font-style: italic;
}
.auth-quote cite {
  font-size: 11px; color: var(--soft);
  font-style: normal; font-family: var(--font-mono);
  text-transform: uppercase; letter-spacing: .8px;
}

/* ── Coluna direita: formulário ────────────────────────────────── */
.auth-form-panel {
  display: flex; align-items: center; justify-content: center;
  padding: 40px 32px;
  background:
    radial-gradient(ellipse 70% 50% at 80% 20%, rgba(14,165,233,.05) 0%, transparent 60%),
    var(--bg);
}

.auth-card {
  width: min(440px, 100%);
  border: 1px solid rgba(14,165,233,.14);
  background: rgba(10,15,28,.9);
  box-shadow: 0 32px 80px rgba(0,0,0,.55), 0 0 0 1px rgba(14,165,233,.06);
  border-radius: 20px;
  padding: 36px 32px;
  backdrop-filter: blur(28px);
}

/* Cabeçalho do card */
.auth-eyebrow {
  display: inline-block;
  font-size: 15px; margin-bottom: 8px;
}
.auth-card-head h2 {
  margin: 0 0 8px;
  font-family: var(--font-serif);
  font-size: clamp(24px, 3vw, 30px);
  letter-spacing: -.02em; font-weight: 700;
}
.auth-card-sub {
  margin: 0 0 22px; color: var(--muted); font-size: 14px; line-height: 1.5;
}

/* Botão Google */
.auth-google {
  width: 100%; height: 46px;
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  color: var(--ink);
  background: rgba(255,255,255,.05);
  border: 1px solid rgba(255,255,255,.12);
  border-radius: 12px;
  font-size: 14px; font-weight: 600;
  cursor: pointer;
  transition: background .2s, border-color .2s, transform .15s;
}
.auth-google:hover:not(:disabled) {
  background: rgba(255,255,255,.09);
  border-color: rgba(255,255,255,.2);
  transform: translateY(-1px);
}
.auth-google:active:not(:disabled) { transform: translateY(0); }
.auth-google:disabled { opacity: .38; cursor: not-allowed; }

/* Divisor */
.auth-divider {
  display: flex; align-items: center; gap: 12px;
  margin: 20px 0; color: var(--soft);
  font-size: 11px; text-transform: uppercase; letter-spacing: .9px;
}
.auth-divider:before, .auth-divider:after {
  content: ''; height: 1px; flex: 1;
  background: rgba(255,255,255,.08);
}

/* Formulário */
.auth-form { display: flex; flex-direction: column; gap: 14px; }
.auth-field-wrap { display: flex; flex-direction: column; gap: 7px; }
.auth-field-label {
  font-size: 12px; font-weight: 650; color: var(--muted);
  letter-spacing: .2px;
}
.auth-input {
  width: 100%;
  padding: 12px 14px;
  border: 1px solid rgba(255,255,255,.1);
  border-radius: 10px;
  background: rgba(255,255,255,.04);
  color: var(--ink);
  font: inherit; font-size: 14px;
  outline: 0;
  transition: border-color .2s, box-shadow .2s, background .2s;
  box-sizing: border-box;
}
.auth-input:hover { border-color: rgba(14,165,233,.3); background: rgba(255,255,255,.06); }
.auth-input:focus {
  border-color: rgba(14,165,233,.6);
  box-shadow: 0 0 0 3px rgba(14,165,233,.12);
  background: rgba(14,165,233,.04);
}
.auth-input::placeholder { color: var(--soft); }

/* Campo senha com olho */
.auth-pass-wrap { position: relative; }
.auth-pass-wrap .auth-input { padding-right: 44px; }
.auth-pass-eye {
  position: absolute; right: 12px; top: 50%; transform: translateY(-50%);
  background: none; border: 0; cursor: pointer; font-size: 14px; line-height: 1;
  color: var(--soft); padding: 4px;
}
.auth-forgot {
  background: none; border: 0; padding: 0;
  font-size: 11px; color: var(--blue-muted); cursor: pointer;
  text-decoration: underline; text-underline-offset: 2px;
}

/* Mensagem de erro */
.auth-error {
  display: flex; align-items: center; gap: 8px;
  color: #fecaca;
  border: 1px solid rgba(239,68,68,.24);
  background: rgba(239,68,68,.08);
  border-radius: 10px;
  padding: 10px 12px;
  font-size: 13px; line-height: 1.4;
}

/* Botão principal */
.auth-submit {
  width: 100%; height: 48px;
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  font-size: 15px; font-weight: 650;
  border: 0; border-radius: 12px; cursor: pointer;
  background: linear-gradient(135deg, #0ea5e9 0%, #6366f1 100%);
  color: #fff;
  box-shadow: 0 4px 20px rgba(14,165,233,.35);
  transition: opacity .2s, transform .15s, box-shadow .2s;
  position: relative; overflow: hidden;
}
.auth-submit::after {
  content: '';
  position: absolute; inset: 0;
  background: linear-gradient(135deg, rgba(255,255,255,.15), transparent);
  opacity: 0; transition: opacity .2s;
}
.auth-submit:hover:not(:disabled)::after { opacity: 1; }
.auth-submit:hover:not(:disabled) {
  transform: translateY(-1px);
  box-shadow: 0 6px 28px rgba(14,165,233,.45);
}
.auth-submit:active:not(:disabled) { transform: translateY(0); }
.auth-submit:disabled { opacity: .5; cursor: not-allowed; }

/* Spinner no botão */
.auth-spin {
  width: 18px; height: 18px;
  border: 2px solid rgba(255,255,255,.3);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin .7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* Link de trocar modo */
.auth-switch-row {
  text-align: center; margin: 18px 0 0;
  font-size: 13px; color: var(--muted);
}
.auth-switch {
  background: none; border: 0; padding: 0;
  color: var(--blue-muted); font-weight: 650; font-size: 13px;
  cursor: pointer; text-decoration: underline; text-underline-offset: 2px;
}

/* Texto legal */
.auth-legal {
  text-align: center; margin: 14px 0 0;
  font-size: 11px; color: var(--soft); line-height: 1.5;
}
.auth-legal a { color: var(--soft); text-underline-offset: 2px; }
.auth-legal a:hover { color: var(--muted); }

/* Elemento user mini na sidebar */
.sb-user-mini {
  display: flex; align-items: center; gap: 8px;
  color: var(--muted); font-size: 12px; min-width: 0; padding: 8px 2px;
}
.sb-user-mini span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ── Responsivo ─────────────────────────────────────────────────── */
@media (max-width: 1100px) {
  .auth-shell { grid-template-columns: 1fr; }
  .auth-brand-panel { min-height: auto; border-right: 0; border-bottom: 1px solid rgba(14,165,233,.12); }
  .auth-brand-inner { padding: 28px 18px; }
  .auth-headline { font-size: clamp(31px, 8vw, 44px); }
  .auth-features, .auth-plan-strip { grid-template-columns: 1fr; }
  .auth-module-grid { grid-template-columns: 1fr; }
  .auth-form-panel { padding: 24px 16px 42px; min-height: auto; }
}
@media (max-width: 480px) {
  .auth-card { padding: 24px 18px; border-radius: 14px; }
}
/* Ã¢â€¢ÂÃ¢â€¢ÂÃ¢â€¢ÂÃ¢â€¢ÂÃ¢â€¢ÂÃ¢â€¢ÂÃ¢â€¢ÂÃ¢â€¢ÂÃ¢â€¢ÂÃ¢â€¢ÂÃ¢â€¢ÂÃ¢â€¢ÂÃ¢â€¢ÂÃ¢â€¢ÂÃ¢â€¢ÂÃ¢â€¢ÂÃ¢â€¢ÂÃ¢â€¢ÂÃ¢â€¢ÂÃ¢â€¢ÂÃ¢â€¢ÂÃ¢â€¢ÂÃ¢â€¢ÂÃ¢â€¢ÂÃ¢â€¢ÂÃ¢â€¢ÂÃ¢â€¢ÂÃ¢â€¢ÂÃ¢â€¢ÂÃ¢â€¢ÂÃ¢â€¢ÂÃ¢â€¢ÂÃ¢â€¢ÂÃ¢â€¢ÂÃ¢â€¢ÂÃ¢â€¢ÂÃ¢â€¢ÂÃ¢â€¢ÂÃ¢â€¢Â
   APP SHELL Ã¢â‚¬â€ sidebar grid layout
Ã¢â€¢ÂÃ¢â€¢ÂÃ¢â€¢ÂÃ¢â€¢ÂÃ¢â€¢ÂÃ¢â€¢ÂÃ¢â€¢ÂÃ¢â€¢ÂÃ¢â€¢ÂÃ¢â€¢ÂÃ¢â€¢ÂÃ¢â€¢ÂÃ¢â€¢ÂÃ¢â€¢ÂÃ¢â€¢ÂÃ¢â€¢ÂÃ¢â€¢ÂÃ¢â€¢ÂÃ¢â€¢ÂÃ¢â€¢ÂÃ¢â€¢ÂÃ¢â€¢ÂÃ¢â€¢ÂÃ¢â€¢ÂÃ¢â€¢ÂÃ¢â€¢ÂÃ¢â€¢ÂÃ¢â€¢ÂÃ¢â€¢ÂÃ¢â€¢ÂÃ¢â€¢ÂÃ¢â€¢ÂÃ¢â€¢ÂÃ¢â€¢ÂÃ¢â€¢ÂÃ¢â€¢ÂÃ¢â€¢ÂÃ¢â€¢ÂÃ¢â€¢ÂÃ¢â€¢Â */
.app {
  display: grid;
  grid-template-columns: 280px 1fr;
  height: 100vh;
  transition: grid-template-columns .26s cubic-bezier(.32,.72,0,1);
}
.app.sb-collapsed { grid-template-columns: 0 1fr; }

.main {
  display: grid;
  grid-template-rows: auto 1fr auto;
  min-width: 0;
  height: 100vh;
  background: var(--bg);
  position: relative;
}

/* Ã¢â€¢ÂÃ¢â€¢ÂÃ¢â€¢ÂÃ¢â€¢ÂÃ¢â€¢ÂÃ¢â€¢ÂÃ¢â€¢ÂÃ¢â€¢ÂÃ¢â€¢ÂÃ¢â€¢ÂÃ¢â€¢ÂÃ¢â€¢ÂÃ¢â€¢ÂÃ¢â€¢ÂÃ¢â€¢ÂÃ¢â€¢ÂÃ¢â€¢ÂÃ¢â€¢ÂÃ¢â€¢ÂÃ¢â€¢ÂÃ¢â€¢ÂÃ¢â€¢ÂÃ¢â€¢ÂÃ¢â€¢ÂÃ¢â€¢ÂÃ¢â€¢ÂÃ¢â€¢ÂÃ¢â€¢ÂÃ¢â€¢ÂÃ¢â€¢ÂÃ¢â€¢ÂÃ¢â€¢ÂÃ¢â€¢ÂÃ¢â€¢ÂÃ¢â€¢ÂÃ¢â€¢ÂÃ¢â€¢ÂÃ¢â€¢ÂÃ¢â€¢Â
   SIDEBAR
Ã¢â€¢ÂÃ¢â€¢ÂÃ¢â€¢ÂÃ¢â€¢ÂÃ¢â€¢ÂÃ¢â€¢ÂÃ¢â€¢ÂÃ¢â€¢ÂÃ¢â€¢ÂÃ¢â€¢ÂÃ¢â€¢ÂÃ¢â€¢ÂÃ¢â€¢ÂÃ¢â€¢ÂÃ¢â€¢ÂÃ¢â€¢ÂÃ¢â€¢ÂÃ¢â€¢ÂÃ¢â€¢ÂÃ¢â€¢ÂÃ¢â€¢ÂÃ¢â€¢ÂÃ¢â€¢ÂÃ¢â€¢ÂÃ¢â€¢ÂÃ¢â€¢ÂÃ¢â€¢ÂÃ¢â€¢ÂÃ¢â€¢ÂÃ¢â€¢ÂÃ¢â€¢ÂÃ¢â€¢ÂÃ¢â€¢ÂÃ¢â€¢ÂÃ¢â€¢ÂÃ¢â€¢ÂÃ¢â€¢ÂÃ¢â€¢ÂÃ¢â€¢ÂÃ¢â€¢Â */
.sidebar {
  background: var(--glass-bg);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-right: 1px solid var(--glass-border);
  display: flex; flex-direction: column;
  overflow: hidden; min-width: 0;
  transition: opacity .2s, background .2s;
}
.app.sb-collapsed .sidebar { opacity: 0; pointer-events: none; }

.sb-head { padding: 16px 14px 12px; display: flex; flex-direction: column; gap: 12px; }
.brand { display: flex; align-items: center; gap: 10px; }
.brand-mark {
  width: 32px; height: 32px;
  display: flex; align-items: center; justify-content: center;
  color: var(--ink);
  position: relative;
}
.brand-mark::after {
  content: 'S';
  position: absolute; inset: 0;
  display: flex; align-items: center; justify-content: center;
  color: var(--bg); font-size: 11px; font-weight: 800; letter-spacing: -.2px;
  font-family: var(--font-ui);
}
.brand-name {
  font-family: var(--font-serif); font-weight: 600; font-size: 17px;
  letter-spacing: -.3px; line-height: 1; color: var(--ink);
}
.brand-sub {
  font-family: var(--font-mono); font-size: 10px;
  color: var(--soft); letter-spacing: .8px; text-transform: uppercase;
  margin-top: 2px;
}

.btn-new {
  display: flex; align-items: center; gap: 8px;
  padding: 9px 12px; background: var(--bg-elev);
  color: var(--ink); border: 1px solid var(--border-2);
  border-radius: var(--r-2); font-size: 13px; font-weight: 500;
  transition: background .14s, border-color .14s, transform .12s;
  box-shadow: var(--sh-xs);
}
.btn-new .kbd { margin-left: auto; }
.btn-new:hover { background: var(--bg); border-color: var(--border-strong); transform: translateY(-1px); }

.sb-search {
  display: flex; align-items: center; gap: 8px;
  padding: 7px 10px;
  background: var(--bg-elev); border: 1px solid var(--border-2);
  border-radius: var(--r-2);
  color: var(--muted);
  transition: border-color .14s, box-shadow .14s;
}
.sb-search:focus-within { border-color: var(--ink); box-shadow: 0 0 0 3px var(--focus-ring); }
.sb-search input {
  flex: 1; border: 0; outline: 0;
  background: transparent; color: var(--ink);
  font-family: inherit; font-size: 13px;
}
.sb-search input::placeholder { color: var(--soft); }

.sb-list {
  flex: 1; overflow-y: auto;
  padding: 4px 8px 12px;
  display: flex; flex-direction: column; gap: 1px;
}
.sb-section {
  font-family: var(--font-mono); font-size: 9.5px;
  letter-spacing: 1.4px; color: var(--soft);
  text-transform: uppercase; font-weight: 500;
  padding: 12px 8px 4px;
}
.conv-item {
  display: flex; flex-direction: column; align-items: flex-start;
  gap: 2px; padding: 8px 10px; border-radius: var(--r-1);
  border: 0; background: transparent; text-align: left;
  font-size: 13px; color: var(--ink-2);
  transition: background .12s;
  width: 100%; cursor: pointer;
}
.conv-item:hover { background: rgba(31,30,26,.04); }
.conv-item.active {
  background: var(--bg-elev);
  box-shadow: var(--sh-xs);
}
.conv-title-text {
  font-weight: 500; line-height: 1.3;
  display: -webkit-box; -webkit-line-clamp: 1; -webkit-box-orient: vertical;
  overflow: hidden; max-width: 100%;
  white-space: nowrap; text-overflow: ellipsis;
}
.conv-when {
  font-family: var(--font-mono); font-size: 10.5px;
  color: var(--soft); letter-spacing: .2px;
}
.sb-empty { padding: 16px 12px; color: var(--soft); font-size: 12.5px; text-align: center; }

.sb-foot {
  padding: 12px 14px 14px;
  border-top: 1px solid var(--border);
  display: flex; flex-direction: column; gap: 8px;
}
.bridge-card {
  background: var(--bg-elev); border: 1px solid var(--border-2);
  border-radius: var(--r-2); padding: 10px 12px;
  display: flex; flex-direction: column; gap: 4px;
}
.bridge-row {
  display: flex; align-items: center; gap: 6px;
  color: var(--muted); font-size: 11px;
}
.bridge-label {
  font-family: var(--font-mono); font-size: 9.5px;
  letter-spacing: 1.2px; flex: 1;
}
.bridge-dot {
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--success); animation: pulse 2.4s ease-in-out infinite;
}
.bridge-num {
  font-family: var(--font-mono); font-size: 12px; font-weight: 500;
  color: var(--ink); letter-spacing: -.2px;
}
.bridge-meta { font-size: 11px; color: var(--muted); line-height: 1.4; }

.bridge-empty {
  display: flex; align-items: center; gap: 8px;
  padding: 9px 12px; background: transparent;
  border: 1px dashed var(--border-strong); border-radius: var(--r-2);
  color: var(--muted); font-size: 12.5px;
  transition: background .14s, color .14s, border-color .14s;
}
.bridge-empty:hover { background: var(--bg-elev); color: var(--ink); border-color: var(--border-2); border-style: solid; }

.sb-foot-link {
  display: flex; align-items: center; gap: 8px;
  padding: 6px 4px; background: transparent; border: 0;
  color: var(--muted); font-size: 12.5px;
  border-radius: var(--r-1);
  transition: color .12s;
}
.sb-foot-link:hover { color: var(--ink); }

.sb-foot-version {
  font-family: var(--font-mono); font-size: 10px;
  color: var(--soft); letter-spacing: 1px;
  display: flex; align-items: center; gap: 6px;
  padding-top: 4px;
}
.dot-online {
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--success); animation: pulse 2.4s ease-in-out infinite;
}
@keyframes pulse { 0%,100% { opacity: 1; } 50% { opacity: .35; } }

/* Ã¢â€¢ÂÃ¢â€¢ÂÃ¢â€¢ÂÃ¢â€¢ÂÃ¢â€¢ÂÃ¢â€¢ÂÃ¢â€¢ÂÃ¢â€¢ÂÃ¢â€¢ÂÃ¢â€¢ÂÃ¢â€¢ÂÃ¢â€¢ÂÃ¢â€¢ÂÃ¢â€¢ÂÃ¢â€¢ÂÃ¢â€¢ÂÃ¢â€¢ÂÃ¢â€¢ÂÃ¢â€¢ÂÃ¢â€¢ÂÃ¢â€¢ÂÃ¢â€¢ÂÃ¢â€¢ÂÃ¢â€¢ÂÃ¢â€¢ÂÃ¢â€¢ÂÃ¢â€¢ÂÃ¢â€¢ÂÃ¢â€¢ÂÃ¢â€¢ÂÃ¢â€¢ÂÃ¢â€¢ÂÃ¢â€¢ÂÃ¢â€¢ÂÃ¢â€¢ÂÃ¢â€¢ÂÃ¢â€¢ÂÃ¢â€¢ÂÃ¢â€¢Â
   TOPBAR
Ã¢â€¢ÂÃ¢â€¢ÂÃ¢â€¢ÂÃ¢â€¢ÂÃ¢â€¢ÂÃ¢â€¢ÂÃ¢â€¢ÂÃ¢â€¢ÂÃ¢â€¢ÂÃ¢â€¢ÂÃ¢â€¢ÂÃ¢â€¢ÂÃ¢â€¢ÂÃ¢â€¢ÂÃ¢â€¢ÂÃ¢â€¢ÂÃ¢â€¢ÂÃ¢â€¢ÂÃ¢â€¢ÂÃ¢â€¢ÂÃ¢â€¢ÂÃ¢â€¢ÂÃ¢â€¢ÂÃ¢â€¢ÂÃ¢â€¢ÂÃ¢â€¢ÂÃ¢â€¢ÂÃ¢â€¢ÂÃ¢â€¢ÂÃ¢â€¢ÂÃ¢â€¢ÂÃ¢â€¢ÂÃ¢â€¢ÂÃ¢â€¢ÂÃ¢â€¢ÂÃ¢â€¢ÂÃ¢â€¢ÂÃ¢â€¢ÂÃ¢â€¢ÂÃ¢â€¢Â */
.topbar {
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 22px;
  border-bottom: 1px solid var(--glass-border);
  background: var(--glass-bg);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  min-height: 60px;
  position: sticky; top: 0; z-index: 10;
}
.tb-left, .tb-right { display: flex; align-items: center; gap: 10px; }
.tb-title-block { min-width: 0; }
.tb-title {
  font-family: var(--font-serif); font-weight: 500; font-size: 16px;
  letter-spacing: -.2px; margin: 0; line-height: 1.3;
  color: var(--ink);
  max-width: 56vw;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.mode-indicator {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 5px 11px;
  border: 1px solid var(--border-2); border-radius: var(--r-pill);
  font-size: 12px; color: var(--muted); background: var(--bg-elev);
}
/* Ã¢â€¢ÂÃ¢â€¢ÂÃ¢â€¢ÂÃ¢â€¢ÂÃ¢â€¢ÂÃ¢â€¢ÂÃ¢â€¢ÂÃ¢â€¢ÂÃ¢â€¢ÂÃ¢â€¢ÂÃ¢â€¢ÂÃ¢â€¢ÂÃ¢â€¢ÂÃ¢â€¢ÂÃ¢â€¢ÂÃ¢â€¢ÂÃ¢â€¢ÂÃ¢â€¢ÂÃ¢â€¢ÂÃ¢â€¢ÂÃ¢â€¢ÂÃ¢â€¢ÂÃ¢â€¢ÂÃ¢â€¢ÂÃ¢â€¢ÂÃ¢â€¢ÂÃ¢â€¢ÂÃ¢â€¢ÂÃ¢â€¢ÂÃ¢â€¢ÂÃ¢â€¢ÂÃ¢â€¢ÂÃ¢â€¢ÂÃ¢â€¢ÂÃ¢â€¢ÂÃ¢â€¢ÂÃ¢â€¢ÂÃ¢â€¢ÂÃ¢â€¢Â
   WELCOME / HUB
Ã¢â€¢ÂÃ¢â€¢ÂÃ¢â€¢ÂÃ¢â€¢ÂÃ¢â€¢ÂÃ¢â€¢ÂÃ¢â€¢ÂÃ¢â€¢ÂÃ¢â€¢ÂÃ¢â€¢ÂÃ¢â€¢ÂÃ¢â€¢ÂÃ¢â€¢ÂÃ¢â€¢ÂÃ¢â€¢ÂÃ¢â€¢ÂÃ¢â€¢ÂÃ¢â€¢ÂÃ¢â€¢ÂÃ¢â€¢ÂÃ¢â€¢ÂÃ¢â€¢ÂÃ¢â€¢ÂÃ¢â€¢ÂÃ¢â€¢ÂÃ¢â€¢ÂÃ¢â€¢ÂÃ¢â€¢ÂÃ¢â€¢ÂÃ¢â€¢ÂÃ¢â€¢ÂÃ¢â€¢ÂÃ¢â€¢ÂÃ¢â€¢ÂÃ¢â€¢ÂÃ¢â€¢ÂÃ¢â€¢ÂÃ¢â€¢ÂÃ¢â€¢ÂÃ¢â€¢Â */
.welcome {
  max-width: 880px; margin: 0 auto;
  padding: 24px 24px 24px;
  display: flex; flex-direction: column; gap: 20px;
  animation: w-fade .4s ease;
}
@keyframes w-fade {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: none; }
}

.welcome-head {
  display: flex; flex-direction: column; align-items: center; gap: 16px;
  text-align: center;
}
.hex-mark { color: var(--ink); position: relative; }
.hex-mark::after {
  content: 'S';
  position: absolute; inset: 0;
  display: flex; align-items: center; justify-content: center;
  color: var(--bg); font-size: 16px; font-weight: 800;
}
.welcome-title {
  display: flex; flex-direction: column; gap: 4px;
  margin: 0; font-family: var(--font-serif);
  font-weight: 400; font-size: 36px; letter-spacing: -.8px;
  line-height: 1.15; color: var(--ink);
}
.welcome-greet { color: var(--muted); font-style: italic; font-size: 22px; font-weight: 400; }
.welcome-prompt { font-weight: 500; }

.welcome-tabs {
  display: inline-flex; align-self: center;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--r-pill); padding: 4px; gap: 2px;
}
.wt {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 7px 14px; border: 0; background: transparent;
  border-radius: var(--r-pill);
  font-size: 13px; color: var(--muted);
  transition: color .14s, background .14s;
}
.wt:hover { color: var(--ink); }
.wt.active {
  background: var(--bg-elev); color: var(--ink);
  font-weight: 500; box-shadow: var(--sh-sm);
}

/* Mode cards row — removed (now a dropdown in toolbar) */

/* Suggestions */
.sugg-head {
  display: flex; align-items: center; justify-content: space-between;
  margin-top: 16px; gap: 12px; flex-wrap: wrap;
}
.sugg-title-row { display: flex; align-items: baseline; gap: 10px; }
.sugg-sub { font-family: var(--font-serif); font-style: italic; color: var(--muted); font-size: 13px; }
.sugg-cats { display: flex; gap: 4px; flex-wrap: wrap; }
.cat-pill {
  padding: 4px 11px; font-size: 11.5px; border-radius: var(--r-pill);
  border: 1px solid var(--border-2); background: transparent; color: var(--muted);
  transition: background .12s, color .12s, border-color .12s;
}
.cat-pill:hover { background: var(--surface); color: var(--ink); }
.cat-pill.active { background: var(--ink); color: var(--bg); border-color: var(--ink); }

.sugg-grid {
  display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px;
}
.sugg-card {
  display: grid; grid-template-columns: auto 1fr auto; align-items: center;
  gap: 12px;
  padding: 12px 14px;
  background: var(--bg-elev); border: 1px solid var(--border);
  border-radius: var(--r-2); text-align: left;
  transition: border-color .14s, transform .14s, box-shadow .14s;
  cursor: pointer; position: relative;
}
.sugg-card:hover { border-color: var(--border-strong); box-shadow: var(--sh-sm); transform: translateY(-1px); }
.sugg-card:hover .sugg-arrow { opacity: 1; transform: translateX(0); color: var(--ink); }
.sugg-cat {
  font-family: var(--font-mono); font-size: 9.5px; letter-spacing: 1.2px;
  text-transform: uppercase; color: var(--soft);
  align-self: stretch; padding-right: 12px; border-right: 1px solid var(--border);
  display: flex; align-items: center;
  min-width: 70px;
}
.sugg-title { font-size: 13.5px; font-weight: 500; color: var(--ink); display: block; line-height: 1.3; }
.sugg-hint { font-size: 12px; color: var(--muted); display: block; margin-top: 2px; line-height: 1.4; }
.sugg-card .sugg-arrow {
  color: var(--soft); opacity: 0; transform: translateX(-4px);
  transition: opacity .14s, transform .14s, color .14s;
}

/* Import pane */
.import-card {
  display: grid; grid-template-columns: 1fr 1fr; gap: 24px;
  padding: 24px; background: var(--bg-elev);
  border: 1px solid var(--border); border-radius: var(--r-3);
}
.import-left h3 { font-family: var(--font-serif); margin: 8px 0 8px; font-size: 22px; font-weight: 500; letter-spacing: -.3px; }
.import-left p { color: var(--muted); font-size: 13.5px; line-height: 1.55; margin: 0 0 16px; }
.import-steps { display: flex; flex-direction: column; gap: 8px; margin-bottom: 16px; }
.istep {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 10px; background: var(--surface); border-radius: var(--r-2);
  font-size: 13px; color: var(--ink-2);
}
.istep-n {
  width: 22px; height: 22px; border-radius: 6px;
  background: var(--ink); color: var(--bg);
  font-family: var(--font-mono); font-size: 11px; font-weight: 600;
  display: flex; align-items: center; justify-content: center;
}
.import-actions { display: flex; gap: 8px; }

.proc-preview {
  background: var(--surface); border: 1px solid var(--border-2);
  border-radius: var(--r-2); padding: 16px; height: 100%;
  display: flex; flex-direction: column; gap: 8px;
}
.pp-tab {
  display: inline-block; align-self: flex-start;
  padding: 3px 10px; background: var(--ink); color: var(--bg);
  font-family: var(--font-mono); font-size: 10px; letter-spacing: 1px;
  text-transform: uppercase; border-radius: var(--r-pill);
}
.pp-num {
  font-family: var(--font-mono); font-size: 14px; font-weight: 500;
  color: var(--ink); letter-spacing: -.2px;
}
.pp-row {
  display: flex; justify-content: space-between; align-items: baseline;
  font-size: 12px; padding: 6px 0; border-bottom: 1px dashed var(--border-2);
}
.pp-row span:first-child { color: var(--soft); font-family: var(--font-mono); font-size: 10.5px; letter-spacing: .8px; text-transform: uppercase; }
.pp-row span:last-child { color: var(--ink); font-weight: 500; }
.pp-stats {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-top: 8px;
  padding-top: 12px; border-top: 1px solid var(--border-2);
}
.pp-stats > div { display: flex; flex-direction: column; gap: 2px; }
.pp-stats b { font-family: var(--font-serif); font-size: 17px; font-weight: 600; color: var(--ink); }
.pp-stats span { font-family: var(--font-mono); font-size: 9.5px; letter-spacing: .8px; text-transform: uppercase; color: var(--soft); }

/* Templates */
.tpl-grid {
  display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px;
}
.tpl-card {
  display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 14px;
  padding: 14px 16px;
  background: var(--bg-elev); border: 1px solid var(--border);
  border-radius: var(--r-2);
  text-align: left; transition: border-color .14s, transform .14s, box-shadow .14s;
}
.welcome-box {
  background: var(--glass-welcome);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--glass-border);
  border-radius: var(--r-3);
  padding: 24px; text-align: left;
  transition: transform .2s, box-shadow .2s;
  box-shadow: var(--sh-sm);
}
.welcome-box:hover {
  transform: translateY(-2px);
  box-shadow: var(--sh-md);
  border-color: var(--focus-ring);
}
.tpl-card:hover { border-color: var(--border-strong); transform: translateY(-1px); box-shadow: var(--sh-sm); }
.tpl-code {
  width: 36px; height: 36px; border-radius: var(--r-2);
  background: var(--surface); border: 1px solid var(--border);
  display: flex; align-items: center; justify-content: center;
  font-family: var(--font-mono); font-size: 11px; font-weight: 600;
  color: var(--ink); letter-spacing: .5px;
}
.tpl-cat { font-family: var(--font-mono); font-size: 9.5px; letter-spacing: 1.2px; text-transform: uppercase; color: var(--soft); }
.tpl-title { font-size: 13.5px; font-weight: 500; color: var(--ink); margin-top: 1px; }
.tpl-hint { font-size: 11.5px; color: var(--muted); margin-top: 1px; }
.tpl-card svg { color: var(--soft); }
.tpl-card:hover svg { color: var(--ink); }

/* === AGENTES (cards dedicados, sem heranÃ§a problemÃ¡tica) ================= */
.agents-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 12px;
  margin-top: 4px;
}
.agent-card {
  display: flex; flex-direction: column; gap: 8px;
  padding: 16px 18px 14px;
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: var(--r-2);
  transition: border-color .14s, transform .14s, box-shadow .14s;
}
.agent-card:hover {
  border-color: var(--border-strong);
  transform: translateY(-1px);
  box-shadow: var(--sh-sm);
}
.agent-head {
  display: flex; align-items: center; gap: 10px;
}
.agent-icon {
  width: 36px; height: 36px; border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.agent-name {
  flex: 1;
  font-weight: 600; font-size: 14px; color: var(--ink);
  font-family: var(--font-serif);
}
.agent-badge {
  font-size: 10px; color: var(--blue, #1a56db);
  background: var(--blue-light, rgba(26,86,219,0.12));
  border-radius: var(--r-pill);
  padding: 2px 8px;
  font-family: var(--font-mono); letter-spacing: .4px; text-transform: uppercase;
  flex-shrink: 0;
}
.agent-badge-example {
  color: var(--muted);
  background: var(--bg-3, rgba(255,255,255,0.05));
  border: 1px solid var(--border-2);
}
.agent-badge-custom {
  color: #059669;
  background: rgba(5, 150, 105, 0.12);
  border: 1px solid rgba(5, 150, 105, 0.25);
}
.agent-card-example {
  opacity: 0.82;
}
.agent-card-example:hover { opacity: 1; }

/* ── Agent Wizard ── */
.agent-wizard { min-height: 480px; display: flex; flex-direction: column; }
.agent-wizard .ob-body { flex: 1; overflow-y: auto; }
.agent-meta {
  font-size: 11px; color: var(--soft);
  font-family: var(--font-mono); letter-spacing: .8px; text-transform: uppercase;
}
.agent-desc {
  margin: 0; font-size: 12.5px; color: var(--muted);
  line-height: 1.55;
  flex: 1;
}
.agent-cta {
  align-self: flex-end;
  display: inline-flex; align-items: center; gap: 5px;
  padding: 6px 14px; border-radius: var(--r-2);
  background: var(--ink); color: var(--bg-elev);
  border: none; cursor: pointer;
  font-size: 12px; font-weight: 500;
  transition: background .14s, transform .14s;
}
.agent-cta:hover { background: var(--ink-strong, var(--ink)); transform: translateX(1px); }

.agent-knowledge-panel {
  margin: 0 0 20px;
  padding: 16px;
  border: 1px solid var(--border);
  border-radius: var(--r-2);
  background: var(--bg-elev);
}
.agent-knowledge-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}
.agent-knowledge-head h3 {
  margin: 2px 0 4px;
  font-size: 16px;
  color: var(--ink);
  font-family: var(--font-serif);
}
.agent-knowledge-head p {
  margin: 0;
  max-width: 640px;
  color: var(--muted);
  font-size: 12.5px;
  line-height: 1.55;
}
.agent-combo-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-bottom: 12px;
}
.agent-combo-card {
  border: 1px solid var(--border-2);
  border-radius: var(--r-2);
  padding: 10px 12px;
  background: var(--surface);
  display: flex;
  flex-direction: column;
  gap: 3px;
}
.combo-k {
  font-family: var(--font-mono);
  font-size: 9.5px;
  letter-spacing: .9px;
  text-transform: uppercase;
  color: var(--soft);
}
.agent-combo-card strong { font-size: 12.5px; color: var(--ink); }
.agent-combo-card small { font-size: 11px; color: var(--muted); line-height: 1.45; }
.skill-picker-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 8px;
}
.skill-pick {
  display: flex;
  gap: 9px;
  align-items: flex-start;
  text-align: left;
  padding: 10px;
  border: 1px solid var(--border-2);
  border-radius: var(--r-2);
  background: var(--surface);
  color: var(--ink);
  cursor: pointer;
  min-height: 72px;
  transition: border-color .14s, background .14s, transform .14s;
}
.skill-pick:hover { border-color: var(--border-strong); transform: translateY(-1px); }
.skill-pick.active {
  border-color: color-mix(in srgb, var(--accent) 50%, var(--border));
  background: color-mix(in srgb, var(--accent) 9%, var(--surface));
}
.skill-pick-mark {
  width: 22px; height: 22px;
  border-radius: 7px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-elev);
  color: var(--accent);
  flex-shrink: 0;
}
.skill-pick-body { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.skill-pick-body strong {
  font-family: var(--font-mono);
  font-size: 11.5px;
  color: var(--ink);
  word-break: break-word;
}
.skill-pick-body small {
  color: var(--muted);
  font-size: 11px;
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.skill-empty {
  padding: 12px;
  color: var(--muted);
  font-size: 12px;
  border: 1px dashed var(--border-2);
  border-radius: var(--r-2);
}
.skill-tutorial-box {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-bottom: 14px;
  padding: 12px;
  border: 1px solid var(--border-2);
  border-radius: var(--r-2);
  background: var(--surface);
  font-size: 12.5px;
  color: var(--muted);
  line-height: 1.55;
}
.skill-tutorial-box strong { color: var(--ink); }

/* === TEMPLATES v2 (cards limpos com filtro de categoria) ================= */
.tpl-filter-row {
  display: flex; align-items: center; gap: 6px;
  margin-bottom: 14px; flex-wrap: wrap;
}
.tpl-filter-label {
  font-size: 11px; font-family: var(--font-mono);
  letter-spacing: 1px; text-transform: uppercase; color: var(--soft);
  margin-right: 6px;
}
.tpl-filter-chip {
  padding: 4px 10px; border-radius: var(--r-pill);
  background: transparent; border: 1px solid var(--border);
  font-size: 12px; color: var(--muted); cursor: pointer;
  transition: all .14s;
}
.tpl-filter-chip:hover { border-color: var(--border-strong); color: var(--ink); }
.tpl-filter-chip.active {
  background: var(--ink); color: var(--bg-elev); border-color: var(--ink);
}
.template-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 10px;
}
.template-card {
  display: grid; grid-template-columns: auto 1fr auto;
  align-items: center; gap: 12px;
  padding: 14px 16px;
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: var(--r-2);
  text-align: left;
  cursor: pointer;
  transition: border-color .14s, transform .14s, box-shadow .14s;
}
.template-card:hover {
  border-color: var(--border-strong);
  transform: translateY(-1px);
  box-shadow: var(--sh-sm);
}
.template-code {
  width: 36px; height: 36px; border-radius: var(--r-2);
  background: var(--surface); border: 1px solid var(--border);
  display: flex; align-items: center; justify-content: center;
  font-family: var(--font-mono); font-size: 11px; font-weight: 600;
  color: var(--ink); letter-spacing: .5px;
  flex-shrink: 0;
}
.template-body { min-width: 0; }
.template-cat {
  font-family: var(--font-mono); font-size: 9.5px;
  letter-spacing: 1.2px; text-transform: uppercase; color: var(--soft);
}
.template-title {
  font-size: 13.5px; font-weight: 500; color: var(--ink);
  margin-top: 2px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.template-hint {
  font-size: 11.5px; color: var(--muted); margin-top: 1px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.template-card svg { color: var(--soft); flex-shrink: 0; }
.template-card:hover svg { color: var(--ink); }
@media (max-width: 720px) {
  .agents-grid, .template-grid, .agent-combo-grid { grid-template-columns: 1fr; }
  .agent-knowledge-head { flex-direction: column; }
}
/* Ã¢â€¢ÂÃ¢â€¢ÂÃ¢â€¢ÂÃ¢â€¢ÂÃ¢â€¢ÂÃ¢â€¢ÂÃ¢â€¢ÂÃ¢â€¢ÂÃ¢â€¢ÂÃ¢â€¢ÂÃ¢â€¢ÂÃ¢â€¢ÂÃ¢â€¢ÂÃ¢â€¢ÂÃ¢â€¢ÂÃ¢â€¢ÂÃ¢â€¢ÂÃ¢â€¢ÂÃ¢â€¢ÂÃ¢â€¢ÂÃ¢â€¢ÂÃ¢â€¢ÂÃ¢â€¢ÂÃ¢â€¢ÂÃ¢â€¢ÂÃ¢â€¢ÂÃ¢â€¢ÂÃ¢â€¢ÂÃ¢â€¢ÂÃ¢â€¢ÂÃ¢â€¢ÂÃ¢â€¢ÂÃ¢â€¢ÂÃ¢â€¢ÂÃ¢â€¢ÂÃ¢â€¢ÂÃ¢â€¢ÂÃ¢â€¢ÂÃ¢â€¢Â
   MESSAGES & COMPOSER
Ã¢â€¢ÂÃ¢â€¢ÂÃ¢â€¢ÂÃ¢â€¢ÂÃ¢â€¢ÂÃ¢â€¢ÂÃ¢â€¢ÂÃ¢â€¢ÂÃ¢â€¢ÂÃ¢â€¢ÂÃ¢â€¢ÂÃ¢â€¢ÂÃ¢â€¢ÂÃ¢â€¢ÂÃ¢â€¢ÂÃ¢â€¢ÂÃ¢â€¢ÂÃ¢â€¢ÂÃ¢â€¢ÂÃ¢â€¢ÂÃ¢â€¢ÂÃ¢â€¢ÂÃ¢â€¢ÂÃ¢â€¢ÂÃ¢â€¢ÂÃ¢â€¢ÂÃ¢â€¢ÂÃ¢â€¢ÂÃ¢â€¢ÂÃ¢â€¢ÂÃ¢â€¢ÂÃ¢â€¢ÂÃ¢â€¢ÂÃ¢â€¢ÂÃ¢â€¢ÂÃ¢â€¢ÂÃ¢â€¢ÂÃ¢â€¢ÂÃ¢â€¢ÂÃ¢â€¢Â */

.messages {
  overflow-y: auto;
  padding: 32px 24px 80px;
  scroll-behavior: smooth;
}
.messages-inner {
  max-width: 760px; margin: 0 auto;
  display: flex; flex-direction: column; gap: 28px;
}
.msg { display: flex; gap: 12px; animation: m-in .3s ease; }
@keyframes m-in {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: none; }
}

.msg-user {
  justify-content: flex-end;
}
.msg-user .msg-bubble {
  background: var(--grad-1);
  border: 1px solid var(--glass-border);
  border-radius: var(--r-3) var(--r-3) 4px var(--r-3);
  padding: 10px 14px;
  max-width: 80%;
  font-size: 14.5px; line-height: 1.55; color: var(--glass-text);
  white-space: pre-wrap;
  box-shadow: var(--sh-sm);
}

.msg-assistant .msg-avatar {
  width: 28px; height: 28px; border-radius: 8px;
  background: var(--ink); color: var(--bg-elev);
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0; margin-top: 2px;
  position: relative;
}
.msg-assistant .msg-avatar::after {
  content: 'S';
  position: absolute; inset: 0;
  display: flex; align-items: center; justify-content: center;
  font-size: 10px; font-weight: 800; color: var(--bg);
}
.msg-assistant .msg-avatar svg { display: none; }
.msg-body { flex: 1; min-width: 0; }
.msg-name {
  font-size: 12.5px; font-weight: 600; color: var(--ink);
  display: flex; align-items: center; gap: 8px; margin-bottom: 6px;
}
.badge {
  font-family: var(--font-mono);
  font-size: 9.5px; letter-spacing: 1px; text-transform: uppercase;
  padding: 2px 8px; border-radius: var(--r-pill);
  font-weight: 500;
}
.badge-agent { background: var(--agent-bg); color: var(--agent-fg); }
.badge-reasoning { background: var(--reason-bg); color: var(--reason-fg); }
.badge-speed {
  background: color-mix(in srgb, var(--accent) 12%, transparent);
  color: var(--accent);
  font-family: var(--font-mono); font-size: 9px; letter-spacing: .5px;
  padding: 2px 7px; border-radius: var(--r-pill); font-weight: 600;
}

/* Markdown */
.md { font-size: 14.5px; line-height: 1.7; color: var(--ink); }
.md p { margin: 0 0 12px; }
.md p:last-child { margin-bottom: 0; }
.md strong { font-weight: 600; }
.md em { font-style: italic; color: var(--ink-2); }
.md ul, .md ol { margin: 0 0 12px; padding-left: 22px; }
.md li { margin-bottom: 4px; }
.md li::marker { color: var(--soft); }
.md code {
  font-family: var(--font-mono); font-size: 13px;
  background: var(--surface); padding: 1.5px 5px; border-radius: 4px;
  border: 1px solid var(--border);
}

/* Thinking accordion */
.thinking {
  margin-bottom: 12px;
  border: 1px solid var(--border-2); border-radius: var(--r-2);
  background: var(--surface); overflow: hidden;
  transition: background .14s, border-color .14s;
}
.thinking.open { background: var(--bg-elev); border-color: var(--border); }
.th-head {
  width: 100%; padding: 8px 12px;
  display: flex; align-items: center; gap: 8px;
  background: transparent; border: 0;
  font-size: 12.5px; font-weight: 500; color: var(--muted);
  text-align: left;
}
.th-head:hover { color: var(--ink); }
.th-dot {
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--soft); flex-shrink: 0;
}
.thinking.open .th-dot { background: var(--ink); }
.th-time { margin-left: auto; font-family: var(--font-mono); font-size: 10.5px; color: var(--soft); }
.th-chev { transition: transform .2s; color: var(--soft); }
.thinking.open .th-chev { transform: rotate(90deg); }
.th-body {
  padding: 10px 14px 12px; border-top: 1px solid var(--border);
  font-family: var(--font-serif); font-size: 13px; line-height: 1.65;
  color: var(--muted); font-style: italic;
}

/* Tools block */
/* ─── Skills used block — estilo Claude ─────────────────────────── */
.tools-block {
  margin-bottom: 12px;
  border: 1px solid var(--border-2);
  border-radius: 10px;
  overflow: hidden;
  background: var(--bg-elev);
}
.tb-head {
  display: flex; align-items: center; gap: 8px;
  padding: 9px 12px;
  cursor: pointer;
  background: var(--surface);
  border: none; width: 100%; text-align: left;
  border-bottom: 1px solid transparent;
  transition: background .12s;
}
.tb-open .tb-head { border-bottom-color: var(--border); }
.tb-head:hover { background: color-mix(in srgb, var(--surface) 96%, var(--accent) 4%); }
.tb-icon-wrap {
  width: 20px; height: 20px; border-radius: 6px;
  display: flex; align-items: center; justify-content: center;
  background: color-mix(in srgb, var(--accent) 12%, transparent);
  color: var(--accent); flex-shrink: 0;
}
.tb-spin { animation: tb-rotate .9s linear infinite; display: flex; }
@keyframes tb-rotate { to { transform: rotate(360deg); } }
.tb-summary { font-size: 12px; font-weight: 600; color: var(--ink); white-space: nowrap; }
.tb-pills { display: flex; flex-wrap: wrap; gap: 5px; flex: 1; overflow: hidden; }
.tb-pill {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 2px 8px; border-radius: 100px;
  font-size: 10.5px; font-weight: 500;
  background: var(--surface-2); color: var(--muted);
  border: 1px solid var(--border); white-space: nowrap;
}
.tb-pill-run {
  background: color-mix(in srgb, var(--accent) 10%, transparent);
  color: var(--accent); border-color: color-mix(in srgb, var(--accent) 30%, transparent);
  animation: tb-pulse 1.4s ease-in-out infinite;
}
@keyframes tb-pulse { 0%,100% { opacity: 1; } 50% { opacity: .55; } }
.tb-pill-more { font-style: italic; opacity: .7; }
.tb-time { margin-left: auto; font-family: var(--font-mono); font-size: 10.5px; color: var(--soft); white-space: nowrap; flex-shrink: 0; }
.tb-chev { color: var(--soft); transition: transform .15s; flex-shrink: 0; }
.tb-open .tb-chev { transform: rotate(90deg); }
.tb-steps { display: flex; flex-direction: column; }

/* Tool steps */
.tool-step { border-bottom: 1px solid var(--border); }
.tool-step:last-child { border-bottom: 0; }
.ts-head {
  width: 100%; padding: 8px 12px;
  display: flex; align-items: center; gap: 8px;
  background: transparent; border: 0;
  font-size: 12px; color: var(--ink); text-align: left;
  cursor: pointer; transition: background .12s;
}
.ts-head:hover { background: var(--surface); }
.ts-dot {
  width: 18px; height: 18px; border-radius: 5px; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  background: color-mix(in srgb, var(--success) 15%, transparent); color: var(--success);
}
.ts-running .ts-dot { background: color-mix(in srgb, var(--accent) 12%, transparent); color: var(--accent); }
.ts-dot-spin { animation: tb-rotate .9s linear infinite; }
.ts-label { font-weight: 600; font-size: 12px; flex: 1; }
.ts-name-raw { font-family: var(--font-mono); font-size: 9.5px; color: var(--soft); opacity: 0; transition: opacity .15s; }
.ts-head:hover .ts-name-raw { opacity: 1; }
.ts-running-badge {
  font-family: var(--font-mono); font-size: 9.5px; letter-spacing: .8px;
  text-transform: uppercase; color: var(--accent);
  animation: tb-pulse 1.4s ease-in-out infinite;
}
.ts-chev { color: var(--soft); transition: transform .15s; flex-shrink: 0; }
.ts-open .ts-chev { transform: rotate(90deg); }
.ts-body {
  padding: 4px 12px 12px 38px; background: var(--surface);
  display: flex; flex-direction: column; gap: 8px;
  border-top: 1px solid var(--border);
}
.ts-row { display: flex; flex-direction: column; gap: 4px; }
.ts-row-k { font-family: var(--font-mono); font-size: 9.5px; letter-spacing: 1px; text-transform: uppercase; color: var(--soft); }
.ts-row pre {
  margin: 0; padding: 8px 10px;
  background: var(--bg-elev); border: 1px solid var(--border);
  border-radius: var(--r-1);
  font-family: var(--font-mono); font-size: 11.5px; line-height: 1.5;
  color: var(--ink-2); white-space: pre-wrap; word-break: break-word;
}

/* Actions */
.msg-actions {
  display: flex; gap: 4px; margin-top: 10px;
  opacity: 0; transition: opacity .15s;
}
.msg:hover .msg-actions { opacity: 1; }
.msg-actions button {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 4px 9px; font-size: 11.5px;
  background: transparent; border: 1px solid transparent;
  color: var(--soft); border-radius: var(--r-1);
  transition: background .12s, color .12s, border-color .12s;
}
.msg-actions button:hover { background: var(--surface); color: var(--ink); border-color: var(--border); }

/* Typing */
.typing { display: inline-flex; gap: 5px; padding: 8px 0; }
.typing span {
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--soft);
  animation: bounce 1.1s infinite ease-in-out;
}
.typing span:nth-child(2) { animation-delay: .15s; }
.typing span:nth-child(3) { animation-delay: .3s; }
@keyframes bounce { 0%,80%,100% { transform: scale(.5); opacity: .4; } 40% { transform: scale(1); opacity: 1; } }

/* Ã¢â€¢ÂÃ¢â€¢ÂÃ¢â€¢ÂÃ¢â€¢ÂÃ¢â€¢ÂÃ¢â€¢ÂÃ¢â€¢ÂÃ¢â€¢ÂÃ¢â€¢ÂÃ¢â€¢ÂÃ¢â€¢ÂÃ¢â€¢ÂÃ¢â€¢ÂÃ¢â€¢ÂÃ¢â€¢ÂÃ¢â€¢ÂÃ¢â€¢ÂÃ¢â€¢ÂÃ¢â€¢ÂÃ¢â€¢ÂÃ¢â€¢ÂÃ¢â€¢ÂÃ¢â€¢ÂÃ¢â€¢ÂÃ¢â€¢ÂÃ¢â€¢ÂÃ¢â€¢ÂÃ¢â€¢ÂÃ¢â€¢ÂÃ¢â€¢ÂÃ¢â€¢ÂÃ¢â€¢ÂÃ¢â€¢ÂÃ¢â€¢ÂÃ¢â€¢ÂÃ¢â€¢ÂÃ¢â€¢ÂÃ¢â€¢ÂÃ¢â€¢Â
   COMPOSER
Ã¢â€¢ÂÃ¢â€¢ÂÃ¢â€¢ÂÃ¢â€¢ÂÃ¢â€¢ÂÃ¢â€¢ÂÃ¢â€¢ÂÃ¢â€¢ÂÃ¢â€¢ÂÃ¢â€¢ÂÃ¢â€¢ÂÃ¢â€¢ÂÃ¢â€¢ÂÃ¢â€¢ÂÃ¢â€¢ÂÃ¢â€¢ÂÃ¢â€¢ÂÃ¢â€¢ÂÃ¢â€¢ÂÃ¢â€¢ÂÃ¢â€¢ÂÃ¢â€¢ÂÃ¢â€¢ÂÃ¢â€¢ÂÃ¢â€¢ÂÃ¢â€¢ÂÃ¢â€¢ÂÃ¢â€¢ÂÃ¢â€¢ÂÃ¢â€¢ÂÃ¢â€¢ÂÃ¢â€¢ÂÃ¢â€¢ÂÃ¢â€¢ÂÃ¢â€¢ÂÃ¢â€¢ÂÃ¢â€¢ÂÃ¢â€¢ÂÃ¢â€¢ÂÃ¢â€¢Â */

/* Typing com texto "pensando" */
.typing-text {
  display: inline-flex; gap: 4px; align-items: center;
  font-size: 14px; color: var(--soft);
  padding: 8px 0;
}
.typing-dots span {
  display: inline-block; width: 4px; height: 4px; border-radius: 50%;
  background: var(--soft);
  animation: bounce 1.1s infinite ease-in-out;
}
.typing-dots span:nth-child(1) { animation-delay: 0s; }
.typing-dots span:nth-child(2) { animation-delay: .15s; }
.typing-dots span:nth-child(3) { animation-delay: .3s; }
.composer-wrap.docked {
  border-top: 1px solid var(--border);
  background: linear-gradient(180deg, transparent, var(--bg) 30%);
  padding: 16px 24px 18px;
}
.composer-wrap.docked .composer { max-width: 760px; margin: 0 auto; }

.composer-wrap.centered {
  position: absolute; inset: 0;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  padding: 24px;
  background: transparent; pointer-events: none;
}
.composer-wrap.centered .composer { width: 100%; max-width: 720px; pointer-events: auto; }
.composer-wrap.centered .composer-foot { pointer-events: auto; }

.composer {
  background: var(--glass-composer);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border: 1px solid var(--glass-border);
  border-radius: var(--r-3);
  padding: 12px 14px 10px;
  box-shadow: var(--sh-md);
  transition: border-color .15s, box-shadow .15s, transform .2s;
}
.composer:focus-within {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--focus-ring), 0 12px 40px rgba(0, 0, 0, 0.6);
  transform: translateY(-2px);
}

.composer textarea {
  width: 100%; border: 0; outline: 0; resize: none;
  font-family: var(--font-ui); font-size: 14.5px; line-height: 1.55;
  background: transparent; color: var(--ink);
  max-height: 220px; min-height: 24px;
  padding: 4px 0;
}
.composer textarea::placeholder { color: var(--soft); }

.composer-row {
  display: flex; align-items: center; justify-content: space-between;
  margin-top: 8px; gap: 8px;
}
.composer-tools { display: flex; align-items: center; gap: 4px; flex-wrap: wrap; }
.ctool {
  width: 30px; height: 30px; border-radius: var(--r-2);
  background: transparent; border: 1px solid transparent;
  color: var(--muted);
  display: inline-flex; align-items: center; justify-content: center;
  transition: background .12s, color .12s, border-color .12s;
}
.ctool:hover { background: var(--surface); color: var(--ink); border-color: var(--border); }
.ctool-sep { width: 1px; height: 18px; background: var(--border); margin: 0 4px; }
/* Botões com label (Timbre, Formato) — auto-largura, padding lateral, sem quebra */
.ctool:has(.ctool-label) {
  width: auto;
  min-width: 30px;
  padding: 0 10px;
  gap: 6px;
  white-space: nowrap;
  border: 1px solid var(--border-2);
}
.ctool:has(.ctool-label):hover { border-color: var(--border); }
.composer-tools { gap: 6px; }

/* ── Mode Trigger Button (inline in toolbar) ── */
.mode-picker-wrap { position: relative; }
.mode-trigger { gap: 5px !important; }
.mode-trigger-label { font-weight: 500; color: var(--ink) !important; }
.mode-trigger.open { background: var(--surface) !important; border-color: var(--border) !important; color: var(--ink) !important; }

/* ── Mode Dropdown ── */
.mode-dropdown {
  position: absolute;
  bottom: calc(100% + 8px);
  left: 0;
  width: 280px;
  background: var(--bg-elev, #fff);
  border: 1px solid var(--border);
  border-radius: 14px;
  box-shadow: 0 8px 32px rgba(0,0,0,.12), 0 2px 8px rgba(0,0,0,.07);
  overflow: hidden;
  z-index: 200;
  animation: modeDropIn .16s cubic-bezier(.22,.8,.36,1) both;
}
@keyframes modeDropIn {
  from { opacity: 0; transform: translateY(6px) scale(.97); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}
.mode-dropdown-header {
  padding: 10px 14px 7px;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--muted);
  border-bottom: 1px solid var(--border);
}
.mode-opt {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 9px 14px;
  border: 0;
  background: transparent;
  text-align: left;
  cursor: pointer;
  transition: background .1s;
  border-bottom: 1px solid var(--border);
}
.mode-opt:last-child { border-bottom: 0; }
.mode-opt:hover { background: var(--surface); }
.mode-opt.active { background: var(--surface); }
.mode-opt-icon {
  width: 28px; height: 28px;
  border-radius: 8px;
  background: var(--surface-2, rgba(0,0,0,.05));
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
  color: var(--muted);
  transition: background .1s, color .1s;
}
.mode-opt.active .mode-opt-icon { background: var(--ink); color: var(--bg-elev, #fff); }
.mode-opt-body { display: flex; flex-direction: column; gap: 1px; flex: 1; min-width: 0; }
.mode-opt-label { font-size: 12.5px; font-weight: 500; color: var(--ink); line-height: 1.3; }
.mode-opt-desc { font-size: 11px; color: var(--muted); line-height: 1.3; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.btn-send {
  width: 34px; height: 34px; border-radius: 10px;
  background: var(--surface-2); color: var(--soft);
  border: 0; display: inline-flex; align-items: center; justify-content: center;
  transition: background .14s, color .14s, transform .12s;
}
.btn-send.ready { background: var(--ink); color: var(--bg-elev); }
.btn-send.ready:hover { transform: translateY(-1px) scale(1.04); }
.btn-send:disabled { cursor: not-allowed; }
.bs-dots { display: inline-flex; gap: 3px; }
.bs-dots span {
  width: 4px; height: 4px; background: currentColor; border-radius: 50%;
  animation: bounce 1s infinite ease-in-out;
}
.bs-dots span:nth-child(2) { animation-delay: .15s; }
.bs-dots span:nth-child(3) { animation-delay: .3s; }

.composer-foot {
  text-align: center; font-size: 11px; color: var(--soft);
  margin-top: 10px; font-family: var(--font-serif); font-style: italic;
}
.composer-wrap.centered .composer-foot { color: var(--muted); }

.attach-row {
  display: flex; flex-wrap: wrap; gap: 6px;
  padding-bottom: 8px; margin-bottom: 8px;
  border-bottom: 1px dashed var(--border);
}
.chip {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 3px 9px; font-size: 11.5px;
  background: var(--surface); color: var(--ink);
  border: 1px solid var(--border); border-radius: var(--r-pill);
}
.chip button {
  background: transparent; border: 0; color: var(--soft);
  display: inline-flex; align-items: center;
}
.chip button:hover { color: var(--warn); }

/* Ã¢â€¢ÂÃ¢â€¢ÂÃ¢â€¢ÂÃ¢â€¢ÂÃ¢â€¢ÂÃ¢â€¢ÂÃ¢â€¢ÂÃ¢â€¢ÂÃ¢â€¢ÂÃ¢â€¢ÂÃ¢â€¢ÂÃ¢â€¢ÂÃ¢â€¢ÂÃ¢â€¢ÂÃ¢â€¢ÂÃ¢â€¢ÂÃ¢â€¢ÂÃ¢â€¢ÂÃ¢â€¢ÂÃ¢â€¢ÂÃ¢â€¢ÂÃ¢â€¢ÂÃ¢â€¢ÂÃ¢â€¢ÂÃ¢â€¢ÂÃ¢â€¢ÂÃ¢â€¢ÂÃ¢â€¢ÂÃ¢â€¢ÂÃ¢â€¢ÂÃ¢â€¢ÂÃ¢â€¢ÂÃ¢â€¢ÂÃ¢â€¢ÂÃ¢â€¢ÂÃ¢â€¢ÂÃ¢â€¢ÂÃ¢â€¢ÂÃ¢â€¢Â
   ONBOARDING
Ã¢â€¢ÂÃ¢â€¢ÂÃ¢â€¢ÂÃ¢â€¢ÂÃ¢â€¢ÂÃ¢â€¢ÂÃ¢â€¢ÂÃ¢â€¢ÂÃ¢â€¢ÂÃ¢â€¢ÂÃ¢â€¢ÂÃ¢â€¢ÂÃ¢â€¢ÂÃ¢â€¢ÂÃ¢â€¢ÂÃ¢â€¢ÂÃ¢â€¢ÂÃ¢â€¢ÂÃ¢â€¢ÂÃ¢â€¢ÂÃ¢â€¢ÂÃ¢â€¢ÂÃ¢â€¢ÂÃ¢â€¢ÂÃ¢â€¢ÂÃ¢â€¢ÂÃ¢â€¢ÂÃ¢â€¢ÂÃ¢â€¢ÂÃ¢â€¢ÂÃ¢â€¢ÂÃ¢â€¢ÂÃ¢â€¢ÂÃ¢â€¢ÂÃ¢â€¢ÂÃ¢â€¢ÂÃ¢â€¢ÂÃ¢â€¢ÂÃ¢â€¢ÂÃ¢â€¢Â */
.ob-overlay {
  position: fixed; inset: 0;
  background: rgba(31,30,26,.4); backdrop-filter: blur(6px);
  display: flex; align-items: center; justify-content: center;
  z-index: 200; padding: 24px;
  animation: w-fade .2s ease;
}
.ob-card {
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: var(--r-4);
  width: 100%; max-width: 480px;
  display: flex; flex-direction: column;
  box-shadow: var(--sh-xl); position: relative;
  overflow: hidden;
}
.ob-close {
  position: absolute; top: 12px; right: 12px;
  width: 28px; height: 28px; border-radius: 8px;
  background: rgba(31,30,26,.04); border: 0;
  color: var(--muted); display: inline-flex;
  align-items: center; justify-content: center; z-index: 1;
}
.ob-close:hover { background: rgba(31,30,26,.08); color: var(--ink); }
.ob-art { padding: 24px 24px 0; }
.ob-svg { width: 100%; height: auto; display: block; border-radius: var(--r-2); }
.ob-body { padding: 20px 28px 16px; text-align: center; }
.ob-eyebrow {
  font-family: var(--font-mono); font-size: 10px; letter-spacing: 1.4px;
  text-transform: uppercase; color: var(--soft);
}
.ob-title { font-family: var(--font-serif); font-size: 22px; font-weight: 500; margin: 8px 0; letter-spacing: -.3px; }
.ob-text { color: var(--muted); font-size: 14px; line-height: 1.6; margin: 0; }

.ob-foot {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 24px 18px; border-top: 1px solid var(--border);
  background: var(--surface);
}
.ob-dots { display: flex; gap: 6px; }
.ob-dot {
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--border-strong); border: 0;
  transition: background .14s, transform .14s;
}
.ob-dot:hover { background: var(--muted); }
.ob-dot.active { background: var(--ink); transform: scale(1.2); }
.ob-actions { display: flex; gap: 8px; }
/* Centered welcome (Perplexity-style) extras */
.welcome.cw {
  flex: 1; display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  padding: 24px 24px 100px;
  text-align: center;
}
.cw-suggs { display: flex; gap: 8px; flex-wrap: wrap; justify-content: center; max-width: 720px; margin-top: 20px; }
.cw-pill {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 8px 14px;
  background: var(--bg-elev); border: 1px solid var(--border);
  border-radius: var(--r-pill);
  font-size: 12.5px; color: var(--ink);
  transition: border-color .14s, transform .14s, box-shadow .14s;
}
.cw-pill:hover { border-color: var(--border-strong); transform: translateY(-1px); box-shadow: var(--sh-sm); }
.cw-pill-cat {
  font-family: var(--font-mono); font-size: 9.5px; letter-spacing: 1.2px;
  text-transform: uppercase; color: var(--soft);
  padding-right: 8px; border-right: 1px solid var(--border);
}

/* When centered composer is shown, hide top spacing */
.composer-wrap.centered + .composer-wrap { display: none; }

@media (max-width: 880px) {
  .sugg-grid, .tpl-grid { grid-template-columns: 1fr; }
  .import-card { grid-template-columns: 1fr; }
  .welcome-tabs { width: 100%; overflow-x: auto; }
  .messages { padding: 16px 16px 80px; }
  .composer-wrap.docked { padding: 12px 14px 14px; }
}

/* â”€â”€ PDF Tools Panel â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€ */
.pdf-tools-overlay {
  position: fixed; inset: 0; z-index: 900;
  background: rgba(0,0,0,.45); backdrop-filter: blur(3px);
  display: flex; align-items: center; justify-content: center;
}
.pdf-tools-panel {
  background: var(--bg-elev);
  border: 1px solid var(--border-2);
  border-radius: var(--r-3);
  box-shadow: 0 24px 64px rgba(0,0,0,.36);
  width: min(560px, 96vw);
  max-height: 88vh;
  overflow: hidden;
  display: flex; flex-direction: column;
}
.pdf-tools-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 16px 10px;
  border-bottom: 1px solid var(--border);
}
.pdf-tools-title {
  display: flex; align-items: center; gap: 7px;
  font-size: 13px; font-weight: 600; color: var(--ink);
}
.pdf-tools-tabs {
  display: flex; gap: 2px; padding: 8px 12px 0;
  border-bottom: 1px solid var(--border);
}
.pdf-tab {
  display: flex; align-items: center; gap: 5px;
  padding: 6px 12px; border-radius: var(--r-2) var(--r-2) 0 0;
  font-size: 12px; font-weight: 500; color: var(--ink-2);
  background: transparent; border: none; cursor: pointer;
  transition: background .12s, color .12s;
}
.pdf-tab:hover { background: var(--bg-3); color: var(--ink); }
.pdf-tab.active { background: var(--bg-3); color: var(--accent); border-bottom: 2px solid var(--accent); }
.pdf-tools-body {
  flex: 1; overflow-y: auto;
  padding: 16px; display: flex; flex-direction: column; gap: 12px;
}
.pdf-upload-area {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 6px; padding: 24px 16px; border: 1.5px dashed var(--border-2);
  border-radius: var(--r-2); cursor: pointer; color: var(--ink-2);
  transition: border-color .14s, background .14s;
}
.pdf-upload-area:hover { border-color: var(--accent); background: var(--accent-soft); color: var(--accent); }
.pdf-upload-area small { font-size: 11px; opacity: .7; }
.pdf-prompt-input {
  width: 100%; padding: 8px 10px; font-size: 13px;
  background: var(--bg-3); border: 1px solid var(--border-2);
  border-radius: var(--r-2); color: var(--ink); resize: vertical; font-family: inherit;
}
.pdf-actions { display: flex; gap: 8px; }
.pdf-error {
  display: flex; align-items: center; gap: 6px;
  padding: 8px 12px; border-radius: var(--r-2);
  background: #fde8e8; color: #c0392b; font-size: 12.5px;
}
[data-theme="dark"] .pdf-error { background: rgba(192,57,43,.18); }
.pdf-result { display: flex; flex-direction: column; gap: 8px; }
.pdf-result-meta { font-size: 11.5px; color: var(--ink-2); padding: 4px 0; }
.pdf-result-text {
  width: 100%; min-height: 160px; max-height: 300px; overflow-y: auto;
  padding: 10px 12px; background: var(--bg-3); border: 1px solid var(--border);
  border-radius: var(--r-2); font-size: 12.5px; color: var(--ink);
  font-family: 'SF Mono', 'Fira Code', monospace; resize: vertical;
  white-space: pre-wrap; word-break: break-word;
}
.pdf-result-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.pdf-page-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 8px;
}
.pdf-page-card {
  display: flex; flex-direction: column; align-items: center; gap: 4px;
  padding: 10px 8px; border-radius: var(--r-2); background: var(--bg-3);
  border: 1px solid var(--border); font-size: 12px; color: var(--ink);
  text-align: center;
}
.pdf-page-card small { font-size: 10.5px; color: var(--ink-3); }
.pdf-page-card .btn-ghost.small { padding: 4px 8px; font-size: 11px; }

/* BotÃ£o bridge no composer */
.ctool-bridge {
  display: flex; align-items: center; gap: 4px;
  padding-inline: 8px;
  border: 1px solid var(--border-2) !important;
  border-radius: var(--r-2) !important;
}
.ctool-label { font-size: 11px; font-weight: 500; color: var(--ink-2); }

/* Modal bridge input */
.bridge-input-modal {
  background: var(--bg-elev);
  border: 1px solid var(--border-2);
  border-radius: var(--r-3);
  box-shadow: 0 16px 48px rgba(0,0,0,.28);
  padding: 20px 22px; width: min(420px, 94vw);
  display: flex; flex-direction: column; gap: 12px;
}
.bridge-input-header {
  display: flex; align-items: center; gap: 8px;
  font-size: 13px; font-weight: 600; color: var(--ink);
}
.bridge-input-header .icon-btn { margin-left: auto; }
.bridge-input-hint { font-size: 12.5px; color: var(--ink-2); line-height: 1.5; }
.bridge-input-field {
  width: 100%; padding: 9px 12px; font-size: 13.5px;
  background: var(--bg-3); border: 1.5px solid var(--border-2);
  border-radius: var(--r-2); color: var(--ink); font-family: monospace;
}
.bridge-input-field:focus { outline: none; border-color: var(--accent); }
.bridge-input-actions { display: flex; gap: 8px; justify-content: flex-end; }


/* â”€â”€ Toast notification */
.toast {
  position: fixed; bottom: 88px; left: 50%; transform: translateX(-50%);
  display: inline-flex; align-items: center; gap: 8px;
  padding: 9px 16px; border-radius: var(--r-pill);
  background: var(--ink); color: var(--bg);
  font-size: 13px; font-weight: 500; font-family: var(--font-ui);
  box-shadow: var(--sh-lg); z-index: 500; pointer-events: none;
  white-space: nowrap;
  animation: toast-in .18s ease;
}
.toast.toast-err { background: #c0392b; }
@keyframes toast-in {
  from { opacity: 0; transform: translateX(-50%) translateY(10px); }
  to   { opacity: 1; transform: translateX(-50%) translateY(0); }
}

/* â”€â”€ Conversation list â€” delete button */
.conv-item-wrap {
  position: relative; display: flex; align-items: stretch;
  border-radius: var(--r-1);
}
.conv-item-wrap .conv-item {
  flex: 1; text-align: left; border-radius: var(--r-1);
}
.conv-item-wrap.active .conv-item { background: var(--bg-elev); box-shadow: var(--sh-xs); }
.conv-del {
  position: absolute; right: 5px; top: 50%; transform: translateY(-50%);
  width: 24px; height: 24px; border-radius: var(--r-1);
  background: transparent; border: 0; color: var(--soft);
  display: none; align-items: center; justify-content: center;
  cursor: pointer; flex-shrink: 0;
}
.conv-item-wrap:hover .conv-del { display: flex; }
.conv-del:hover { background: var(--surface); color: #c0392b; }

/* â”€â”€ Scroll-to-bottom button */
.scroll-btn {
  position: fixed; bottom: 90px; right: 36px;
  width: 36px; height: 36px; border-radius: 50%;
  background: var(--bg-elev); border: 1px solid var(--border-2);
  box-shadow: var(--sh-md); color: var(--muted);
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; transition: background .12s, color .12s;
  z-index: 20;
}
.scroll-btn:hover { background: var(--ink); color: var(--bg-elev); }

/* â”€â”€ Message timestamp */
.msg-ts {
  margin-left: auto;
  font-family: var(--font-mono); font-size: 10.5px;
  color: var(--soft); letter-spacing: .2px; user-select: none;
}

/* â”€â”€ Markdown code blocks */
.md code {
  font-family: var(--font-mono); font-size: 12.5px;
  background: var(--surface); padding: 1px 5px;
  border-radius: 4px; color: var(--ink);
}
.md-pre {
  background: var(--surface); border: 1px solid var(--border-2);
  border-radius: var(--r-2); padding: 12px 14px;
  overflow-x: auto; margin: 8px 0;
  font-family: var(--font-mono); font-size: 12.5px; line-height: 1.6;
}
.md-pre code { background: transparent; padding: 0; }

.welcome-head {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  margin-bottom: 32px;
}

/* â”€â”€ Loading & Streaming Effects â”€â”€ */
.typing {
  display: flex; gap: 4px; padding: 12px 16px;
  background: var(--bg-elev); border-radius: var(--r-2);
  width: fit-content; border: 1px solid var(--border);
}
.typing span {
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--accent); opacity: 0.3;
  animation: typing-dot 1.4s infinite ease-in-out;
}
.typing span:nth-child(2) { animation-delay: 0.2s; }
.typing span:nth-child(3) { animation-delay: 0.4s; }

@keyframes typing-dot {
  0%, 100% { transform: translateY(0); opacity: 0.3; }
  50% { transform: translateY(-4px); opacity: 1; }
}

.brand-pulse {
  animation: brand-breathe 2.5s infinite ease-in-out;
}
@keyframes brand-breathe {
  0%, 100% { opacity: 1; transform: scale(1); filter: drop-shadow(0 0 5px var(--accent-soft)); }
  50% { opacity: 0.7; transform: scale(0.92); filter: drop-shadow(0 0 15px var(--accent)); }
}

.streaming-cursor {
  display: inline-block; width: 6px; height: 1.2em;
  background: var(--accent); margin-left: 2px;
  vertical-align: middle; animation: cursor-blink 0.8s step-end infinite;
}
@keyframes cursor-blink {
  from, to { opacity: 1; }
  50% { opacity: 0; }
}

.msg-avatar.loading {
  background: transparent !important;
}
.msg-avatar.loading svg {
  color: var(--accent);
  animation: avatar-spin 3s infinite linear, brand-breathe 2.5s infinite ease-in-out;
}
@keyframes avatar-spin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

/* Deep Research & Sources */
.badge-research {
  background: rgba(14, 165, 233, 0.15) !important;
  color: var(--accent) !important;
}

.sources-block {
  margin: 12px 0 20px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.sources-head {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 11px;
  font-family: var(--font-mono);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--soft);
}

.sources-grid {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding: 4px 0 8px;
  mask-image: linear-gradient(to right, black 85%, transparent 100%);
}
.sources-grid::-webkit-scrollbar { height: 4px; }

.source-card {
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: var(--r-2);
  padding: 10px 12px;
  text-decoration: none;
  transition: all 0.2s;
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 150px;
  max-width: 200px;
  flex-shrink: 0;
  box-shadow: var(--sh-xs);
}

.source-card:hover {
  background: var(--surface);
  border-color: var(--accent);
  transform: translateY(-2px);
  box-shadow: var(--sh-md);
}

.sc-top {
  display: flex;
  align-items: center; gap: 6px;
}

.sc-idx {
  width: 16px; height: 16px;
  background: var(--surface-2); color: var(--muted);
  border-radius: 50%; font-size: 9px;
  display: flex; align-items: center; justify-content: center;
  font-family: var(--font-mono);
}

.sc-domain {
  font-size: 11px; color: var(--soft);
  text-transform: lowercase; white-space: nowrap;
  overflow: hidden; text-overflow: ellipsis;
  font-family: var(--font-mono);
}

.sc-title {
  font-size: 12px; font-weight: 500;
  color: var(--ink); line-height: 1.4;
  display: -webkit-box; -webkit-line-clamp: 2;
  -webkit-box-orient: vertical; overflow: hidden;
}

.source-card.more {
  justify-content: center; align-items: center;
  border-style: dashed; min-width: 90px;
}

.cit {
  display: inline-flex; align-items: center; justify-content: center;
  width: 15px; height: 15px;
  background: var(--surface-3); color: var(--ink);
  border-radius: 50%; font-size: 9px;
  font-family: var(--font-mono); margin: 0 2px;
  vertical-align: super; cursor: pointer;
  transition: all 0.2s; font-weight: 600;
  user-select: none;
}

.cit:hover {
  background: var(--accent); color: white;
  transform: scale(1.2) translateY(-1px);
  box-shadow: 0 2px 10px var(--focus-ring);
}

/* Ambient Glow Containers */
.ambient-container {
  position: fixed; inset: 0; overflow: hidden; pointer-events: none; z-index: -1;
}
.ambient-glow {
  position: absolute; width: 60vw; height: 60vh;
  border-radius: 50%; filter: blur(120px); opacity: 0.15;
  animation: float-glow 20s infinite ease-in-out;
}
.glow-1 { top: -10%; left: -10%; background: var(--accent); }
.glow-2 { bottom: -10%; right: -10%; background: #8b5cf6; animation-delay: -5s; }

@keyframes float-glow {
  0%, 100% { transform: translate(0, 0) scale(1); }
  33% { transform: translate(5%, 10%) scale(1.1); }
  66% { transform: translate(-10%, -5%) scale(0.9); }
}

/* Glassmorphism Classes — Theme-Aware */
.glass {
  background: var(--bg-elev);
  backdrop-filter: blur(16px) saturate(180%);
  border: 1px solid var(--border);
}

.sidebar {
  background: var(--glass-bg) !important;
  backdrop-filter: blur(20px) saturate(160%) !important;
  border-right: 1px solid var(--glass-border) !important;
}

.msg-assistant .msg-bubble {
  background: var(--bg-elev) !important;
  backdrop-filter: blur(8px) !important;
  border: 1px solid var(--border) !important;
}

.composer-wrap {
  background: var(--glass-composer) !important;
  backdrop-filter: blur(12px) !important;
  border: 1px solid var(--border-2) !important;
  box-shadow: var(--sh-lg) !important;
}

/* Light mode: fix sidebar text visibility and welcome section contrast */
[data-theme="light"] .sidebar {
  background: rgba(255, 255, 255, 0.82) !important;
  border-right: 1px solid var(--border) !important;
}
[data-theme="light"] .composer-wrap {
  background: rgba(255, 255, 255, 0.92) !important;
  border: 1px solid var(--border) !important;
  box-shadow: var(--sh-md) !important;
}
[data-theme="light"] .sb-head,
[data-theme="light"] .btn-new {
  background: rgba(255, 255, 255, 0.6);
}
[data-theme="light"] .conv-item-wrap.active .conv-item {
  background: rgba(14, 165, 233, 0.08);
}
[data-theme="light"] .welcome-pane {
  color: var(--ink);
}
[data-theme="light"] .welcome-head h2 {
  color: var(--ink) !important;
  opacity: 1 !important;
}

[data-theme="light"] .ambient-glow {
  opacity: 0.04;
}


/* Advanced Animations */
@keyframes fade-in-up {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes fade-in {
  from { opacity: 0; }
  to { opacity: 1; }
}

/* Logo orbital ring rotation */
@keyframes logo-ring-spin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

/* Scrollbar Styling - Premium Mono */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border-2); border-radius: 10px; }
::-webkit-scrollbar-thumb:hover { background: var(--soft); }

/* Message Selection / Focus */
::selection { background: var(--accent); color: white; }

/* Enhanced Typography */
h1, h2, h3 { font-family: var(--font-serif); }
.eyebrow { font-family: var(--font-mono); letter-spacing: 2px; opacity: 0.6; }

/* Smooth Section Transitions */
.welcome-pane {
  animation: fade-in 0.4s ease-out;
}



/* ============================================================================
   JURIS TAB � busca de jurisprud�ncia local
   ============================================================================ */
.juris-pane { display: flex; flex-direction: column; gap: 16px; padding-bottom: 40px; }

.juris-header {
  display: flex; align-items: center; justify-content: space-between;
  background: linear-gradient(135deg, rgba(14,165,233,.08) 0%, rgba(99,102,241,.06) 100%);
  border: 1px solid rgba(14,165,233,.2);
  border-radius: var(--r-3); padding: 16px 20px; gap: 12px;
}
.juris-header-left { display: flex; align-items: center; gap: 14px; }
.juris-header-icon {
  width: 44px; height: 44px; border-radius: var(--r-2); flex-shrink: 0;
  background: linear-gradient(135deg, #0ea5e9 0%, #6366f1 100%);
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 4px 16px rgba(14,165,233,.35);
}
.juris-title { font-size: 15px; font-weight: 700; color: var(--ink); }
.juris-sub { font-size: 12px; color: var(--muted); margin-top: 2px; }
.juris-badge {
  display: flex; align-items: center; gap: 7px; padding: 5px 12px;
  border-radius: var(--r-pill); background: rgba(16,185,129,.1);
  border: 1px solid rgba(16,185,129,.25); font-size: 12px; color: #10b981; white-space: nowrap;
}
.juris-badge-dot {
  width: 7px; height: 7px; border-radius: 50%;
  background: #10b981; box-shadow: 0 0 6px #10b981;
  animation: pulse-dot 2s infinite;
}
@keyframes pulse-dot {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: .7; transform: scale(1.25); }
}

.juris-search-row { display: flex; gap: 10px; align-items: center; }
.juris-search-wrap { position: relative; flex: 1; }
.juris-search-input {
  width: 100%; padding: 11px 14px 11px 40px;
  background: var(--bg-elev); border: 1.5px solid var(--border-2);
  border-radius: var(--r-2); font-family: var(--font-ui); font-size: 14px;
  color: var(--ink); outline: none; box-sizing: border-box; transition: border-color .15s;
}
.juris-search-input:focus { border-color: var(--blue); box-shadow: 0 0 0 3px rgba(14,165,233,.15); }
.juris-search-input::placeholder { color: var(--muted); }
.juris-search-btn { display: flex; align-items: center; gap: 7px; padding: 11px 20px; white-space: nowrap; flex-shrink: 0; }
.juris-spinner {
  width: 13px; height: 13px; border: 2px solid rgba(255,255,255,.35);
  border-top-color: #fff; border-radius: 50%; animation: spin .7s linear infinite;
}

.juris-filters {
  display: flex; flex-wrap: wrap; gap: 16px; align-items: flex-start;
  padding: 14px 16px; background: var(--bg-elev);
  border: 1px solid var(--border); border-radius: var(--r-2);
}
.juris-filter-group { display: flex; flex-direction: column; gap: 7px; }
.juris-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.juris-chip {
  padding: 4px 11px; border-radius: var(--r-pill);
  border: 1.5px solid var(--border-2); background: transparent;
  font-size: 12px; color: var(--ink-2); cursor: pointer; transition: all .15s;
  font-family: var(--font-ui);
}
.juris-chip:hover { border-color: var(--blue); color: var(--blue); background: var(--blue-light); }
.juris-chip.active { border-color: transparent; }
.juris-select {
  padding: 6px 10px; border: 1.5px solid var(--border-2);
  border-radius: var(--r-2); background: var(--bg-elev);
  color: var(--ink); font-family: var(--font-ui); font-size: 12.5px; cursor: pointer;
}
.juris-select:focus { outline: none; border-color: var(--blue); }

.juris-error {
  display: flex; align-items: center; gap: 8px; padding: 12px 16px;
  background: rgba(239,68,68,.1); border: 1px solid rgba(239,68,68,.3);
  border-radius: var(--r-2); color: #f87171; font-size: 13px;
}

.juris-empty {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  padding: 56px 24px; gap: 4px;
}

.juris-results { display: flex; flex-direction: column; gap: 0; }
.juris-results-header {
  padding: 10px 4px; border-bottom: 1px solid var(--border);
  margin-bottom: 8px;
}

.juris-card {
  border: 1px solid var(--border); border-radius: var(--r-2);
  background: var(--bg-elev); margin-bottom: 8px; overflow: hidden;
  transition: border-color .15s, box-shadow .15s;
}
.juris-card:hover { border-color: var(--border-2); box-shadow: 0 2px 12px rgba(0,0,0,.1); }
.juris-card.open { border-color: var(--blue); box-shadow: 0 0 0 3px rgba(14,165,233,.1); }

.juris-card-head {
  display: flex; gap: 12px; align-items: flex-start;
  padding: 14px 16px; cursor: pointer; user-select: none;
}
.juris-card-badges { display: flex; flex-direction: column; gap: 5px; flex-shrink: 0; padding-top: 2px; }
.juris-trib-badge {
  display: inline-flex; align-items: center; justify-content: center;
  padding: 3px 8px; border-radius: var(--r-pill);
  font-size: 10px; font-weight: 700; letter-spacing: .04em; color: #fff;
  font-family: var(--font-mono);
}
.juris-tipo-badge {
  padding: 2px 7px; border-radius: var(--r-pill); background: var(--border);
  font-size: 10px; color: var(--muted); font-family: var(--font-mono);
  white-space: nowrap; text-align: center;
}
.juris-card-main { flex: 1; min-width: 0; }
.juris-card-processo { font-size: 14px; font-weight: 600; color: var(--ink); margin-bottom: 5px; }
.juris-card-meta {
  display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 8px;
  font-size: 12px; color: var(--muted);
}
.juris-card-meta span { display: flex; align-items: center; gap: 4px; }
.juris-ramo {
  padding: 1px 7px; border-radius: var(--r-pill);
  background: rgba(14,165,233,.1); color: var(--blue-muted) !important; font-size: 11px;
}
.juris-card-snippet { font-size: 13px; color: var(--ink-2); line-height: 1.65; }

.juris-card-actions {
  display: flex; gap: 8px; flex-wrap: wrap;
  padding: 12px 16px; border-top: 1px solid var(--border);
  background: rgba(255,255,255,.02);
}
.juris-action-btn {
  display: inline-flex; align-items: center; gap: 6px; padding: 7px 13px;
  border-radius: var(--r-2); border: 1.5px solid var(--border-2);
  background: transparent; color: var(--ink-2); font-size: 12.5px;
  font-family: var(--font-ui); cursor: pointer; transition: all .15s;
  text-decoration: none;
}
.juris-action-btn:hover { border-color: var(--blue); color: var(--blue); background: var(--blue-light); }
.juris-action-btn.accent {
  border-color: rgba(139,92,246,.4); color: #a78bfa; background: rgba(139,92,246,.08);
}
.juris-action-btn.accent:hover { border-color: #8b5cf6; background: rgba(139,92,246,.15); }

/* Light-mode overrides */
[data-theme="light"] .juris-header { background: linear-gradient(135deg,rgba(14,165,233,.06) 0%,rgba(99,102,241,.04) 100%); }
[data-theme="light"] .juris-card { background: #fff; }
[data-theme="light"] .juris-card-actions { background: rgba(0,0,0,.015); }
[data-theme="light"] .juris-badge { background: rgba(16,185,129,.08); }
[data-theme="light"] .juris-action-btn.accent { background: rgba(139,92,246,.05); }

/* ════════════════════════════════════════════════════════════════════════════
   CANVAS — side-by-side editing panel (ChatGPT Canvas style)
   ════════════════════════════════════════════════════════════════════════════ */

/* Workspace wraps messages + canvas side-by-side */
.workspace {
  display: flex;
  min-height: 0;
  flex: 1;
  overflow: hidden;
}
.workspace .messages {
  flex: 1;
  min-width: 0;
  overflow-y: auto;
  padding: 32px 24px 80px;
  scroll-behavior: smooth;
}
.workspace.has-canvas .messages {
  flex: 0 0 42%;
  max-width: 42%;
  border-right: 1px solid var(--border);
}

/* Canvas panel */
.canvas-panel {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
  background: var(--bg-elev);
  border-left: 1px solid var(--border);
}

.canvas-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  padding: 10px 16px;
  border-bottom: 1px solid var(--border);
  background: var(--surface);
  gap: 8px;
  flex-shrink: 0;
}
.canvas-formatbar {
  display: flex;
  align-items: flex-start;
  flex-wrap: wrap;
  gap: 8px;
  padding: 8px 16px;
  border-bottom: 1px solid var(--border);
  background: color-mix(in srgb, var(--surface) 86%, var(--bg));
  overflow-x: visible;
  flex-shrink: 0;
}
.canvas-formatbar-group {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
  min-width: 0;
}
.canvas-formatbar-ai {
  flex: 1 1 520px;
}
.ctool-icon {
  min-width: 30px;
  width: 30px;
  height: 28px;
  padding: 0;
  font-weight: 800;
  justify-content: center;
}
.ai-edit {
  border-color: color-mix(in srgb, var(--accent) 32%, var(--border-2));
  color: var(--accent) !important;
  background: color-mix(in srgb, var(--accent) 7%, transparent);
}
.ai-edit:hover {
  background: color-mix(in srgb, var(--accent) 13%, transparent) !important;
}
.canvas-toolbar-left {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}
.canvas-toolbar-right {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 10px;
  flex-shrink: 0;
}
.canvas-panel .ctool {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  width: auto;
  height: auto;
  min-width: 28px;
  flex: 0 0 auto;
  min-height: 28px;
  border: 1px solid transparent;
  border-radius: 7px;
  background: transparent;
  color: var(--muted);
  padding: 5px 8px;
  font-size: 12px;
  font-weight: 550;
  white-space: nowrap;
  overflow: visible;
  transition: background .14s, color .14s, border-color .14s;
}
.canvas-panel .ctool:hover {
  background: var(--bg-elev);
  color: var(--ink);
  border-color: var(--border-2);
}
/* Garante que botões de texto da formatbar nunca fiquem comprimidos (alta especificidade) */
.canvas-panel .canvas-formatbar .ctool {
  width: auto !important;
  height: 28px !important;
  min-width: 0 !important;
  padding: 4px 10px !important;
  white-space: nowrap !important;
  overflow: visible !important;
  display: inline-flex !important;
  align-items: center !important;
  flex: 0 0 auto !important;
}
.canvas-panel .canvas-formatbar .ctool.ctool-icon {
  width: 28px !important;
  padding: 0 !important;
  justify-content: center !important;
}
.canvas-panel .ctool-sep {
  width: 1px;
  height: 20px;
  background: var(--border-2);
  flex: 0 0 1px;
}
.canvas-formatbar .ctool-sep {
  align-self: stretch;
  min-height: 28px;
}
.canvas-title {
  font-size: 13.5px;
  font-weight: 600;
  color: var(--ink);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 260px;
}
.canvas-badge {
  font-size: 10.5px;
  color: var(--soft);
  font-family: var(--font-mono);
  background: var(--bg);
  padding: 2px 8px;
  border-radius: var(--r-pill);
}

.canvas-editor {
  flex: 1;
  width: 100%;
  border: none;
  outline: none;
  resize: none;
  padding: 24px 28px;
  font-family: var(--font-serif);
  font-size: 14.5px;
  line-height: 1.8;
  color: var(--ink-2);
  background: var(--bg-elev);
  tab-size: 2;
}
.canvas-editor::placeholder {
  color: var(--soft);
}
.canvas-editor:focus {
  background: var(--bg);
}
.canvas-editor-raw {
  font-family: var(--font-mono);
  font-size: 13px;
  line-height: 1.6;
}
.canvas-editor-rendered {
  overflow-y: auto;
  cursor: default;
  user-select: text;
}
.canvas-editor-rendered h3 {
  font-size: 16px;
  font-weight: 700;
  color: var(--ink);
  margin: 20px 0 10px;
  line-height: 1.4;
}
.canvas-editor-rendered h4 {
  font-size: 15px;
  font-weight: 600;
  color: var(--ink);
  margin: 16px 0 8px;
}
.canvas-editor-rendered h5 {
  font-size: 14px;
  font-weight: 600;
  color: var(--ink-2);
  margin: 12px 0 6px;
}
.canvas-editor-rendered p {
  margin: 0 0 8px;
  text-indent: 1.5cm;
}
.canvas-editor-rendered p:first-child {
  text-indent: 0;
}
.canvas-editor-rendered p.cv-center {
  text-indent: 0;
  text-align: center;
}
.canvas-editor-rendered p.cv-right {
  text-indent: 0;
  text-align: right;
}
.canvas-editor-rendered strong {
  font-weight: 700;
  color: var(--ink);
}
.canvas-editor-rendered em {
  font-style: italic;
}
.canvas-editor-rendered ul, .canvas-editor-rendered ol {
  margin: 8px 0;
  padding-left: 24px;
}
.canvas-editor-rendered li {
  margin-bottom: 4px;
}
.canvas-editor-rendered hr {
  border: none;
  border-top: 1px solid var(--border);
  margin: 16px 0;
}
.canvas-editor-rendered .cv-pre {
  background: var(--surface);
  padding: 12px 16px;
  border-radius: var(--r-1);
  font-family: var(--font-mono);
  font-size: 12.5px;
  overflow-x: auto;
  margin: 8px 0;
}

/* Canvas open button in message actions */
.canvas-open-btn {
  color: var(--blue) !important;
}
.canvas-open-btn:hover {
  background: var(--blue-light) !important;
}
.canvas-dl-btn {
  color: var(--success) !important;
}
.canvas-dl-btn:hover {
  background: rgba(16,185,129,.12) !important;
}
.canvas-dl-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* Light mode canvas */
[data-theme="light"] .canvas-panel {
  background: #fff;
  border-left-color: var(--border-2);
}
[data-theme="light"] .canvas-toolbar {
  background: #f9fafb;
}
[data-theme="light"] .canvas-badge {
  background: #f3f4f6;
}
[data-theme="light"] .canvas-editor {
  background: #fff;
}
[data-theme="light"] .canvas-editor:focus {
  background: #fafafa;
}
[data-theme="light"] .canvas-editor-rendered h3,
[data-theme="light"] .canvas-editor-rendered h4 {
  color: var(--ink);
}
[data-theme="light"] .canvas-editor-rendered .cv-pre {
  background: #f3f4f6;
}

/* Responsive: stack on narrow screens */
@media (max-width: 860px) {
  .workspace.has-canvas {
    flex-direction: column;
  }
  .workspace.has-canvas .messages {
    flex: 0 0 40%;
    max-width: 100%;
    border-right: none;
    border-bottom: 1px solid var(--border);
  }
  .canvas-panel {
    border-left: none;
    border-top: 1px solid var(--border);
  }
  .canvas-toolbar-right {
    width: 100%;
    justify-content: flex-start;
  }
  .canvas-formatbar {
    padding-top: 10px;
    padding-bottom: 10px;
  }
  .canvas-formatbar-ai {
    flex-basis: 100%;
  }
}
