/* AI Theme Editor — Widget Styles
   Pixel-perfect port of aite-demo.html.
   All identifiers prefixed with #aite- / .aite- to avoid conflicts.
   Everything inside the fullscreen overlay is scoped under #aite-editor-overlay.
*/

/* ─── Google Font (Inter) ──────────────────────────────────────────────── */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&display=swap');

/* ─── Design tokens ────────────────────────────────────────────────────── */
:root {
  --aite-bg:       #111111;
  --aite-surface:  #1a1a1a;
  --aite-surface2: #222222;
  --aite-surface3: #2a2a2a;
  --aite-border:   #333333;
  --aite-text:     #eeeeee;
  --aite-dim:      #777777;
  --aite-accent:   #0099ff;
  --aite-red:      #ef4444;
  --aite-green:    #22c55e;
  --aite-orange:   #f59e0b;
  --aite-radius:   10px;
}

/* ─── Box-model reset for all aite elements ───────────────────────────── */
#aite-trigger,
#aite-editor-overlay,
#aite-trigger *,
#aite-editor-overlay * {
  box-sizing: border-box;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  margin: 0;
  padding: 0;
  line-height: 1.4;
}

/* ════════════════════════════════════════════════════════════════════════
   TRIGGER BUTTON
════════════════════════════════════════════════════════════════════════ */
#aite-trigger {
  position: fixed;
  bottom: 24px;
  right: 24px;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: var(--aite-accent);
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 999999;
  box-shadow: 0 4px 20px rgba(0,153,255,0.4), 0 2px 8px rgba(0,0,0,0.3);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  outline: none;
}

#aite-trigger:hover {
  transform: scale(1.08);
  box-shadow: 0 6px 28px rgba(0,153,255,0.6), 0 2px 10px rgba(0,0,0,0.3);
}

#aite-trigger:active {
  transform: scale(0.95);
}

#aite-trigger svg {
  width: 24px;
  height: 24px;
  flex-shrink: 0;
}

/* ════════════════════════════════════════════════════════════════════════
   FULLSCREEN OVERLAY
════════════════════════════════════════════════════════════════════════ */
#aite-editor-overlay {
  position: fixed;
  inset: 0;
  z-index: 999990;
  display: none;
  flex-direction: column;
  background: var(--aite-bg);
  overflow: hidden;
}

#aite-editor-overlay.aite-open {
  display: flex;
}

/* ════════════════════════════════════════════════════════════════════════
   EDITOR TOOLBAR
════════════════════════════════════════════════════════════════════════ */
#aite-editor-overlay #aite-toolbar {
  height: 48px;
  background: #000000;
  border-bottom: 1px solid var(--aite-border);
  display: flex;
  align-items: center;
  padding: 0 10px;
  gap: 2px;
  flex-shrink: 0;
  z-index: 200;
  user-select: none;
}

#aite-editor-overlay .aite-tb-group {
  display: flex;
  align-items: center;
  gap: 1px;
}

#aite-editor-overlay .aite-tb-divider {
  width: 1px;
  height: 22px;
  background: var(--aite-border);
  margin: 0 6px;
  flex-shrink: 0;
}

#aite-editor-overlay .aite-tb-spacer { flex: 1; }

/* ─── Base toolbar button ──────────────────────────────────────────────── */
#aite-editor-overlay .aite-tb-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  height: 32px;
  padding: 0 9px;
  border-radius: 7px;
  border: none;
  background: transparent;
  color: var(--aite-dim);
  font-size: 12px;
  font-weight: 600;
  font-family: 'Inter', sans-serif;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
  white-space: nowrap;
  flex-shrink: 0;
  outline: none;
  line-height: 1;
}

#aite-editor-overlay .aite-tb-btn:hover {
  background: var(--aite-surface2);
  color: var(--aite-text);
}

#aite-editor-overlay .aite-tb-btn:active {
  background: var(--aite-surface3);
}

#aite-editor-overlay .aite-tb-btn:disabled,
#aite-editor-overlay .aite-tb-btn.aite-tb-disabled {
  opacity: 0.3;
  cursor: default;
  pointer-events: none;
}

#aite-editor-overlay .aite-tb-btn svg {
  flex-shrink: 0;
  opacity: 0.8;
}

#aite-editor-overlay .aite-tb-btn:hover svg { opacity: 1; }

/* ─── Viewport buttons (icon-only, square) ─────────────────────────────── */
#aite-editor-overlay .aite-tb-vp-btn {
  width: 32px;
  height: 32px;
  padding: 0;
  justify-content: center;
  border-radius: 7px;
}

#aite-editor-overlay .aite-tb-vp-btn.aite-active {
  background: rgba(0, 153, 255, 0.15);
  color: var(--aite-accent);
}

#aite-editor-overlay .aite-tb-vp-btn.aite-active svg { opacity: 1; }

/* ─── Reset / ghost button ─────────────────────────────────────────────── */
#aite-editor-overlay .aite-tb-ghost-btn {
  color: var(--aite-dim);
  opacity: 0.7;
}
#aite-editor-overlay .aite-tb-ghost-btn:hover { opacity: 1; }

/* ─── Apply button ─────────────────────────────────────────────────────── */
#aite-editor-overlay .aite-tb-apply-btn {
  background: var(--aite-accent);
  color: #fff;
  font-weight: 600;
  padding: 0 13px;
  border-radius: var(--aite-radius);
}
#aite-editor-overlay .aite-tb-apply-btn svg { opacity: 1; }
#aite-editor-overlay .aite-tb-apply-btn:hover {
  background: #007acc;
  color: #fff;
}
#aite-editor-overlay .aite-tb-apply-btn:disabled {
  opacity: 0.35;
  cursor: not-allowed;
  pointer-events: none;
}

/* ─── Close button ─────────────────────────────────────────────────────── */
#aite-editor-overlay .aite-tb-close-btn {
  width: 32px;
  height: 32px;
  padding: 0;
  justify-content: center;
}
#aite-editor-overlay .aite-tb-close-btn:hover {
  background: rgba(239, 68, 68, 0.15);
  color: var(--aite-red);
}

/* ─── Token counter in toolbar ─────────────────────────────────────────── */
#aite-editor-overlay .aite-tb-demo-counter {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 10px;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 600;
  font-family: 'Inter', monospace;
  color: var(--aite-green);
  background: rgba(34, 197, 94, 0.1);
  border: 1px solid rgba(34, 197, 94, 0.2);
  letter-spacing: 0.02em;
  transition: all 0.3s;
  white-space: nowrap;
}
#aite-editor-overlay .aite-tb-demo-counter svg { stroke: var(--aite-green); flex-shrink: 0; }
#aite-editor-overlay .aite-tb-demo-counter.aite-low {
  color: var(--aite-orange);
  background: rgba(245, 158, 11, 0.1);
  border-color: rgba(245, 158, 11, 0.2);
}
#aite-editor-overlay .aite-tb-demo-counter.aite-low svg { stroke: var(--aite-orange); }
#aite-editor-overlay .aite-tb-demo-counter.aite-empty {
  color: var(--aite-red);
  background: rgba(239, 68, 68, 0.1);
  border-color: rgba(239, 68, 68, 0.2);
}
#aite-editor-overlay .aite-tb-demo-counter.aite-empty svg { stroke: var(--aite-red); }

#aite-editor-overlay .aite-tb-token-counter {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  height: 28px;
  padding: 0 10px;
  border-radius: 6px;
  background: var(--aite-surface);
  border: 1px solid var(--aite-border);
  color: var(--aite-dim);
  font-size: 11px;
  font-weight: 500;
  font-family: 'Inter', monospace;
  letter-spacing: 0.01em;
  transition: all 0.3s ease;
  white-space: nowrap;
}
#aite-editor-overlay .aite-tb-token-counter svg { stroke: var(--aite-accent); flex-shrink: 0; }
#aite-editor-overlay .aite-tb-token-counter.aite-active {
  background: var(--aite-surface2);
  color: var(--aite-text);
}

/* ─── Toolbar title ────────────────────────────────────────────────────── */
#aite-editor-overlay .aite-tb-title {
  font-size: 12.5px;
  font-weight: 700;
  color: var(--aite-text);
  letter-spacing: -0.01em;
  padding: 0 8px;
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
  gap: 5px;
}
#aite-editor-overlay .aite-tb-title svg {
  flex-shrink: 0;
}

/* ─── History dropdown ─────────────────────────────────────────────────── */
#aite-editor-overlay .aite-tb-dropdown-wrap {
  position: relative;
}

#aite-editor-overlay #aite-history-dropdown {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  width: 300px;
  background: var(--aite-surface);
  border: 1px solid var(--aite-border);
  border-radius: var(--aite-radius);
  box-shadow: 0 12px 48px rgba(0,0,0,0.55), 0 4px 16px rgba(0,0,0,0.3);
  z-index: 999;
  overflow: hidden;
  display: none;
}

#aite-editor-overlay #aite-history-dropdown.aite-open {
  display: block;
  animation: aite-dropdown-in 0.18s cubic-bezier(0.4,0,0.2,1);
}

@keyframes aite-dropdown-in {
  from { opacity: 0; transform: translateY(-6px) scale(0.97); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}

#aite-editor-overlay .aite-hd-header {
  padding: 11px 14px 9px;
  border-bottom: 1px solid var(--aite-border);
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--aite-dim);
}

#aite-editor-overlay .aite-hd-list {
  max-height: 280px;
  overflow-y: auto;
  padding: 4px 0;
}

#aite-editor-overlay .aite-hd-list::-webkit-scrollbar { width: 3px; }
#aite-editor-overlay .aite-hd-list::-webkit-scrollbar-track { background: transparent; }
#aite-editor-overlay .aite-hd-list::-webkit-scrollbar-thumb { background: #303050; border-radius: 2px; }

#aite-editor-overlay .aite-hd-entry {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 9px 14px;
  cursor: pointer;
  transition: background 0.13s;
  width: 100%;
  border: none;
  background: transparent;
  text-align: left;
  color: var(--aite-text);
}

#aite-editor-overlay .aite-hd-entry:hover { background: rgba(255,255,255,0.04); }

#aite-editor-overlay .aite-hd-dot {
  font-size: 11px;
  line-height: 1.5;
  flex-shrink: 0;
  margin-top: 1px;
}
#aite-editor-overlay .aite-hd-dot.aite-current { color: var(--aite-accent); }
#aite-editor-overlay .aite-hd-dot.aite-other   { color: var(--aite-dim); }

#aite-editor-overlay .aite-hd-text {
  flex: 1;
  min-width: 0;
}

#aite-editor-overlay .aite-hd-prompt {
  font-size: 12.5px;
  color: var(--aite-text);
  line-height: 1.4;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

#aite-editor-overlay .aite-hd-time {
  font-size: 10.5px;
  color: #40406a;
  margin-top: 2px;
}

#aite-editor-overlay .aite-hd-entry.aite-hd-original {
  background: rgba(34, 197, 94, 0.05);
  border-top: 1px solid var(--aite-border);
}
#aite-editor-overlay .aite-hd-entry.aite-hd-original .aite-hd-prompt {
  color: var(--aite-green);
  font-size: 12px;
  font-weight: 600;
}
#aite-editor-overlay .aite-hd-entry.aite-hd-original .aite-hd-dot { color: var(--aite-green); }

/* ════════════════════════════════════════════════════════════════════════
   MAIN LAYOUT
════════════════════════════════════════════════════════════════════════ */
#aite-editor-overlay .aite-main-layout {
  display: flex;
  flex: 1;
  overflow: hidden;
}

/* ════════════════════════════════════════════════════════════════════════
   PREVIEW PANEL (LEFT)
════════════════════════════════════════════════════════════════════════ */
#aite-editor-overlay #aite-preview-panel {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: var(--aite-surface);
  position: relative;
}

/* ─── Browser chrome bar ───────────────────────────────────────────────── */
#aite-editor-overlay #aite-browser-bar {
  background: var(--aite-surface2);
  padding: 10px 16px;
  display: flex;
  align-items: center;
  gap: 12px;
  flex-shrink: 0;
  border-bottom: 1px solid var(--aite-border);
}

#aite-editor-overlay .aite-browser-dots {
  display: flex;
  gap: 6px;
  flex-shrink: 0;
}

#aite-editor-overlay .aite-browser-dot {
  width: 11px;
  height: 11px;
  border-radius: 50%;
  flex-shrink: 0;
}

#aite-editor-overlay .aite-bd-red    { background: #ff5f57; }
#aite-editor-overlay .aite-bd-yellow { background: #febc2e; }
#aite-editor-overlay .aite-bd-green  { background: #28c840; }

#aite-editor-overlay .aite-browser-urlbar {
  flex: 1;
  background: var(--aite-surface);
  border-radius: 7px;
  padding: 5px 12px;
  font-size: 11.5px;
  color: var(--aite-dim);
  font-family: 'Inter', monospace;
  display: flex;
  align-items: center;
  gap: 6px;
  letter-spacing: 0.01em;
  overflow: hidden;
}

#aite-editor-overlay .aite-urlbar-lock {
  font-size: 10px;
  opacity: 0.7;
  flex-shrink: 0;
}

#aite-editor-overlay .aite-urlbar-text {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ─── Viewport scroll area ─────────────────────────────────────────────── */
#aite-editor-overlay #aite-preview-scroll {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  background: var(--aite-surface);
  display: flex;
  justify-content: center;
  transition: background 0.3s;
}

#aite-editor-overlay #aite-preview-scroll::-webkit-scrollbar { width: 5px; }
#aite-editor-overlay #aite-preview-scroll::-webkit-scrollbar-track { background: var(--aite-bg); }
#aite-editor-overlay #aite-preview-scroll::-webkit-scrollbar-thumb { background: var(--aite-surface3); border-radius: 3px; }

/* ─── Viewport frame ───────────────────────────────────────────────────── */
#aite-editor-overlay #aite-viewport-frame {
  width: 100%;
  min-height: 100%;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  transition: width 0.4s cubic-bezier(0.4, 0, 0.2, 1),
              box-shadow 0.4s ease;
}

#aite-editor-overlay #aite-viewport-frame iframe {
  width: 100%;
  flex: 1;
  min-height: calc(100vh - 90px);
  border: none;
  display: block;
  background: #f0f2f8;
}

/* ─── Rollback flash animation ─────────────────────────────────────────── */
@keyframes aite-rollback-flash {
  0%   { filter: brightness(1); }
  20%  { filter: brightness(0.6) hue-rotate(30deg); }
  50%  { filter: brightness(1.05) hue-rotate(0deg); }
  100% { filter: brightness(1); }
}

#aite-editor-overlay .aite-rollback-flash {
  animation: aite-rollback-flash 0.55s ease forwards !important;
}

/* ════════════════════════════════════════════════════════════════════════
   CHAT PANEL (RIGHT)
════════════════════════════════════════════════════════════════════════ */
#aite-editor-overlay #aite-chat-panel {
  width: 360px;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  background: var(--aite-bg);
  border-left: 1px solid var(--aite-border);
}

/* ─── Chat header ──────────────────────────────────────────────────────── */
#aite-editor-overlay #aite-chat-header {
  background: #000000;
  padding: 16px 18px 14px;
  border-bottom: 1px solid var(--aite-border);
  flex-shrink: 0;
}

#aite-editor-overlay .aite-chat-logo-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 6px;
}

#aite-editor-overlay .aite-chat-logo-icon {
  width: 34px;
  height: 34px;
  border-radius: 9px;
  background: var(--aite-accent);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  box-shadow: 0 4px 14px rgba(0, 153, 255, 0.3);
}

#aite-editor-overlay .aite-chat-logo-icon svg {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
}

#aite-editor-overlay .aite-chat-logo-name {
  font-size: 15px;
  font-weight: 800;
  color: #fff;
  letter-spacing: -0.02em;
  line-height: 1.2;
}

#aite-editor-overlay .aite-chat-logo-sub {
  font-size: 11px;
  color: var(--aite-dim);
  margin-top: 1px;
  line-height: 1.2;
}

#aite-editor-overlay .aite-chat-status-row {
  display: flex;
  align-items: center;
  gap: 5px;
  margin-top: 8px;
}

#aite-editor-overlay .aite-chat-status-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--aite-green);
  animation: aite-live-pulse 2s infinite;
  flex-shrink: 0;
}

@keyframes aite-live-pulse {
  0%, 100% { opacity: 1; }
  50%       { opacity: 0.4; }
}

#aite-editor-overlay .aite-chat-status-text {
  font-size: 11px;
  color: var(--aite-green);
  font-weight: 600;
}

/* ─── Messages area ────────────────────────────────────────────────────── */
#aite-editor-overlay #aite-messages {
  flex: 1;
  overflow-y: auto;
  padding: 18px 14px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  scroll-behavior: smooth;
}

#aite-editor-overlay #aite-messages::-webkit-scrollbar { width: 3px; }
#aite-editor-overlay #aite-messages::-webkit-scrollbar-track { background: transparent; }
#aite-editor-overlay #aite-messages::-webkit-scrollbar-thumb { background: var(--aite-surface3); border-radius: 2px; }

/* ─── Message row ──────────────────────────────────────────────────────── */
#aite-editor-overlay .aite-chat-msg {
  display: flex;
  flex-direction: column;
  max-width: 88%;
  animation: aite-msg-appear 0.28s ease;
}

@keyframes aite-msg-appear {
  from { opacity: 0; transform: translateY(7px); }
  to   { opacity: 1; transform: translateY(0); }
}

#aite-editor-overlay .aite-chat-msg.aite-user { align-self: flex-end; }
#aite-editor-overlay .aite-chat-msg.aite-ai   { align-self: flex-start; }

#aite-editor-overlay .aite-msg-sender {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 4px;
  padding: 0 4px;
}
#aite-editor-overlay .aite-user .aite-msg-sender { color: var(--aite-dim); text-align: right; }
#aite-editor-overlay .aite-ai   .aite-msg-sender { color: var(--aite-accent); }

#aite-editor-overlay .aite-msg-bubble {
  padding: 10px 14px;
  border-radius: 14px;
  font-size: 13.5px;
  line-height: 1.55;
  word-break: break-word;
}

#aite-editor-overlay .aite-user .aite-msg-bubble {
  background: var(--aite-accent);
  color: #fff;
  border-bottom-right-radius: 4px;
  box-shadow: 0 3px 12px rgba(0, 153, 255, 0.25);
}

#aite-editor-overlay .aite-ai .aite-msg-bubble {
  background: var(--aite-surface);
  color: var(--aite-text);
  border: 1px solid var(--aite-border);
  border-bottom-left-radius: 4px;
}

/* Code tokens inside AI messages */
#aite-editor-overlay .aite-ai .aite-msg-bubble .tok {
  display: inline-block;
  background: rgba(0, 153, 255, 0.12);
  color: var(--aite-accent);
  padding: 1px 6px;
  border-radius: 4px;
  font-size: 11.5px;
  font-family: 'SF Mono', 'Fira Code', 'Consolas', monospace;
  margin: 0 1px;
  border: 1px solid rgba(0, 153, 255, 0.2);
}

#aite-editor-overlay .aite-ai .aite-msg-bubble code {
  background: var(--aite-surface2);
  border: 1px solid var(--aite-border);
  border-radius: 4px;
  padding: 1px 5px;
  font-size: 12px;
  font-family: 'SF Mono', 'Fira Code', 'Consolas', monospace;
}

/* ─── Per-message token badge ──────────────────────────────────────────── */
#aite-editor-overlay .aite-msg-tokens {
  display: flex;
  align-items: center;
  gap: 4px;
  margin-top: 6px;
  padding: 3px 8px;
  border-radius: 4px;
  background: var(--aite-surface2);
  border: 1px solid var(--aite-border);
  font-size: 10px;
  font-family: 'Inter', monospace;
  color: var(--aite-dim);
  letter-spacing: 0.02em;
  opacity: 0;
  animation: aite-fade-tokens 0.4s ease forwards;
  animation-delay: 0.3s;
}
#aite-editor-overlay .aite-msg-tokens svg {
  width: 10px;
  height: 10px;
  stroke: var(--aite-accent);
  flex-shrink: 0;
  fill: none;
}

@keyframes aite-fade-tokens {
  to { opacity: 1; }
}

/* ─── Typing indicator ─────────────────────────────────────────────────── */
#aite-editor-overlay .aite-typing-wrapper {
  align-self: flex-start;
  animation: aite-msg-appear 0.28s ease;
}

#aite-editor-overlay .aite-typing-sender {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--aite-accent);
  margin-bottom: 4px;
  padding: 0 4px;
}

#aite-editor-overlay .aite-typing-bubble {
  background: var(--aite-surface);
  border: 1px solid var(--aite-border);
  border-radius: 14px;
  border-bottom-left-radius: 4px;
  padding: 12px 16px;
  display: flex;
  gap: 5px;
  align-items: center;
}

#aite-editor-overlay .aite-typing-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #6366f1;
  animation: aite-tdot 1.2s infinite;
}
#aite-editor-overlay .aite-typing-dot:nth-child(2) { animation-delay: 0.18s; }
#aite-editor-overlay .aite-typing-dot:nth-child(3) { animation-delay: 0.36s; }

@keyframes aite-tdot {
  0%, 60%, 100% { transform: translateY(0); opacity: 0.35; }
  30%            { transform: translateY(-5px); opacity: 1; }
}

/* ─── Apply prompt (inline in chat) ────────────────────────────────────── */
#aite-editor-overlay .aite-apply-prompt {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  background: rgba(0, 153, 255, 0.08);
  border: 1px solid rgba(0, 153, 255, 0.22);
  border-radius: var(--aite-radius);
  font-size: 12.5px;
  color: var(--aite-text);
  animation: aite-msg-appear 0.25s ease;
  align-self: stretch;
}

#aite-editor-overlay .aite-apply-prompt__text {
  flex: 1;
  font-weight: 500;
}

#aite-editor-overlay .aite-apply-prompt__btn {
  height: 28px;
  padding: 0 12px;
  background: var(--aite-accent);
  border: none;
  border-radius: 6px;
  color: #fff;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.15s;
  font-family: 'Inter', sans-serif;
  flex-shrink: 0;
}
#aite-editor-overlay .aite-apply-prompt__btn:hover { background: #0088ee; }

/* ════════════════════════════════════════════════════════════════════════
   CHAT FOOTER / INPUT AREA
════════════════════════════════════════════════════════════════════════ */
#aite-editor-overlay #aite-chat-footer {
  flex-shrink: 0;
  padding: 13px 16px 14px;
  border-top: 1px solid var(--aite-border);
  display: flex;
  flex-direction: column;
  gap: 10px;
  background: var(--aite-bg);
}

#aite-editor-overlay .aite-input-row {
  display: flex;
  align-items: flex-end;
  gap: 8px;
}

#aite-editor-overlay .aite-textarea {
  flex: 1;
  background: var(--aite-surface);
  border: 1px solid var(--aite-border);
  border-radius: 10px;
  color: var(--aite-text);
  font-size: 13.5px;
  font-family: 'Inter', sans-serif;
  line-height: 1.5;
  padding: 9px 12px;
  resize: none;
  outline: none;
  min-height: 40px;
  max-height: 120px;
  overflow-y: auto;
  transition: border-color 0.15s;
}
#aite-editor-overlay .aite-textarea::placeholder { color: var(--aite-dim); }
#aite-editor-overlay .aite-textarea:focus { border-color: var(--aite-accent); }
#aite-editor-overlay .aite-textarea::-webkit-scrollbar { width: 3px; }
#aite-editor-overlay .aite-textarea::-webkit-scrollbar-thumb { background: var(--aite-border); border-radius: 2px; }

#aite-editor-overlay .aite-send-btn {
  width: 38px;
  height: 38px;
  min-width: 38px;
  border-radius: 50%;
  background: var(--aite-accent);
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s, transform 0.1s, opacity 0.15s;
  flex-shrink: 0;
  box-shadow: 0 3px 10px rgba(0,153,255,0.3);
}
#aite-editor-overlay .aite-send-btn:hover:not(:disabled) { background: #0088ee; }
#aite-editor-overlay .aite-send-btn:active:not(:disabled) { transform: scale(0.92); }
#aite-editor-overlay .aite-send-btn:disabled {
  opacity: 0.3;
  cursor: not-allowed;
  box-shadow: none;
}
#aite-editor-overlay .aite-send-btn svg {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
}

#aite-editor-overlay .aite-input-hint {
  font-size: 10.5px;
  color: var(--aite-dim);
  padding: 0 2px;
}

/* ─── "Powered by" line at the bottom ──────────────────────────────────── */
#aite-editor-overlay .aite-powered-by {
  text-align: center;
  font-size: 11px;
  color: var(--aite-dim);
  font-weight: 500;
  letter-spacing: 0.02em;
}
#aite-editor-overlay .aite-powered-by a {
  color: var(--aite-accent);
  text-decoration: none;
  font-weight: 700;
}
#aite-editor-overlay .aite-powered-by a:hover { color: #33b3ff; }
