#composer-wrap {
  padding: 10px 16px calc(14px + env(safe-area-inset-bottom));
  flex-shrink: 0;
  background: var(--bg-main);
  transition: background var(--t) var(--ease);
}

#composer {
  max-width: var(--cmp-max);
  margin: 0 auto;
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: var(--r-xl);
  padding: 6px 6px 6px 4px;
  transition:
    border-color var(--t) var(--ease),
    box-shadow var(--t) var(--ease),
    background var(--t) var(--ease);
  box-shadow: var(--shadow-sm);
}

#composer:focus-within {
  border-color: var(--iris);
  box-shadow: 0 0 0 3px var(--iris-glow), var(--shadow);
}

#attach-preview {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 6px 8px 2px;
}

#attach-preview:empty { display: none; }

.prev-item {
  position: relative;
  border-radius: var(--r);
  border: 1px solid var(--border);
  overflow: visible;
}

.prev-item img {
  width: 72px; height: 72px;
  object-fit: cover;
  display: block;
  border-radius: var(--r);
}

.prev-file {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 7px 11px;
  font-size: 12.5px;
  color: var(--text-2);
  background: var(--bg-main);
  border-radius: var(--r);
  max-width: 190px;
}

.prev-file .material-symbols-outlined { font-size: 17px; color: var(--iris); flex-shrink: 0; }

.prev-name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.prev-remove {
  position: absolute;
  top: -6px; right: -6px;
  width: 20px; height: 20px;
  border-radius: 50%;
  background: var(--text);
  color: var(--bg-main);
  display: flex; align-items: center; justify-content: center;
  box-shadow: var(--shadow-sm);
  transition: background .15s;
}

.prev-remove:hover { background: var(--danger); }
.prev-remove .material-symbols-outlined { font-size: 13px; }

.composer-row {
  display: flex;
  align-items: flex-end;
  gap: 2px;
}

.attach-zone { position: relative; flex-shrink: 0; }

.attach-menu {
  position: absolute;
  bottom: calc(100% + 6px);
  left: 0;
  background: var(--bg-main);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  overflow: hidden;
  box-shadow: var(--shadow-md);
  z-index: 40;
  min-width: 175px;
  animation: menuPop .15s var(--ease);
}

.attach-opt {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  width: 100%;
  text-align: left;
  font-size: 14px;
  color: var(--text);
  transition: background var(--t) var(--ease);
}

.attach-opt:hover { background: var(--surface-hover); }
.attach-opt .material-symbols-outlined { font-size: 20px; color: var(--iris); }

.effort-selector { position: relative; flex-shrink: 0; }

.effort-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  height: 38px;
  padding: 0 12px;
  border-radius: var(--r-pill);
  background: transparent;
  color: var(--text);
  font-size: 15px;
  font-weight: 500;
  white-space: nowrap;
  transition: background var(--t) var(--ease), color var(--t) var(--ease);
}

.effort-btn:hover  { background: var(--border); color: var(--text); }
.effort-btn:active { transform: scale(.96); }

.effort-chevron { font-size: 20px; color: var(--text-3); }
.effort-label { line-height: 1; }

.effort-menu {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  background: var(--bg-main);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  overflow: hidden;
  box-shadow: var(--shadow-md);
  z-index: 40;
  min-width: 140px;
  animation: menuPop .15s var(--ease);
}

.effort-option {
  display: block;
  width: 100%;
  text-align: left;
  padding: 10px 16px;
  font-size: 13.5px;
  color: var(--text);
  transition: background var(--t) var(--ease);
}

.effort-option:hover { background: var(--surface-hover); }

.effort-option.active {
  color: var(--iris);
  font-weight: 600;
  background: var(--iris-dim);
}

#msg-input {
  flex: 1;
  padding: 9px 6px;
  font-size: 15px;
  line-height: 1.5;
  min-height: 38px;
  max-height: 200px;
  overflow-y: auto;
  color: var(--text);
  scrollbar-width: thin;
}

#msg-input::placeholder { color: var(--text-3); }

.action-btn {
  width: 38px; height: 38px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
  transition: background var(--t) var(--ease), transform .12s, box-shadow var(--t);
}

.action-btn .material-symbols-outlined { font-size: 21px; }

.action-btn.state-mic {
  background: var(--surface-hover);
  color: var(--text-2);
}

.action-btn.state-mic:hover { background: var(--border); color: var(--text); }

.action-btn.state-listening {
  background: var(--iris);
  color: #fff;
  animation: micPulse 1.3s ease infinite;
}

@keyframes micPulse {
  0%, 100% { box-shadow: 0 0 0 0 var(--iris-glow); }
  55%       { box-shadow: 0 0 0 9px transparent; }
}

.action-btn.state-send {
  background: var(--iris);
  color: #fff;
  box-shadow: 0 2px 10px var(--iris-glow);
}

.action-btn.state-send:hover {
  background: color-mix(in srgb, var(--iris) 82%, #000);
  transform: scale(1.04);
}

.action-btn.state-stop {
  background: var(--danger);
  color: #fff;
}

.action-btn.state-stop:hover {
  background: color-mix(in srgb, var(--danger) 85%, #000);
}

.composer-disclaimer {
  text-align: center;
  font-size: 11.5px;
  color: var(--text-3);
  margin-top: 7px;
  max-width: var(--cmp-max);
  margin-left: auto;
  margin-right: auto;
}

#edit-banner {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0 0 6px;
  padding: 3px 4px 3px 14px;
  border-radius: var(--r-lg);
  background: var(--bg-main);
  color: var(--text-2);
  font-size: 14px;
}

#edit-banner > .material-symbols-outlined { font-size: 19px; color: var(--iris); }
.edit-banner-text { flex: 1; }
#edit-banner .icon-btn { width: 34px; height: 34px; }

body.arrastrando #composer {
  box-shadow: 0 0 0 2px var(--iris), 0 0 0 6px var(--iris-glow);
}
