/* ── Scroll Button ───────────────────────────────────── */
#scroll-btn {
  position: absolute; top: 0; left: 50%;
  transform: translateX(-50%) translateY(-120%);
  background: var(--bg2); border: 1px solid var(--border2);
  border-radius: 20px; padding: 7px 16px 7px 12px;
  display: flex; align-items: center; gap: 6px;
  cursor: pointer; font-family: var(--font); font-size: 12.5px;
  color: var(--text2); font-weight: 500; white-space: nowrap;
  box-shadow: 0 4px 20px rgba(0,0,0,.3);
  transition: transform .3s var(--ease), opacity .3s; opacity: 0; pointer-events: none; z-index: 8;
}
#scroll-btn.visible { transform: translateX(-50%) translateY(-110%); opacity: 1; pointer-events: all; }
#scroll-btn:hover   { background: var(--bg3); color: var(--text); }

/* ── Stream Status ───────────────────────────────────── */
#stream-status {
  max-width: 720px; margin: 0 auto;
  display: none; align-items: center; gap: 8px;
  padding: 6px 4px; font-size: 12px; color: var(--text3);
}
#stream-status.visible    { display: flex; }
.stream-dot {
  width: 6px; height: 6px; border-radius: 50%; background: var(--accent2); flex-shrink: 0;
  animation: streamPulse 1.2s ease-in-out infinite;
}
@keyframes streamPulse { 0%,100% { opacity: .3; transform: scale(.8); } 50% { opacity: 1; transform: scale(1.2); } }
#stream-status-text { font-size: 12px; color: var(--text3); transition: color .2s; }
#stream-status.code-mode .stream-dot          { background: #f5a623; }
#stream-status.code-mode #stream-status-text  { color: rgba(245,166,35,.7); }

/* ── Input Area ──────────────────────────────────────── */
#input-area {
  padding: 16px 16px 20px; flex-shrink: 0;
  padding-bottom: calc(20px + env(safe-area-inset-bottom, 0px));
  position: relative; z-index: 2; background: transparent;
}
#input-area::before {
  content: ''; position: absolute; inset: 0;
  backdrop-filter: blur(22px); -webkit-backdrop-filter: blur(22px);
  background: rgba(13,13,16,0.72); z-index: -1; pointer-events: none;
}
#input-area::after {
  content: ''; position: absolute; top: -36px; left: 0; right: 0; height: 36px;
  background: linear-gradient(to bottom, transparent, rgba(13,13,16,0.55));
  pointer-events: none; z-index: -1;
}
[data-theme="light"] #input-area::before { background: rgba(244,244,250,0.78); }
[data-theme="light"] #input-area::after  { background: linear-gradient(to bottom, transparent, rgba(244,244,250,0.6)); }

/* ── Input Container ─────────────────────────────────── */
.input-container {
  max-width: 720px; margin: 0 auto;
  background: var(--bg2); border: 1.5px solid var(--border2);
  border-radius: var(--radius-xl);
  padding: 12px 16px;
  box-shadow: 0 4px 24px rgba(0,0,0,.25), 0 0 0 0 transparent;
  transition: border-color .2s, box-shadow .2s;
}
.input-container:focus-within {
  border-color: rgba(59,130,246,.5);
  box-shadow: 0 4px 24px rgba(0,0,0,.25), 0 0 0 3px rgba(59,130,246,.12);
}
[data-theme="light"] .input-container { border-color: rgba(0,0,0,.18); box-shadow: 0 2px 12px rgba(0,0,0,.08); }

/* ── Input Wrapper ───────────────────────────────────── */
.input-wrapper {
  margin-bottom: 8px;
}

/* ── Message Input ───────────────────────────────────── */
#msg-input {
  width: 100%; background: none; border: none; outline: none;
  font-family: var(--font); font-size: 14.5px; color: var(--text);
  resize: none; max-height: 168px; overflow-y: auto; line-height: 1.6;
  min-height: 24px;
}
#msg-input::placeholder        { color: var(--text3); }
#msg-input::-webkit-scrollbar  { display: none; }

/* ── Input Actions ───────────────────────────────────── */
.input-actions {
  display: flex; align-items: center; gap: 2px;
  flex-wrap: nowrap; padding-bottom: 2px;
}
.input-actions::-webkit-scrollbar { display: none; }

/* ── Action Buttons ───────────────────────────────────── */
.action-btn {
  display: flex; align-items: center; gap: 4px;
  padding: 6px 10px; border: none; background: transparent;
  border-radius: var(--radius-sm); color: var(--text2);
  font-size: 12px; cursor: pointer; transition: all 0.15s ease;
  white-space: nowrap; font-family: inherit;
}
.action-btn:hover {
  background: var(--bg3); color: var(--text);
}
.action-btn svg { flex-shrink: 0; }

.action-btn.selected {
  border: 2px solid var(--accent);
  background: var(--accent-glow);
  color: var(--accent);
  box-shadow: 0 0 0 3px rgba(59,130,246,0.15);
}

.action-btn.selected svg {
  color: var(--accent);
}

/* Quick Button */
.quick-btn span {
  color: var(--text); font-weight: 500;
}

/* ── Divider ──────────────────────────────────────────── */
.divider {
  width: 1px; height: 16px; background: var(--border);
  margin: 0 4px; flex-shrink: 0;
}

/* ── Spacer ───────────────────────────────────────────── */
.spacer { flex: 1; }

/* ── Send Button ──────────────────────────────────────── */
.send-btn {
  width: 36px; height: 36px; background: var(--bg4); border: none;
  border-radius: 50%; display: flex; align-items: center; justify-content: center;
  cursor: pointer; color: var(--text3); flex-shrink: 0;
  transition: background .2s, transform .1s, box-shadow .2s, color .2s;
}
.send-btn:hover:not(:disabled) {
  background: var(--accent); color: #fff;
  transform: scale(1.05);
}
.send-btn:active:not(:disabled) { transform: scale(0.95); }
.send-btn.active {
  background: var(--accent); color: #fff; cursor: pointer;
  box-shadow: 0 2px 10px rgba(37,99,235,.4);
}
.send-btn:disabled { cursor: default; }
.send-btn.hidden   { display: none; }

/* ── Stop Button ──────────────────────────────────────── */
.stop-btn {
  width: 36px; height: 36px; background: var(--bg4); border: none;
  border-radius: 50%; display: none; align-items: center; justify-content: center;
  cursor: pointer; color: var(--danger); flex-shrink: 0; transition: background .15s;
}
.stop-btn.visible { display: flex; }
.stop-btn:hover   { background: rgba(248,113,113,.15); }

/* ── Dropdown Wrapper ─────────────────────────────────── */
.dropdown-wrapper { position: relative; }

/* ── Dropdown Menu ────────────────────────────────────── */
.dropdown-menu {
  position: fixed;
  background: var(--bg2); border: 1px solid var(--border);
  border-radius: var(--radius); box-shadow: 0 8px 32px rgba(0,0,0,.3), 0 2px 8px rgba(0,0,0,.15);
  padding: 8px; min-width: 240px; z-index: 10000;
  opacity: 0; visibility: hidden; transform: translateY(8px);
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  pointer-events: none;
}
.dropdown-menu.show {
  opacity: 1; visibility: visible; transform: translateY(0);
  pointer-events: auto;
}
.quick-menu { min-width: 260px; }
.more-menu  { min-width: 200px; }

/* ── Dropdown Item ────────────────────────────────────── */
.dropdown-item {
  display: flex; flex-direction: column; gap: 4px;
  padding: 10px 12px; border-radius: var(--radius-sm);
  cursor: pointer; transition: all 0.15s ease;
  position: relative; border: none; background: transparent;
  text-align: left; font-family: inherit; width: 100%;
}
.dropdown-item:hover { background: var(--bg3); }
.dropdown-item.active { background: var(--accent-glow); }

.dropdown-item-header {
  display: flex; align-items: center; gap: 10px;
  color: var(--text); font-size: 14px; font-weight: 500;
}
.dropdown-item-header svg {
  flex-shrink: 0; color: var(--text2);
}
.dropdown-item.active .dropdown-item-header svg { color: var(--accent); }

.dropdown-item-desc {
  font-size: 12px; color: var(--text3);
  padding-left: 30px; line-height: 1.4;
}

.dropdown-check {
  position: absolute; right: 12px; top: 50%;
  transform: translateY(-50%); color: var(--accent);
}

/* ── Input Hint ───────────────────────────────────────── */
.input-hint { max-width: 720px; margin: 5px auto 0; text-align: center; font-size: 11px; color: var(--text3); }

/* ── Responsive ───────────────────────────────────────── */
@media (max-width: 768px) {
  .action-btn span { display: none; }
  .action-btn { padding: 6px 8px; }
  .divider { display: none; }
  #input-area { padding: 0 12px 16px; }
}
