/* ClipIQ — premium AI chat window */
:root {
  --gold: #b8860b;
  --gold-bright: #ffd966;
  --gold-soft: rgba(255, 217, 102, 0.15);
  --gold-border: rgba(184, 134, 11, 0.4);
}
.chat-body, body.chat-body { width: 100%; background: var(--bg, #fafafc); }
.chat-app { display: flex; flex-direction: column; height: 100vh; }

.chat-top {
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 14px; border-bottom: 1px solid var(--border, #e8e7ef);
  background: linear-gradient(135deg, rgba(255,217,102,0.10), rgba(184,134,11,0.06));
}
.brand.gold { color: var(--gold); font-weight: 800; letter-spacing: 0.2px; }
.chat-badge {
  font-size: 10px; font-weight: 800; letter-spacing: 1px; text-transform: uppercase;
  color: var(--gold); border: 1px solid var(--gold-border);
  background: var(--gold-soft); border-radius: 999px; padding: 3px 9px;
}

/* keep panels truly hidden regardless of display rules */
.gate[hidden], .chat-main[hidden] { display: none !important; }

/* gate */
.gate { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px; padding: 28px; text-align: center; }
.gate-art { font-size: 44px; }
.gate h2 { font-size: 17px; color: var(--gold); }
.gate-sub { font-size: 12.5px; color: var(--muted, #7a7794); max-width: 34ch; }
.gate-list { list-style: none; margin: 6px 0 10px; display: flex; flex-direction: column; gap: 7px; }
.gate-list li { display: flex; gap: 8px; align-items: flex-start; text-align: left; font-size: 12.5px; }
.gate-list .fi { font-size: 15px; }
.gate-list b { color: var(--gold); }
.gate-list span.d { color: var(--muted, #7a7794); }

.gold-btn {
  background: linear-gradient(135deg, #ffd966, #b8860b) !important;
  border: none !important; color: #3a2c00 !important; font-weight: 800;
}

/* chat main */
.chat-main { flex: 1; display: flex; flex-direction: column; min-height: 0; }
.msgs { flex: 1; overflow-y: auto; padding: 14px; display: flex; flex-direction: column; gap: 10px; }
.msg { display: flex; }
.msg.user { justify-content: flex-end; }
.msg .bubble {
  max-width: 82%; padding: 10px 12px; border-radius: 14px; font-size: 13px;
  line-height: 1.5; white-space: pre-wrap; overflow-wrap: anywhere;
}
.msg.ai .bubble { background: var(--card, #fff); border: 1px solid var(--border, #e8e7ef); border-top-left-radius: 4px; }
.msg.user .bubble { background: var(--gold-soft); border: 1px solid var(--gold-border); border-top-right-radius: 4px; }
.msg .bubble.thinking { color: var(--muted); font-style: italic; }
.msg .bubble.err { border-color: #e74c3c; color: #c0392b; }

.chat-inputwrap { display: flex; gap: 8px; padding: 10px 14px 4px; align-items: flex-end; }
.chat-inputwrap textarea {
  flex: 1; resize: none; border: 1.5px solid var(--border, #e8e7ef); border-radius: 10px;
  padding: 9px 11px; font: 13px/1.4 inherit; background: var(--panel, #fff); color: var(--text);
  outline: none; max-height: 110px;
}
.chat-inputwrap textarea:focus { border-color: var(--gold); box-shadow: 0 0 0 3px var(--gold-soft); }
.chat-hint { text-align: center; font-size: 10.5px; color: var(--muted, #7a7794); padding: 2px 0 10px; }

/* premium (gold) theme applied when Pro active */
.chat-app.pro, .chat-app.pro * { }
.chat-app.pro .chat-top { background: linear-gradient(135deg, rgba(255,217,102,0.22), rgba(184,134,11,0.12)); }
.chat-app.pro .msg.user .bubble { background: linear-gradient(135deg, rgba(255,217,102,0.30), rgba(184,134,11,0.18)); }
