/* =====================================================
   ASSISTENTE INSIGHT 360 — v4
   ===================================================== */

@import url('https://fonts.googleapis.com/css2?family=Syne:wght@500;600;700;800&family=DM+Sans:opsz,wght@9..40,400;9..40,500;9..40,600;9..40,700&family=JetBrains+Mono:wght@400;500&display=swap');

:root {
  --bg-deep:        #08040f;
  --bg-deep-2:      #0d0717;
  --bg-surface:     #14091f;
  --bg-elevated:    #1d0f2c;
  --bg-glass:       rgba(255, 255, 255, 0.025);
  --bg-glass-hover: rgba(255, 255, 255, 0.05);
  --bg-glass-strong:rgba(255, 255, 255, 0.07);

  --border:         rgba(255, 255, 255, 0.07);
  --border-strong:  rgba(255, 255, 255, 0.14);
  --border-brand:   rgba(255, 75, 125, 0.32);

  --text-1:         #f7f3ff;
  --text-2:         rgba(247, 243, 255, 0.74);
  --text-3:         rgba(247, 243, 255, 0.48);
  --text-4:         rgba(247, 243, 255, 0.26);

  --orange:         #ff6a3d;
  --pink:           #ff4b7d;
  --magenta:        #d946a0;

  --grad:           linear-gradient(135deg, #ff6a3d 0%, #ff4b7d 50%, #d946a0 100%);
  --grad-soft:      linear-gradient(135deg, rgba(255,106,61,.16) 0%, rgba(255,75,125,.16) 50%, rgba(217,70,160,.16) 100%);
  --grad-text:      linear-gradient(180deg, #fff 0%, rgba(255,255,255,.6) 100%);

  --shadow-glow:    0 0 80px rgba(255,75,125,.18);
  --easing:         cubic-bezier(0.4, 0, 0.2, 1);
  --easing-spring:  cubic-bezier(0.34, 1.56, 0.64, 1);
  --easing-soft:    cubic-bezier(0.22, 1, 0.36, 1);

  --radius-sm:      8px;
  --radius:         14px;
  --radius-lg:      20px;
  --radius-xl:      28px;
}

[data-theme="light"] {
  --bg-deep:        #fbf8ff;
  --bg-deep-2:      #f5f0ff;
  --bg-surface:     #ffffff;
  --bg-glass:       rgba(10, 6, 20, 0.025);
  --bg-glass-hover: rgba(10, 6, 20, 0.045);
  --bg-glass-strong:rgba(10, 6, 20, 0.07);
  --border:         rgba(10, 6, 20, 0.08);
  --border-strong:  rgba(10, 6, 20, 0.14);
  --text-1:         #14091f;
  --text-2:         rgba(20, 9, 31, 0.7);
  --text-3:         rgba(20, 9, 31, 0.5);
  --text-4:         rgba(20, 9, 31, 0.28);
  --grad-text:      linear-gradient(180deg, #14091f 0%, rgba(20,9,31,.6) 100%);
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: 'DM Sans', system-ui, sans-serif;
  font-size: 15px;
  line-height: 1.55;
  color: var(--text-1);
  background: var(--bg-deep);
  min-height: 100dvh;
  overflow: hidden;
  -webkit-font-smoothing: antialiased;
}

/* ======== ATMOSPHERE ======== */
/* Layer 1: orbs grandes flutuantes (BEM visíveis agora) */
.bg-orbs {
  position: fixed; inset: 0; z-index: 0;
  overflow: hidden;
  pointer-events: none;
}

.orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(90px);
  will-change: transform;
}

.orb--1 {
  width: 600px; height: 600px;
  background: radial-gradient(circle, var(--orange) 0%, transparent 65%);
  top: -200px; left: -160px;
  opacity: 0.7;
  animation: orb-drift-1 18s ease-in-out infinite alternate;
}

.orb--2 {
  width: 540px; height: 540px;
  background: radial-gradient(circle, var(--magenta) 0%, transparent 65%);
  bottom: -180px; right: -140px;
  opacity: 0.65;
  animation: orb-drift-2 22s ease-in-out infinite alternate;
}

.orb--3 {
  width: 420px; height: 420px;
  background: radial-gradient(circle, var(--pink) 0%, transparent 65%);
  top: 30%; left: 55%;
  opacity: 0.4;
  animation: orb-drift-3 25s ease-in-out infinite alternate;
}

.orb--4 {
  width: 360px; height: 360px;
  background: radial-gradient(circle, var(--orange) 0%, transparent 70%);
  bottom: 25%; left: 12%;
  opacity: 0.35;
  animation: orb-drift-4 20s ease-in-out infinite alternate;
}

@keyframes orb-drift-1 {
  0%   { transform: translate(0, 0) scale(1); }
  100% { transform: translate(80px, 100px) scale(1.15); }
}

@keyframes orb-drift-2 {
  0%   { transform: translate(0, 0) scale(1); }
  100% { transform: translate(-100px, -80px) scale(1.1); }
}

@keyframes orb-drift-3 {
  0%   { transform: translate(0, 0) scale(0.9); }
  100% { transform: translate(-120px, 60px) scale(1.2); }
}

@keyframes orb-drift-4 {
  0%   { transform: translate(0, 0) scale(1); }
  100% { transform: translate(60px, -90px) scale(1.1); }
}

/* Layer 2: canvas particles (puro, sem dependência) */
#particles {
  position: fixed; inset: 0; z-index: 0;
  width: 100%; height: 100%;
  pointer-events: none;
}

/* Layer 3: grain noise */
.bg-grain {
  position: fixed; inset: 0; z-index: 0;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='200' height='200'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='2'/%3E%3CfeColorMatrix values='0 0 0 0 1, 0 0 0 0 1, 0 0 0 0 1, 0 0 0 .12 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  opacity: 0.4;
  pointer-events: none;
  mix-blend-mode: overlay;
}

[data-theme="light"] .orb { opacity: 0.25 !important; }
[data-theme="light"] .bg-grain { opacity: 0.2; }

@media (prefers-reduced-motion: reduce) {
  .orb { animation: none; }
}

/* ======== LOGO ======== */
.i360-rotate {
  transform-origin: center center;
  animation: i360-spin 22s linear infinite;
}

@keyframes i360-spin {
  from { transform: rotate(0deg); }
  to   { transform: rotate(360deg); }
}

@media (prefers-reduced-motion: reduce) {
  .i360-rotate { animation: none; }
}

.welcome__logo,
.sidebar__logo {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
}

/* ======== APP ======== */
.app {
  position: relative; z-index: 1;
  display: grid;
  grid-template-columns: 280px 1fr;
  height: 100dvh;
}

/* Sidebar */
.sidebar {
  display: flex; flex-direction: column;
  background: linear-gradient(180deg, var(--bg-glass) 0%, transparent 100%), rgba(0,0,0,0.18);
  backdrop-filter: blur(28px);
  -webkit-backdrop-filter: blur(28px);
  border-right: 1px solid var(--border);
  padding: 18px 14px;
}

.sidebar__brand {
  display: flex; align-items: center; gap: 12px;
  padding: 4px 8px 18px;
  margin-bottom: 6px;
  border-bottom: 1px solid var(--border);
}

.sidebar__logo {
  width: 36px; height: 36px;
  flex-shrink: 0;
  filter: drop-shadow(0 4px 12px rgba(255,75,125,.4));
  display: block;
}

.sidebar__title {
  font-family: 'Syne', sans-serif;
  font-weight: 700;
  font-size: 18px;
  letter-spacing: -0.02em;
  background: var(--grad);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  line-height: 1;
  margin-bottom: 3px;
}

.sidebar__subtitle {
  font-family: 'JetBrains Mono', monospace;
  font-size: 9px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--text-3);
}

.btn-new {
  display: flex; align-items: center; justify-content: center; gap: 8px;
  width: 100%;
  padding: 11px 14px;
  background: var(--grad);
  color: #fff;
  border: 0;
  border-radius: var(--radius);
  font-family: inherit;
  font-weight: 600;
  font-size: 14px;
  cursor: pointer;
  transition: transform 0.2s var(--easing-spring), box-shadow 0.3s;
  box-shadow: 0 4px 14px rgba(255, 75, 125, 0.28);
  position: relative; overflow: hidden;
}

.btn-new::after {
  content: '';
  position: absolute; inset: 0;
  background: linear-gradient(120deg, transparent 30%, rgba(255,255,255,.18) 50%, transparent 70%);
  transform: translateX(-100%);
  transition: transform 0.6s var(--easing);
}

.btn-new:hover { transform: translateY(-1px); box-shadow: 0 10px 28px rgba(255, 75, 125, 0.4); }
.btn-new:hover::after { transform: translateX(100%); }
.btn-new:active { transform: translateY(0); }

.sidebar__history-label {
  font-family: 'JetBrains Mono', monospace;
  font-size: 10px;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--text-3);
  padding: 18px 8px 8px;
}

.history {
  flex: 1; overflow-y: auto;
  margin: 0 -8px; padding: 0 8px;
  scrollbar-width: thin;
  scrollbar-color: var(--border-strong) transparent;
}
.history::-webkit-scrollbar { width: 4px; }
.history::-webkit-scrollbar-thumb { background: var(--border-strong); border-radius: 2px; }

.history__item {
  display: flex; align-items: center; gap: 8px;
  padding: 9px 10px;
  border-radius: 10px;
  font-size: 13px;
  color: var(--text-2);
  cursor: pointer;
  transition: all 0.15s var(--easing);
  position: relative; overflow: hidden;
}

.history__item:hover { background: var(--bg-glass-hover); color: var(--text-1); }

.history__item.is-active {
  background: var(--grad-soft);
  color: var(--text-1);
  border: 1px solid var(--border-brand);
}

.history__item.is-active::before {
  content: '';
  position: absolute; left: 0; top: 4px; bottom: 4px;
  width: 3px;
  background: var(--grad);
  border-radius: 0 2px 2px 0;
}

.history__title {
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.history__delete {
  background: none; border: 0;
  color: var(--text-4);
  cursor: pointer;
  font-size: 16px; line-height: 1;
  padding: 2px 4px;
  border-radius: 4px;
  opacity: 0;
  transition: all 0.15s;
  flex-shrink: 0;
}

.history__item:hover .history__delete { opacity: 1; }
.history__delete:hover { color: var(--pink); background: var(--bg-glass-hover); }

.history__empty {
  font-size: 12px;
  color: var(--text-4);
  font-style: italic;
  padding: 12px 10px;
  text-align: center;
}

.sidebar__footer {
  display: flex; align-items: center; gap: 8px;
  padding-top: 12px;
  margin-top: 12px;
  border-top: 1px solid var(--border);
}

.icon-btn {
  width: 38px; height: 38px;
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--bg-glass);
  border: 1px solid var(--border);
  border-radius: 10px;
  color: var(--text-2);
  cursor: pointer;
  transition: all 0.2s var(--easing);
  flex-shrink: 0;
}

.icon-btn:hover {
  background: var(--bg-glass-hover);
  color: var(--text-1);
  border-color: var(--border-strong);
}

.icon-btn:disabled { opacity: 0.4; cursor: not-allowed; }
.icon-btn:disabled:hover { background: var(--bg-glass); color: var(--text-2); border-color: var(--border); }
.icon-btn svg { width: 16px; height: 16px; }

.user-pill {
  margin-left: auto;
  display: flex; align-items: center; gap: 8px;
  padding: 6px 12px 6px 6px;
  background: var(--bg-glass);
  border: 1px solid var(--border);
  border-radius: 999px;
  font-size: 12px;
  color: var(--text-2);
  font-weight: 500;
}

.user-avatar {
  width: 26px; height: 26px;
  border-radius: 50%;
  background: var(--grad);
  display: flex; align-items: center; justify-content: center;
  color: #fff;
  font-weight: 700;
  font-size: 11px;
  letter-spacing: 0.5px;
}

/* Chat */
.chat {
  display: flex; flex-direction: column;
  overflow: hidden;
  position: relative;
}

.chat__header {
  display: flex; align-items: center; gap: 12px;
  padding: 16px 32px;
  border-bottom: 1px solid var(--border);
  background: linear-gradient(to bottom, var(--bg-glass) 0%, transparent 100%);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

.chat__title {
  font-family: 'Syne', sans-serif;
  font-weight: 600;
  font-size: 15px;
  letter-spacing: -0.005em;
  color: var(--text-1);
  flex: 1;
  text-overflow: ellipsis;
  white-space: nowrap;
  overflow: hidden;
}

.chat__title-mute { color: var(--text-3); font-weight: 500; font-style: italic; }

.chat__messages {
  flex: 1; overflow-y: auto;
  padding: 28px 0 8px;
  scrollbar-width: thin;
  scrollbar-color: var(--border-strong) transparent;
}
.chat__messages::-webkit-scrollbar { width: 6px; }
.chat__messages::-webkit-scrollbar-thumb { background: var(--border-strong); border-radius: 3px; }

/* Welcome */
.welcome {
  max-width: 760px;
  margin: 3vh auto 0;
  padding: 32px 32px 16px;
  text-align: center;
}

.welcome__logo-wrap {
  position: relative;
  width: 110px; height: 110px;
  margin: 0 auto 28px;
  filter: drop-shadow(0 12px 40px rgba(255, 75, 125, 0.5));
  animation: welcome-float 6s ease-in-out infinite;
}

.welcome__logo-wrap svg {
  display: block;
  width: 100%; height: 100%;
}

.welcome__logo-wrap::before {
  content: '';
  position: absolute; inset: -30%;
  background: var(--grad);
  border-radius: 50%;
  filter: blur(45px);
  opacity: 0.35;
  z-index: -1;
  animation: welcome-pulse 4s ease-in-out infinite;
}

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

@keyframes welcome-pulse {
  0%, 100% { opacity: 0.25; transform: scale(0.92); }
  50%      { opacity: 0.5;  transform: scale(1.12); }
}

.welcome__title {
  font-family: 'Syne', sans-serif;
  font-weight: 800;
  font-size: clamp(42px, 6.5vw, 64px);
  letter-spacing: -0.045em;
  line-height: 0.95;
  margin-bottom: 18px;
  background: var(--grad-text);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  opacity: 0;
  animation: title-in 0.9s 0.1s var(--easing-soft) forwards;
}

.welcome__title em {
  font-style: normal;
  background: var(--grad);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

@keyframes title-in {
  from { opacity: 0; transform: translateY(20px); filter: blur(8px); }
  to   { opacity: 1; transform: translateY(0); filter: blur(0); }
}

.welcome__lede {
  font-size: 17px;
  color: var(--text-2);
  max-width: 540px;
  margin: 0 auto 44px;
  line-height: 1.5;
  opacity: 0;
  animation: title-in 0.9s 0.25s var(--easing-soft) forwards;
}

.templates {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
  max-width: 540px;
  margin: 0 auto;
  opacity: 0;
  animation: title-in 0.9s 0.4s var(--easing-soft) forwards;
}

.template {
  position: relative;
  display: flex; flex-direction: column; align-items: flex-start;
  text-align: left;
  padding: 14px 16px;
  background: var(--bg-glass);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  cursor: pointer;
  transition: all 0.25s var(--easing);
  overflow: hidden;
  font-family: inherit;
  color: var(--text-1);
}

.template::before {
  content: '';
  position: absolute; inset: 0;
  background: var(--grad-soft);
  opacity: 0;
  transition: opacity 0.25s var(--easing);
  pointer-events: none;
}

.template::after {
  content: '';
  position: absolute; top: 0; left: 0; right: 0;
  height: 1px;
  background: var(--grad);
  opacity: 0;
  transition: opacity 0.25s var(--easing);
}

.template:hover {
  border-color: var(--border-strong);
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(0,0,0,.2);
}
.template:hover::before { opacity: 1; }
.template:hover::after { opacity: 1; }

.template__icon { font-size: 22px; margin-bottom: 6px; position: relative; }
.template__title {
  font-family: 'Syne', sans-serif;
  font-weight: 600;
  font-size: 14px;
  margin-bottom: 2px;
  position: relative;
}
.template__desc { font-size: 12px; color: var(--text-3); position: relative; }

/* Messages */
.msg {
  max-width: 760px;
  margin: 0 auto;
  padding: 16px 32px;
  display: flex; flex-direction: column; gap: 6px;
  animation: msg-in 0.4s var(--easing-soft);
}

@keyframes msg-in {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}

.msg__role {
  font-family: 'JetBrains Mono', monospace;
  font-size: 10px;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--text-3);
  display: flex; align-items: center; gap: 8px;
  font-weight: 500;
}

.msg__role-dot {
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--text-2);
}

.msg--assistant .msg__role-dot {
  background: var(--grad);
  box-shadow: 0 0 12px rgba(255, 75, 125, 0.5);
}

.msg__body {
  font-size: 16px;
  line-height: 1.6;
  color: var(--text-1);
  word-wrap: break-word;
}

.msg--user .msg__body {
  background: var(--bg-glass);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 18px;
}

.msg__attachments {
  display: flex; flex-wrap: wrap; gap: 8px;
  margin-bottom: 8px;
}

.msg__attachment {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 8px 12px;
  background: var(--bg-glass-strong);
  border: 1px solid var(--border-strong);
  border-radius: 12px;
  font-size: 12px;
  color: var(--text-2);
}

.msg__attachment.is-image {
  padding: 0;
  background: transparent;
  border: 1px solid var(--border);
  overflow: hidden;
}

.msg__attachment img {
  max-width: 280px;
  max-height: 200px;
  display: block;
  border-radius: 11px;
}

.msg__attachment-icon {
  width: 22px; height: 22px;
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--grad-soft);
  border-radius: 6px;
  color: var(--pink);
  flex-shrink: 0;
}

.msg__attachment-icon svg { width: 12px; height: 12px; }

.msg__body p { margin-bottom: 10px; }
.msg__body p:last-child { margin-bottom: 0; }
.msg__body strong { font-weight: 700; color: var(--text-1); }
.msg__body em { font-style: italic; }
.msg__body h1, .msg__body h2, .msg__body h3 {
  font-family: 'Syne', sans-serif;
  letter-spacing: -0.01em;
  margin: 16px 0 10px;
  font-weight: 700;
}
.msg__body h2 { font-size: 22px; }
.msg__body h3 { font-size: 18px; font-weight: 600; }
.msg__body ul, .msg__body ol { padding-left: 22px; margin-bottom: 10px; }
.msg__body li { margin-bottom: 4px; }
.msg__body code {
  background: var(--bg-glass-hover);
  padding: 2px 6px;
  border-radius: 4px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 13px;
}
.msg__body pre {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 14px 16px;
  overflow-x: auto;
  margin-bottom: 10px;
}
.msg__body pre code { background: transparent; padding: 0; }
.msg__body hr { border: 0; border-top: 1px solid var(--border); margin: 14px 0; }
.msg__body blockquote {
  border-left: 3px solid var(--pink);
  padding: 4px 0 4px 14px;
  color: var(--text-2);
  margin-bottom: 10px;
  font-style: italic;
}

.msg__actions {
  display: flex; gap: 8px;
  margin-top: 8px;
  opacity: 0;
  transition: opacity 0.2s;
}

.msg:hover .msg__actions { opacity: 1; }

.msg__action {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 4px 10px;
  font-size: 11px;
  font-family: inherit;
  font-weight: 500;
  background: var(--bg-glass);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text-3);
  cursor: pointer;
  transition: all 0.15s;
}

.msg__action:hover {
  background: var(--bg-glass-hover);
  color: var(--text-1);
  border-color: var(--border-strong);
}

.msg__action svg { width: 12px; height: 12px; }

.is-streaming::after {
  content: '▋';
  display: inline-block;
  margin-left: 2px;
  background: var(--grad);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  animation: cursor-blink 1s steps(2) infinite;
}

@keyframes cursor-blink {
  0%, 50% { opacity: 1; }
  51%, 100% { opacity: 0; }
}

/* Status */
.status-bar {
  max-width: 760px;
  margin: 0 auto;
  padding: 0 32px;
  min-height: 28px;
}

.status-pill {
  display: inline-flex; align-items: center; gap: 10px;
  padding: 6px 14px 6px 10px;
  background: var(--bg-glass);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--border-brand);
  border-radius: 999px;
  font-size: 12px;
  font-family: 'JetBrains Mono', monospace;
  color: var(--text-2);
  animation: msg-in 0.3s var(--easing);
}

.status-spinner {
  width: 11px; height: 11px;
  border: 1.5px solid var(--border-strong);
  border-top-color: var(--pink);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}

@keyframes spin { to { transform: rotate(360deg); } }

/* Composer */
.composer-wrap {
  padding: 0 32px 22px;
  background: linear-gradient(to top, var(--bg-deep) 60%, transparent);
}

.composer {
  max-width: 760px;
  margin: 0 auto;
  background: var(--bg-glass-strong);
  backdrop-filter: blur(28px);
  -webkit-backdrop-filter: blur(28px);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  transition: border-color 0.2s, box-shadow 0.2s;
  overflow: hidden;
  position: relative;
}

.composer:focus-within {
  border-color: var(--border-brand);
  box-shadow: 0 0 0 4px rgba(255, 75, 125, 0.06), var(--shadow-glow);
}

.composer__attachments {
  padding: 12px 14px 0;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.composer__attachments:empty { display: none; }

.composer__attach {
  position: relative;
  display: flex; align-items: center; gap: 8px;
  padding: 5px 30px 5px 6px;
  background: var(--bg-glass);
  border: 1px solid var(--border);
  border-radius: 10px;
  font-size: 12px;
  color: var(--text-2);
  max-width: 100%;
}

.composer__attach img {
  width: 36px; height: 36px;
  object-fit: cover;
  border-radius: 6px;
  flex-shrink: 0;
}

.composer__attach-thumb {
  width: 36px; height: 36px;
  display: flex; align-items: center; justify-content: center;
  background: var(--grad-soft);
  border-radius: 6px;
  color: var(--pink);
  flex-shrink: 0;
}

.composer__attach-thumb svg { width: 16px; height: 16px; }

.composer__attach-info {
  display: flex; flex-direction: column; gap: 2px;
  padding: 0 4px;
  min-width: 0;
}

.composer__attach-name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 200px;
  font-weight: 500;
}

.composer__attach-meta {
  font-size: 10px;
  color: var(--text-4);
  font-family: 'JetBrains Mono', monospace;
}

.composer__attach-remove {
  position: absolute;
  right: 6px; top: 50%;
  transform: translateY(-50%);
  width: 18px; height: 18px;
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--bg-glass-hover);
  border: 0;
  border-radius: 4px;
  color: var(--text-3);
  cursor: pointer;
  font-size: 14px;
  line-height: 1;
}
.composer__attach-remove:hover { color: var(--pink); }

.composer__textarea {
  display: block;
  width: 100%;
  min-height: 56px;
  max-height: 220px;
  padding: 18px 60px 14px 20px;
  background: transparent;
  border: 0;
  outline: 0;
  resize: none;
  color: var(--text-1);
  font-family: inherit;
  font-size: 15px;
  line-height: 1.5;
}
.composer__textarea::placeholder { color: var(--text-4); }

.composer__bottom {
  display: flex; align-items: center; gap: 4px;
  padding: 0 10px 10px;
}

.composer__attach-btn {
  width: 32px; height: 32px;
  display: inline-flex; align-items: center; justify-content: center;
  background: transparent;
  border: 0;
  border-radius: 8px;
  color: var(--text-3);
  cursor: pointer;
  transition: all 0.15s;
  flex-shrink: 0;
}

.composer__attach-btn:hover { background: var(--bg-glass-hover); color: var(--text-1); }
.composer__attach-btn:disabled { opacity: 0.4; cursor: not-allowed; }

.composer__attach-btn.is-recording {
  color: #fff;
  background: var(--pink);
  animation: rec-pulse 1.2s ease-in-out infinite;
}

@keyframes rec-pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(255, 75, 125, 0.5); }
  50%      { box-shadow: 0 0 0 8px rgba(255, 75, 125, 0); }
}

.composer__attach-btn svg { width: 16px; height: 16px; }

.composer__hint {
  font-size: 11px;
  color: var(--text-4);
  font-family: 'JetBrains Mono', monospace;
  letter-spacing: 0.03em;
  margin-left: 8px;
}

.composer__hint kbd {
  padding: 2px 5px;
  background: var(--bg-glass-hover);
  border: 1px solid var(--border);
  border-radius: 4px;
  font-size: 10px;
  margin: 0 1px;
}

.btn-send {
  margin-left: auto;
  width: 36px; height: 36px;
  display: flex; align-items: center; justify-content: center;
  background: var(--grad);
  border: 0;
  border-radius: 10px;
  color: #fff;
  cursor: pointer;
  transition: all 0.2s var(--easing-spring);
  box-shadow: 0 2px 12px rgba(255, 75, 125, 0.3);
}

.btn-send:hover:not(:disabled) {
  transform: scale(1.05) rotate(2deg);
  box-shadow: 0 6px 22px rgba(255, 75, 125, 0.45);
}

.btn-send:disabled { opacity: 0.3; cursor: not-allowed; transform: none; }
.btn-send svg { width: 16px; height: 16px; }

/* Recording bar */
.recording-bar {
  display: none;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  margin: 0 14px 12px;
  background: var(--grad-soft);
  border: 1px solid var(--border-brand);
  border-radius: 12px;
  font-size: 13px;
  color: var(--text-1);
}

.composer.is-recording .recording-bar { display: flex; }

.recording-dot {
  width: 10px; height: 10px;
  background: var(--pink);
  border-radius: 50%;
  animation: rec-blink 1s ease-in-out infinite;
  box-shadow: 0 0 12px var(--pink);
}

@keyframes rec-blink {
  0%, 100% { opacity: 1; transform: scale(1); }
  50%      { opacity: 0.4; transform: scale(1.3); }
}

.recording-time {
  font-family: 'JetBrains Mono', monospace;
  font-weight: 500;
  color: var(--pink);
  letter-spacing: 0.05em;
}

.recording-bar__label { flex: 1; color: var(--text-2); font-size: 12px; }

.recording-bar__btn {
  padding: 6px 14px;
  background: var(--bg-glass);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text-2);
  font-family: inherit;
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s;
}

.recording-bar__btn:hover {
  background: var(--bg-glass-hover);
  color: var(--text-1);
  border-color: var(--border-strong);
}

.recording-bar__btn--primary {
  background: var(--grad);
  border-color: transparent;
  color: #fff;
}
.recording-bar__btn--primary:hover { color: #fff; }

/* Slash menu */
.slash-menu {
  position: absolute;
  bottom: 100%;
  left: 0;
  right: 0;
  margin-bottom: 8px;
  background: var(--bg-elevated);
  backdrop-filter: blur(28px);
  -webkit-backdrop-filter: blur(28px);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  padding: 6px;
  box-shadow: 0 12px 40px rgba(0,0,0,.4);
  display: none;
  z-index: 10;
}

.slash-menu.is-open { display: block; }

.slash-item {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 12px;
  border-radius: 8px;
  cursor: pointer;
  font-size: 13px;
  color: var(--text-2);
  transition: all 0.1s;
}

.slash-item:hover, .slash-item.is-active {
  background: var(--grad-soft);
  color: var(--text-1);
}

.slash-icon { font-size: 16px; }
.slash-name { font-weight: 500; }
.slash-desc { color: var(--text-3); font-size: 12px; margin-left: auto; }

/* Mobile */
.menu-toggle { display: none; }

.sidebar-overlay {
  display: none;
  position: fixed; inset: 0;
  background: rgba(8, 4, 15, 0.6);
  backdrop-filter: blur(4px);
  z-index: 99;
}

@media (max-width: 768px) {
  .app { grid-template-columns: 1fr; }

  .sidebar {
    position: fixed;
    inset: 0 auto 0 0;
    width: 280px;
    z-index: 100;
    transform: translateX(-100%);
    transition: transform 0.32s var(--easing-soft);
    box-shadow: 0 0 60px rgba(0,0,0,.4);
  }
  .sidebar.is-open { transform: translateX(0); }
  .sidebar.is-open ~ .sidebar-overlay { display: block; }

  .menu-toggle { display: inline-flex; }

  .chat__header { padding: 12px 16px; }
  .msg, .composer-wrap, .status-bar { padding-left: 16px; padding-right: 16px; }
  .welcome { padding: 24px 16px 12px; margin-top: 1vh; }
  .welcome__title { font-size: 38px; }
  .welcome__lede { font-size: 15px; margin-bottom: 28px; }
  .welcome__logo-wrap { width: 92px; height: 92px; margin-bottom: 20px; }

  .templates { grid-template-columns: 1fr; max-width: 100%; }

  .composer-wrap { padding: 0 16px 14px; }
  .composer__textarea { padding: 16px 50px 12px 16px; min-height: 50px; }
  .composer__bottom { padding: 0 8px 8px; }
  .composer__hint { display: none; }

  .orb { filter: blur(70px); }
}

@media (max-width: 480px) {
  .welcome__title { font-size: 32px; }
  .msg { padding: 12px 16px; }
  .msg__body { font-size: 15px; }
}

.file-input-hidden { display: none; }
.sr-only {
  position: absolute; width: 1px; height: 1px;
  padding: 0; margin: -1px; overflow: hidden;
  clip: rect(0,0,0,0); border: 0;
}
