
:root {
  --navy: #14213d;
  --navy-deep: #0d1830;
  --navy-soft: #263654;
  --gold: #ad7a20;
  --gold-light: #d7b56f;
  --ivory: #faf7ef;
  --paper: #fffdf8;
  --text: #1d2a42;
  --muted: #6b7688;
  --border: #e5dfd1;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: Georgia, "Times New Roman", serif;
  color: var(--text);
  background: var(--ivory);
}

.topbar {
  min-height: 90px;
  background: var(--navy-deep);
  color: white;
  padding: 20px 36px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 24px;
  border-bottom: 3px solid var(--gold);
}

.brand {
  display: flex;
  align-items: center;
  gap: 16px;
}

.brand-mark {
  width: 52px;
  height: 52px;
  border: 2px solid var(--gold-light);
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: 20px;
  font-weight: bold;
  color: var(--gold-light);
}

.eyebrow {
  font: 700 10px Arial, sans-serif;
  letter-spacing: 2px;
  color: var(--gold-light);
}

h1, h2, h3, p {
  margin-top: 0;
}

h1 {
  margin: 6px 0 0;
  font-size: 25px;
}

h1 span {
  color: var(--gold-light);
  font-size: 15px;
  font-weight: normal;
  margin-left: 8px;
}

nav {
  display: flex;
  gap: 22px;
  flex-wrap: wrap;
}

nav a {
  color: #e6e9f1;
  font: 13px Arial, sans-serif;
  text-decoration: none;
}

nav a:hover {
  color: var(--gold-light);
}

.workspace {
  max-width: 1600px;
  margin: auto;
  display: grid;
  grid-template-columns: 310px minmax(0, 1fr);
  gap: 22px;
  padding: 24px;
  height: calc(100vh - 93px);
  min-height: 650px;
}

.sidebar,
.conversation {
  background: var(--paper);
  border: 1px solid var(--border);
  border-radius: 14px;
  overflow: hidden;
}

.sidebar {
  padding: 26px;
  display: flex;
  flex-direction: column;
  gap: 13px;
}

.panel-heading {
  padding-bottom: 16px;
  border-bottom: 1px solid var(--border);
}

.panel-heading h2 {
  margin: 10px 0;
  font-size: 24px;
}

.panel-heading p,
.sidebar-footer p {
  font: 13px/1.6 Arial, sans-serif;
  color: var(--muted);
}

label {
  font: 700 12px Arial, sans-serif;
  color: var(--navy);
}

select,
textarea {
  font-family: Arial, sans-serif;
  border: 1px solid #d5d8de;
  border-radius: 8px;
  background: white;
  color: var(--text);
}

select {
  padding: 12px;
  width: 100%;
}

.architecture {
  margin-top: 22px;
  padding: 18px;
  border-radius: 10px;
  background: var(--navy);
  color: white;
}

.architecture h3 {
  color: var(--gold-light);
  font-size: 16px;
}

.loop {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 18px;
}

.loop-dot {
  width: 13px;
  height: 13px;
  background: #6ba9ed;
  border-radius: 50%;
  flex-shrink: 0;
}

.loop-dot.gold {
  background: var(--gold-light);
}

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

.loop strong {
  font: 700 13px Arial, sans-serif;
}

.loop small {
  color: #c5ccda;
  font: 11px Arial, sans-serif;
  margin-top: 4px;
}

.sidebar-footer {
  margin-top: auto;
  border-top: 1px solid var(--border);
  padding-top: 18px;
}

.sidebar-footer strong {
  font-size: 14px;
}

.conversation {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.conversation-header {
  padding: 22px 28px;
  background: white;
  border-bottom: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 20px;
}

.conversation-header h2 {
  margin: 8px 0 0;
  font-size: 22px;
}

.status {
  display: flex;
  align-items: center;
  gap: 8px;
  font: 12px Arial, sans-serif;
  color: var(--muted);
}

.status-dot {
  width: 9px;
  height: 9px;
  background: #a0a5ae;
  border-radius: 50%;
}

.status-dot.online {
  background: #3b9c70;
}

.status-dot.error {
  background: #c35d4e;
}

.messages {
  flex: 1;
  overflow-y: auto;
  padding: 30px;
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.message {
  display: flex;
  gap: 14px;
  max-width: 90%;
}

.message.user {
  align-self: flex-end;
  flex-direction: row-reverse;
}

.avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--navy);
  color: var(--gold-light);
  display: grid;
  place-items: center;
  font: 700 13px Arial, sans-serif;
  flex-shrink: 0;
}

.message.user .avatar {
  background: var(--navy-soft);
  color: white;
}

.message-content {
  min-width: 0;
}

.speaker {
  font: 700 10px Arial, sans-serif;
  letter-spacing: 1.5px;
  color: var(--gold);
  margin-bottom: 8px;
}

.bubble {
  padding: 18px 20px;
  background: #f1f3f6;
  border-radius: 4px 14px 14px 14px;
  font: 14px/1.75 Arial, sans-serif;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.message.user .bubble {
  background: var(--navy);
  color: white;
  border-radius: 14px 4px 14px 14px;
}

.composer {
  padding: 20px 26px;
  background: white;
  border-top: 1px solid var(--border);
}

textarea {
  width: 100%;
  padding: 15px;
  resize: vertical;
  min-height: 90px;
  max-height: 220px;
  font: 14px/1.5 Arial, sans-serif;
}

textarea:focus,
select:focus {
  outline: 2px solid var(--gold-light);
  outline-offset: 1px;
}

.composer-actions {
  margin-top: 12px;
  display: flex;
  justify-content: space-between;
  gap: 12px;
}

button {
  border: 0;
  border-radius: 8px;
  padding: 13px 20px;
  background: var(--gold);
  color: white;
  font: 700 13px Arial, sans-serif;
  cursor: pointer;
}

button:hover {
  filter: brightness(1.08);
}

button:disabled {
  opacity: .55;
  cursor: wait;
}

.secondary-button {
  background: #e9ebef;
  color: var(--navy);
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
}

@media (max-width: 850px) {
  .topbar {
    padding: 18px;
    flex-direction: column;
    align-items: flex-start;
  }

  .workspace {
    grid-template-columns: 1fr;
    height: auto;
    padding: 12px;
  }

  .sidebar {
    gap: 10px;
  }

  .conversation {
    min-height: 70vh;
  }

  .messages {
    padding: 16px;
  }

  .message {
    max-width: 100%;
  }
}
