:root {
  --cf-orange: #f6821f;
  --cf-orange-dark: #d9690f;
  --ink: #1b1b1f;
  --muted: #6b6b76;
  --bg: #f7f7f9;
  --card: #ffffff;
  --border: #e4e4e9;
  --radius: 10px;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  background: var(--bg);
  color: var(--ink);
}

.demo-banner {
  background: linear-gradient(90deg, var(--cf-orange), var(--cf-orange-dark));
  color: #fff;
  text-align: center;
  font-weight: 700;
  font-size: 0.85rem;
  letter-spacing: 0.02em;
  padding: 10px 16px;
  text-transform: uppercase;
}

.site-header {
  padding: 28px 24px 8px;
  max-width: 880px;
  margin: 0 auto;
}

.brand { display: flex; align-items: center; gap: 16px; }
.brand-mark { font-size: 2.2rem; }
.brand h1 { margin: 0; font-size: 1.5rem; }
.brand p { margin: 4px 0 0; color: var(--muted); font-size: 0.95rem; }

.container { max-width: 880px; margin: 0 auto; padding: 0 24px 48px; }

.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px 24px;
  margin-top: 20px;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
}

.gate-card h2 { margin-top: 0; }
.gate-card p { color: var(--muted); }

.hidden { display: none !important; }

.chat-controls {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 14px;
}
.chat-controls label { font-weight: 600; font-size: 0.9rem; }
#model-select {
  flex: 0 0 auto;
  padding: 8px 10px;
  border-radius: 8px;
  border: 1px solid var(--border);
  font-size: 0.9rem;
  background: #fff;
}
.model-description { color: var(--muted); font-size: 0.85rem; }

.chat-log {
  height: 420px;
  overflow-y: auto;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 16px;
  background: #fafafb;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.chat-msg { display: flex; }
.chat-msg.user { justify-content: flex-end; }
.chat-msg .bubble {
  max-width: 75%;
  padding: 10px 14px;
  border-radius: 12px;
  line-height: 1.45;
  white-space: pre-wrap;
  font-size: 0.95rem;
}
.chat-msg.assistant .bubble { background: #eef0f3; border-bottom-left-radius: 2px; }
.chat-msg.user .bubble { background: var(--cf-orange); color: #fff; border-bottom-right-radius: 2px; }

.chat-form {
  display: flex;
  gap: 10px;
  margin-top: 14px;
}
.chat-form textarea {
  flex: 1;
  resize: vertical;
  padding: 10px 12px;
  border-radius: 8px;
  border: 1px solid var(--border);
  font-family: inherit;
  font-size: 0.95rem;
}
.chat-form button {
  background: var(--cf-orange);
  color: #fff;
  border: none;
  border-radius: 8px;
  padding: 0 20px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s ease;
}
.chat-form button:hover { background: var(--cf-orange-dark); }
.chat-form button:disabled { background: #d8d8dd; cursor: not-allowed; }

.status-text { color: var(--muted); font-size: 0.85rem; min-height: 1.1em; margin: 10px 0 0; }
.status-text.error { color: #c0392b; }

.footer-note {
  margin-top: 28px;
  color: var(--muted);
  font-size: 0.82rem;
  line-height: 1.5;
}
