/* ── Compose grip ───────────────────────────────────────────────────────── */

/* ── Accessory bar (footer row above input-row) ───────────────────────────── */

.compose-accessory-bar {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0 0.5rem;
  height: 22px;
  flex-shrink: 0;
  user-select: none;
  touch-action: none;
  position: relative;
}
.compose-accessory-spacer { flex: 1; }

.compose-accessory-btn {
  background: none;
  border: none;
  cursor: pointer;
  color: oklch(var(--bc) / 40%);
  padding: 4px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  transition: color 0.15s, background 0.15s;
}
.compose-accessory-btn:hover { color: oklch(var(--bc) / 70%); background: oklch(var(--bc) / 7%); }
.compose-accessory-btn svg { width: 14px; height: 14px; }
.compose-cost-label {
  font-size: 0.72rem;
  color: oklch(var(--bc) / 55%);
  font-variant-numeric: tabular-nums;
  pointer-events: none;
}

/* ── Grip tab — folder tab above .input-row top edge, always above compose box ── */

.compose-grip-tab {
  position: absolute;
  /* Pops 14px above the input-row top edge — sits flush on the compose box's top border */
  top: -14px;
  left: 50%;
  transform: translateX(-50%);
  width: 64px;
  height: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: oklch(var(--b2));
  border: 1px solid oklch(var(--bc) / 15%);
  border-bottom: none;
  border-radius: 6px 6px 0 0;
  color: oklch(var(--bc) / 25%);
  cursor: ns-resize;
  transition: color 0.15s, background 0.15s, border-color 0.15s;
  z-index: 1;
}
.compose-grip-tab svg { width: 12px; height: 12px; pointer-events: none; }

/* Highlight tab when compose area is hovered (class toggled via JS) */
#compose-area.grip-hover .compose-grip-tab {
  color: oklch(var(--bc) / 55%);
  background: oklch(var(--bc) / 7%);
  border-color: oklch(var(--bc) / 25%);
}

/* Fixed mode: slightly more visible tab */
#compose-area.fixed .compose-grip-tab {
  color: oklch(var(--bc) / 45%);
  border-color: oklch(var(--bc) / 22%);
}

/* ── Input textarea ──────────────────────────────────────────────────────── */

#compose-area {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  min-height: 44px;
  max-height: 40dvh;
  overflow-y: auto;
  position: relative;
  border: 1px solid oklch(var(--bc) / 15%);
  border-radius: var(--radius);
  background: oklch(var(--b1));
  transition: border-color 0.15s;
}

#compose-area:focus-within {
  border-color: oklch(var(--bc) / 40%);
}

#input {
  width: 100%;
  min-height: 44px;
  padding: 0.6rem 0.85rem;
  background: transparent;
  border: none;
  border-radius: 0;
  color: oklch(var(--bc));
  font-size: 0.95rem;
  font-family: inherit;
  resize: none;
  outline: none;
  line-height: 1.5;
  overflow-y: auto;
  transition: none;
  box-sizing: border-box;
}

/* In fixed mode, textarea fills the container instead of auto-sizing */
#compose-area.fixed #input {
  flex: 1;
}

#input::placeholder {
  color: oklch(var(--bc) / 40%);
}

/* ── Send button ──────────────────────────────────────────────────────────── */

.send-btn-base {
  width: 44px;
  height: 44px;
  flex-shrink: 0;
  font-size: 1.1rem;
  font-weight: 800;
}

/* Lucide SVG sizing within buttons */
.footer-icon-btn svg,
.send-btn-base svg {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
}

/* Send / stop icon — scale+rotate cross-fade */
.send-btn-base {
  position: relative;
}

.send-icon,
.stop-icon {
  position: absolute;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 150ms ease, opacity 150ms ease;
}

/* Send visible by default, stop hidden */
.send-icon {
  transform: scale(1) rotate(0deg);
  opacity: 1;
}
.stop-icon {
  transform: scale(0) rotate(-45deg);
  opacity: 0;
}

/* In stop-mode: swap */
#send-btn.stop-mode .send-icon {
  transform: scale(0) rotate(45deg);
  opacity: 0;
}
#send-btn.stop-mode .stop-icon {
  transform: scale(1) rotate(0deg);
  opacity: 1;
}

/* ── Hamburger menu button ────────────────────────────────────────────────── */

.menu-btn {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 4px;
  width: 44px;
  height: 44px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
  flex-shrink: 0;
  border-radius: var(--radius-sm);
}

.menu-btn svg {
  width: 20px;
  height: 20px;
  color: oklch(var(--bc) / 82%);
  transition: opacity 0.15s;
}

.menu-btn:active svg { opacity: 0.6; }

/* ── Emoji autocomplete dropdown ─────────────────────────────────────────── */

.emoji-autocomplete {
  position: absolute;
  z-index: 50;
  min-width: 200px;
  max-width: 320px;
  max-height: 240px;
  overflow-y: auto;
  background: oklch(var(--b2));
  border: 1px solid oklch(var(--b3));
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-popover);
  display: flex;
  flex-direction: column;
}

.emoji-autocomplete-item {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.5rem 0.75rem;
  cursor: pointer;
  transition: background 0.1s;
}

.emoji-autocomplete-item:hover,
.emoji-autocomplete-item.selected {
  background: oklch(var(--p) / 12%);
}

.emoji-autocomplete-item.selected {
  border-left: 2px solid oklch(var(--p));
}

.emoji-char {
  font-size: 1.25rem;
  line-height: 1;
  flex-shrink: 0;
}

.emoji-shortcode {
  font-size: 0.8rem;
  color: oklch(var(--bc) / 75%);
  font-family: monospace;
}

.emoji-autocomplete-empty {
  padding: 0.75rem;
  text-align: center;
  font-size: 0.8rem;
  color: oklch(var(--bc) / 45%);
}

.emoji-autocomplete-hint {
  padding: 0.35rem 0.75rem;
  font-size: 0.65rem;
  color: oklch(var(--bc) / 40%);
  border-top: 1px solid oklch(var(--b3));
  display: flex;
  justify-content: space-between;
}

.emoji-autocomplete-hint kbd {
  background: oklch(var(--b3));
  padding: 0.1rem 0.3rem;
  border-radius: 3px;
  font-size: 0.6rem;
}

/* ── Skin-tone swatch popup ──────────────────────────────────────────────── */
.emoji-tone-swatch {
  position: fixed;
  z-index: 2000;
  display: flex;
  gap: 3px;
  padding: 5px 6px;
  background: oklch(var(--b1));
  border: 1px solid oklch(var(--bc) / 18%);
  border-radius: var(--radius-box);
  box-shadow: 0 4px 16px oklch(var(--bc) / 20%);
}
.emoji-tone-btn {
  width: 2rem;
  height: 2rem;
  display: flex;
  align-items: center;
  justify-content: center;
  border: none;
  border-radius: var(--radius-sm);
  background: transparent;
  cursor: pointer;
  font-size: 1.2rem;
  transition: background 0.1s;
}
.emoji-tone-btn:hover {
  background: oklch(var(--bc) / 10%);
}
.emoji-has-tones {
  font-size: 0.45rem;
  vertical-align: super;
  color: oklch(var(--p) / 70%);
  margin-left: 1px;
}
