:root {
  color-scheme: light;
  --bg: #f6f8f6;
  --surface: #ffffff;
  --surface-muted: #edf3f1;
  --ink: #18211c;
  --muted: #5a665f;
  --line: #d9ded7;
  --accent: #19675d;
  --accent-strong: #124b44;
  --accent-soft: #dcefed;
  --focus: #a8d8d2;
  --shadow: 0 16px 44px rgba(24, 33, 28, 0.1);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--ink);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  line-height: 1.5;
}

a {
  color: inherit;
}

button,
textarea {
  font: inherit;
}

button {
  cursor: pointer;
}

.shell {
  width: min(1120px, calc(100% - 32px));
  min-height: 100vh;
  margin: 0 auto;
  padding: 28px 0 32px;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  gap: 20px;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--line);
}

.brand-lockup {
  display: grid;
  grid-template-columns: 40px minmax(0, 1fr);
  gap: 12px;
  align-items: center;
  min-width: 0;
  text-decoration: none;
}

.brand-logo {
  width: 40px;
  height: 40px;
  object-fit: contain;
  padding: 5px;
  border-radius: 6px;
  background: var(--accent);
}

.eyebrow,
.section-label {
  margin: 0 0 6px;
  color: var(--accent);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0;
  text-transform: uppercase;
}

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

h1 {
  margin-bottom: 0;
  font-size: 1.35rem;
  line-height: 1.1;
  letter-spacing: 0;
}

h2 {
  margin: 0;
  font-size: clamp(1.6rem, 4vw, 2.6rem);
  line-height: 1.05;
  letter-spacing: 0;
}

.nav-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: flex-end;
}

.secondary-link {
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--surface);
  color: var(--accent);
  font-weight: 700;
  padding: 0 16px;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.secondary-link:hover {
  border-color: var(--accent);
  color: var(--accent-strong);
}

.chat-panel {
  min-height: 0;
  display: grid;
  grid-template-rows: auto minmax(220px, 1fr) auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.chat-heading {
  padding: 20px 22px;
  border-bottom: 1px solid var(--line);
}

.chat-log {
  min-height: 0;
  overflow: auto;
  padding: 18px;
  display: grid;
  align-content: start;
  gap: 12px;
  background: var(--surface-muted);
}

.chat-message {
  max-width: min(760px, 92%);
  border-radius: 8px;
  padding: 11px 13px;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.chat-message-assistant {
  justify-self: start;
  background: var(--surface);
  border: 1px solid var(--line);
}

.chat-message-assistant a {
  color: var(--accent);
  text-decoration: underline;
}

.chat-message-user {
  justify-self: end;
  background: var(--accent);
  color: #ffffff;
}

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

.chat-form textarea {
  min-width: 0;
  min-height: 52px;
  max-height: 160px;
  resize: vertical;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 10px 12px;
  color: var(--ink);
}

.chat-form textarea:focus {
  outline: 3px solid var(--focus);
  border-color: var(--accent);
}

.chat-form button {
  min-height: 52px;
  border: 0;
  border-radius: 6px;
  background: var(--accent);
  color: #ffffff;
  font-weight: 700;
  padding: 0 22px;
}

.chat-form button:hover {
  background: var(--accent-strong);
}

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

@media (max-width: 760px) {
  .topbar,
  .nav-actions,
  .chat-form {
    display: grid;
    grid-template-columns: 1fr;
  }
}
