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

:root {
  --bg: #040713;
  --bg-2: #0b1523;
  --panel: rgba(12, 24, 38, 0.86);
  --panel-strong: rgba(8, 17, 30, 0.96);
  --line: rgba(255, 255, 255, 0.12);
  --line-strong: rgba(25, 183, 198, 0.36);
  --primary: #19b7c6;
  --accent: #d69b3a;
  --violet: #6377e8;
  --danger: #ff8b7c;
  --success: #68d391;
  --text: #f8fafc;
  --soft: #d7e1ec;
  --muted: #9eacbd;
  --shadow: 0 18px 48px rgba(0, 0, 0, 0.34);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--text);
  background:
    radial-gradient(circle at 18% 10%, rgba(25, 183, 198, 0.17), transparent 30%),
    radial-gradient(circle at 84% 24%, rgba(214, 155, 58, 0.14), transparent 28%),
    linear-gradient(135deg, var(--bg), var(--bg-2) 55%, #07111d);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  line-height: 1.6;
  color-scheme: dark;
}

body.locked {
  overflow: hidden;
}

body.locked > :not(.password-gate) {
  filter: blur(8px);
  pointer-events: none;
  user-select: none;
}

body::before {
  position: fixed;
  inset: 0;
  z-index: -1;
  content: "";
  pointer-events: none;
  opacity: 0.34;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.035) 1px, transparent 1px);
  background-size: 48px 48px;
}

a {
  color: var(--primary);
}

button,
input,
textarea {
  font: inherit;
}

.password-gate {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: grid;
  place-items: center;
  padding: 20px;
  background:
    radial-gradient(circle at 24% 12%, rgba(25, 183, 198, 0.18), transparent 32%),
    radial-gradient(circle at 78% 36%, rgba(214, 155, 58, 0.14), transparent 28%),
    rgba(4, 7, 19, 0.9);
  backdrop-filter: blur(18px);
}

.password-gate[hidden],
.password-gate.is-unlocked {
  display: none !important;
}

.password-card,
.chat-panel {
  background: var(--panel-strong);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.password-card {
  width: min(430px, 100%);
  padding: 24px;
}

.password-card .brand-mark {
  margin-bottom: 14px;
}

.password-card h1 {
  font-size: 2rem;
}

.password-card p,
.site-footer,
.chat-intro p,
.empty-state p,
.muted {
  color: var(--muted);
}

.password-error {
  min-height: 22px;
  margin-top: 8px;
  color: var(--danger);
  font-size: 0.9rem;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 30;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 14px clamp(16px, 4vw, 48px);
  background: rgba(4, 7, 19, 0.86);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(14px);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  color: var(--text);
  text-decoration: none;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  color: #ffffff;
  background: linear-gradient(135deg, var(--primary), var(--violet));
  border-radius: 8px;
  box-shadow: 0 12px 28px rgba(25, 183, 198, 0.24);
  font-weight: 800;
}

.brand strong,
.brand small {
  display: block;
}

.brand strong,
h1,
h2,
h3 {
  font-family: Outfit, Inter, sans-serif;
}

.brand small {
  color: var(--muted);
  font-size: 0.82rem;
}

nav {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  flex-wrap: wrap;
}

button {
  min-height: 38px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 8px 12px;
  background: rgba(255, 255, 255, 0.06);
  color: var(--text);
  cursor: pointer;
  transition: 0.22s ease;
}

button:hover {
  border-color: var(--line-strong);
  color: var(--primary);
  transform: translateY(-1px);
}

main {
  padding: 30px clamp(16px, 4vw, 48px) 42px;
}

.chat-shell {
  display: grid;
  gap: 18px;
  max-width: 1120px;
  margin: 0 auto;
}

.chat-intro {
  max-width: 860px;
}

.eyebrow {
  margin: 0 0 8px;
  color: var(--accent);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

h1,
h2,
h3 {
  margin: 0;
  line-height: 1.1;
}

h1 {
  max-width: 900px;
  font-size: clamp(2.2rem, 4.4vw, 4.25rem);
}

h2 {
  font-size: 1.4rem;
}

h3 {
  font-size: 1.08rem;
}

.chat-panel {
  overflow: hidden;
}

.mode-toolbar {
  display: grid;
  gap: 10px;
  padding: 14px;
  border-bottom: 1px solid var(--line);
  background: rgba(4, 7, 19, 0.38);
}

.mode-toggle,
.model-selector {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.mode-toggle {
  padding: 4px;
  background: rgba(4, 7, 19, 0.5);
  border: 1px solid var(--line);
  border-radius: 8px;
  width: fit-content;
}

.model-selector[hidden] {
  display: none !important;
}

.mode-button,
.model-pill {
  min-height: 34px;
  font-size: 0.82rem;
}

.mode-button.active {
  color: #ffffff;
  background: linear-gradient(90deg, var(--primary), var(--violet));
  border-color: transparent;
  font-weight: 800;
}

.model-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--muted);
}

.model-pill span {
  display: grid;
  place-items: center;
  width: 14px;
  height: 14px;
  border: 1px solid currentColor;
  border-radius: 4px;
  font-size: 0.7rem;
}

.model-pill.selected {
  color: var(--model-color);
  border-color: var(--model-color);
  background: color-mix(in srgb, var(--model-color) 13%, transparent);
  font-weight: 800;
}

.chat-messages {
  display: flex;
  flex-direction: column;
  gap: 16px;
  min-height: 420px;
  max-height: 62vh;
  overflow-y: auto;
  padding: 18px;
}

.empty-state {
  display: grid;
  place-items: center;
  min-height: 380px;
  padding: 24px;
  color: var(--muted);
  text-align: center;
}

.empty-state h2 {
  color: var(--text);
}

.message {
  border-radius: 8px;
}

.user-message {
  align-self: flex-end;
  max-width: min(760px, 92%);
  padding: 12px 14px;
  color: var(--text);
  background: rgba(25, 183, 198, 0.12);
  border: 1px solid rgba(25, 183, 198, 0.3);
  white-space: pre-wrap;
}

.board-message {
  display: grid;
  gap: 12px;
  width: 100%;
}

.consensus-card,
.agent-card,
.discussion-turn,
.model-response {
  padding: 14px;
  background: rgba(255, 255, 255, 0.045);
  border: 1px solid var(--line);
  border-radius: 8px;
}

.consensus-card {
  border-color: rgba(25, 183, 198, 0.3);
  background: rgba(25, 183, 198, 0.09);
}

.agent-card header,
.discussion-turn header,
.model-response header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 8px;
}

.agent-card header span,
.discussion-turn header span,
.model-response header span {
  color: var(--accent);
  font-size: 0.84rem;
  font-weight: 800;
}

.agent-card header strong {
  color: var(--primary);
  font-size: 0.86rem;
}

.model-response {
  border-color: color-mix(in srgb, var(--model-color) 38%, var(--line));
}

.model-response header strong {
  color: var(--model-color);
  font-size: 0.86rem;
}

.model-response.failed {
  border-color: rgba(255, 139, 124, 0.34);
  background: rgba(255, 139, 124, 0.08);
}

.section-title {
  margin-top: 4px;
}

.progress {
  height: 10px;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.08);
}

#progressBar {
  width: 8%;
  height: 100%;
  background: linear-gradient(90deg, var(--primary), var(--accent));
  transition: width 0.3s ease;
}

.live-status {
  display: grid;
  gap: 8px;
  padding: 12px 14px;
  color: var(--muted);
  background: rgba(4, 7, 19, 0.5);
  border-top: 1px solid var(--line);
}

.live-status[hidden] {
  display: none !important;
}

.live-step {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.88rem;
}

.live-step span {
  display: inline-grid;
  place-items: center;
  width: 18px;
  color: var(--muted);
}

.live-step.active {
  color: var(--primary);
  font-weight: 700;
}

.live-step.done {
  color: var(--soft);
}

.live-step.done span {
  color: var(--success);
}

.chat-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  padding: 14px;
  border-top: 1px solid var(--line);
  background: rgba(4, 7, 19, 0.48);
}

input,
textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px 11px;
  background: rgba(4, 7, 19, 0.72);
  color: var(--text);
  outline: none;
}

textarea {
  resize: vertical;
  line-height: 1.5;
}

input:focus,
textarea:focus,
button:focus-visible {
  outline: 3px solid rgba(25, 183, 198, 0.23);
  outline-offset: 2px;
}

.chat-form button,
.password-card button,
#acceptDisclaimer {
  color: #ffffff;
  background: linear-gradient(90deg, var(--primary), var(--violet));
  border-color: transparent;
  font-weight: 800;
}

.site-footer {
  padding: 24px clamp(16px, 4vw, 48px) 34px;
  background: rgba(4, 7, 19, 0.94);
  border-top: 1px solid var(--line);
}

.site-footer p {
  max-width: 1120px;
  margin: 0 auto;
}

.disclaimer-dialog {
  width: min(720px, calc(100vw - 28px));
  color: var(--text);
  background: var(--panel-strong);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0;
  box-shadow: 0 28px 90px rgba(0, 0, 0, 0.42);
}

.disclaimer-dialog::backdrop {
  background: rgba(4, 7, 19, 0.82);
}

.disclaimer-dialog form {
  padding: 24px;
}

.disclaimer-dialog p {
  color: var(--muted);
}

.dialog-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 18px;
}

#declineDisclaimer {
  color: var(--danger);
}

@media (max-width: 760px) {
  .site-header {
    position: static;
    align-items: flex-start;
    flex-direction: column;
  }

  nav {
    justify-content: flex-start;
  }

  .chat-form {
    grid-template-columns: 1fr;
  }

  h1 {
    font-size: 2.25rem;
  }
}
