:root {
  --bg: #090a0c;
  --panel: #111318;
  --panel-2: #171a20;
  --line: rgba(255,255,255,.09);
  --text: #f4f2ed;
  --muted: #9b9da5;
  --gold: #d8aa55;
  --gold-2: #f0ca7a;
  --danger: #ff8d8d;
  --radius: 18px;
}
* { box-sizing: border-box; }
html, body { min-height: 100%; }
body {
  margin: 0;
  color: var(--text);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background:
    radial-gradient(circle at 30% 0%, rgba(216,170,85,.12), transparent 28rem),
    radial-gradient(circle at 100% 30%, rgba(216,170,85,.05), transparent 22rem),
    var(--bg);
}
button, textarea { font: inherit; }
button { cursor: pointer; }
.shell {
  width: min(920px, calc(100% - 28px));
  margin: 0 auto;
  padding: 28px 0 60px;
}
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 6px 2px 28px;
}
.eyebrow {
  font-size: 11px;
  letter-spacing: .22em;
  color: var(--muted);
  font-weight: 800;
}
h1 {
  margin: 2px 0 0;
  font-size: 28px;
  letter-spacing: -.04em;
}
h1 span { color: var(--gold-2); }
.status {
  display: flex;
  gap: 8px;
  align-items: center;
  color: var(--muted);
  font-size: 13px;
}
.status i {
  width: 8px; height: 8px; border-radius: 50%;
  background: #67d391;
  box-shadow: 0 0 18px rgba(103,211,145,.55);
}
.status.busy i { background: var(--gold); }
.status.error i { background: var(--danger); }
.hero {
  text-align: center;
  padding: 42px 10px 34px;
}
.badge {
  display: inline-flex;
  border: 1px solid rgba(216,170,85,.28);
  background: rgba(216,170,85,.08);
  color: var(--gold-2);
  padding: 6px 10px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .12em;
}
.hero h2 {
  margin: 14px 0 8px;
  font-size: clamp(36px, 6vw, 64px);
  letter-spacing: -.055em;
  line-height: .98;
}
.hero p {
  color: var(--muted);
  font-size: 16px;
  margin: 0 auto;
}
.chat-card {
  overflow: hidden;
  background: rgba(17,19,24,.91);
  border: 1px solid var(--line);
  border-radius: 24px;
  box-shadow: 0 28px 90px rgba(0,0,0,.32);
  backdrop-filter: blur(16px);
}
.messages {
  min-height: 320px;
  max-height: 58vh;
  overflow-y: auto;
  padding: 26px;
}
.message {
  display: flex;
  gap: 12px;
  margin: 0 0 22px;
  align-items: flex-start;
}
.message.user { flex-direction: row-reverse; }
.avatar {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  display: grid;
  place-items: center;
  flex: 0 0 34px;
  font-weight: 900;
  background: linear-gradient(145deg, var(--gold-2), #8f6525);
  color: #14110a;
}
.user .avatar {
  background: #2b2f39;
  color: #fff;
}
.bubble {
  max-width: min(720px, calc(100% - 46px));
  background: var(--panel-2);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 13px 15px;
  line-height: 1.55;
  overflow-wrap: anywhere;
}
.user .bubble { background: rgba(216,170,85,.10); }
.bubble strong {
  display: block;
  font-size: 12px;
  color: var(--gold-2);
  margin-bottom: 4px;
}
.user .bubble strong { color: #e8e8eb; }
.bubble p { margin: 0; white-space: pre-wrap; }
.suggestions {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding: 0 18px 14px;
}
.suggestions button {
  border: 1px solid var(--line);
  border-radius: 999px;
  background: transparent;
  color: #c9cbd2;
  white-space: nowrap;
  padding: 9px 12px;
  font-size: 12px;
}
.suggestions button:hover {
  border-color: rgba(216,170,85,.45);
  color: var(--gold-2);
}
.composer {
  border-top: 1px solid var(--line);
  padding: 14px;
  display: flex;
  gap: 10px;
  align-items: flex-end;
  background: rgba(0,0,0,.12);
}
textarea {
  flex: 1;
  min-height: 46px;
  max-height: 180px;
  resize: none;
  border: 1px solid var(--line);
  outline: none;
  border-radius: 14px;
  background: #0c0e12;
  color: var(--text);
  padding: 12px 13px;
}
textarea:focus { border-color: rgba(216,170,85,.55); }
#send {
  min-height: 46px;
  border: 0;
  border-radius: 14px;
  background: linear-gradient(145deg, var(--gold-2), #b7863c);
  color: #171208;
  padding: 0 15px;
  font-weight: 900;
  display: flex;
  align-items: center;
  gap: 9px;
}
#send:disabled { opacity: .55; cursor: wait; }
.fineprint {
  color: #777b85;
  font-size: 11px;
  padding: 0 18px 15px;
  text-align: center;
}
.typing {
  display: inline-flex;
  gap: 5px;
  align-items: center;
  min-height: 20px;
}
.typing span {
  width: 6px; height: 6px; border-radius: 50%;
  background: #aaa;
  animation: pulse 1s infinite alternate;
}
.typing span:nth-child(2) { animation-delay: .15s; }
.typing span:nth-child(3) { animation-delay: .3s; }
@keyframes pulse {
  to { transform: translateY(-4px); opacity: .45; }
}
@media (max-width: 640px) {
  .shell { width: min(100% - 16px, 920px); padding-top: 14px; }
  .hero { padding: 26px 8px 26px; }
  .messages { padding: 18px 14px; }
  #send span { display: none; }
  #send { width: 48px; justify-content: center; padding: 0; }
}


.message-body {
  white-space: normal;
}

.user .message-body {
  white-space: pre-wrap;
}

.message-body p {
  margin: 0 0 10px;
  white-space: normal;
}

.message-body p:last-child {
  margin-bottom: 0;
}

.message-body ul,
.message-body ol {
  margin: 7px 0 11px;
  padding-left: 22px;
}

.message-body li {
  margin: 4px 0;
}

.message-body h3,
.message-body h4,
.message-body h5 {
  margin: 12px 0 7px;
  line-height: 1.25;
  color: var(--text);
}

.message-body h3:first-child,
.message-body h4:first-child,
.message-body h5:first-child {
  margin-top: 0;
}

.message-body strong {
  display: inline;
  font-size: inherit;
  color: inherit;
  margin: 0;
  font-weight: 800;
}

.message-body em {
  color: inherit;
}

.message-body code {
  padding: 2px 6px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #0a0c10;
  font-family: ui-monospace, SFMono-Regular, Consolas, "Liberation Mono", monospace;
  font-size: .92em;
}

.message-body blockquote {
  margin: 8px 0;
  padding: 8px 12px;
  border-left: 3px solid var(--gold);
  color: #c6c8ce;
  background: rgba(216,170,85,.05);
  border-radius: 0 8px 8px 0;
}

.message-body a {
  color: var(--gold-2);
  text-decoration: underline;
  text-underline-offset: 2px;
}


.access-gate[hidden] {
  display: none;
}

.access-gate {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(5, 6, 8, .86);
  backdrop-filter: blur(14px);
}

.access-panel {
  width: min(420px, 100%);
  border: 1px solid var(--line);
  border-radius: 22px;
  padding: 26px;
  background: var(--panel);
  box-shadow: 0 28px 90px rgba(0, 0, 0, .5);
}

.access-panel h2 {
  margin: 14px 0 6px;
  font-size: 28px;
  letter-spacing: -.04em;
}

.access-panel p {
  margin: 0 0 18px;
  color: var(--muted);
}

.access-panel input {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #0c0e12;
  color: var(--text);
  padding: 12px 13px;
  outline: none;
}

.access-panel input:focus {
  border-color: rgba(216, 170, 85, .55);
}

.access-panel button {
  width: 100%;
  margin-top: 10px;
  border: 0;
  border-radius: 12px;
  padding: 12px 14px;
  background: linear-gradient(145deg, var(--gold-2), #b7863c);
  color: #171208;
  font-weight: 900;
}

.access-error {
  min-height: 18px;
  margin-top: 10px;
  color: var(--danger);
  font-size: 12px;
  text-align: center;
}
