:root {
  color-scheme: light;
  --ink: #17202a;
  --muted: #627080;
  --line: #d9e0e8;
  --panel: #f7f9fb;
  --paper: #ffffff;
  --accent: #0d766e;
  --accent-dark: #075e58;
  --warn: #b7791f;
  --bad: #b42318;
  --assistant: #eef6f5;
  --user: #f3efe7;
  --shadow: 0 18px 50px rgba(23, 32, 42, 0.12);
}

* {
  box-sizing: border-box;
}

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

button,
input,
textarea {
  font: inherit;
}

button {
  border: 0;
  border-radius: 6px;
  background: var(--accent);
  color: #fff;
  cursor: pointer;
  font-weight: 700;
}

button:hover {
  background: var(--accent-dark);
}

button:disabled {
  cursor: wait;
  opacity: 0.72;
}

.app-shell {
  display: grid;
  grid-template-columns: minmax(260px, 320px) minmax(0, 1fr);
  min-height: 100vh;
}

.side-panel {
  display: flex;
  flex-direction: column;
  gap: 24px;
  padding: 28px;
  background: var(--panel);
  border-right: 1px solid var(--line);
}

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

.mark {
  display: grid;
  place-items: center;
  width: 46px;
  height: 46px;
  border-radius: 8px;
  background: #17202a;
  color: #fff;
  font-weight: 800;
}

.brand h1 {
  margin: 0;
  font-size: 1.3rem;
  line-height: 1.15;
}

.brand p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 0.9rem;
}

.access-form {
  display: grid;
  gap: 10px;
}

.access-form label {
  color: var(--muted);
  font-size: 0.86rem;
  font-weight: 700;
}

.access-form input,
.composer textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  color: var(--ink);
  outline: 0;
}

.access-form input {
  height: 42px;
  padding: 0 12px;
}

.access-form button,
.actions button,
.composer button {
  min-height: 42px;
  padding: 0 14px;
}

.status-group {
  display: grid;
  gap: 8px;
  color: var(--muted);
}

.status-line {
  display: flex;
  align-items: center;
  gap: 9px;
  font-weight: 700;
  color: var(--ink);
}

.status-dot {
  width: 10px;
  height: 10px;
  border-radius: 999px;
  background: var(--muted);
}

.status-dot[data-kind="ok"] {
  background: var(--accent);
}

.status-dot[data-kind="warn"],
.status-dot[data-kind="pending"] {
  background: var(--warn);
}

.status-dot[data-kind="bad"] {
  background: var(--bad);
}

.model-line {
  font-size: 0.9rem;
}

.actions {
  display: grid;
  gap: 10px;
  margin-top: auto;
}

.actions button {
  background: #263747;
}

.actions button:hover {
  background: #17202a;
}

.chat-panel {
  display: grid;
  grid-template-rows: minmax(0, 1fr) auto;
  min-width: 0;
  background: var(--paper);
}

.messages {
  display: flex;
  flex-direction: column;
  gap: 14px;
  overflow-y: auto;
  padding: 34px min(5vw, 64px);
}

.message {
  max-width: 880px;
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
  overflow: hidden;
}

.message.user {
  align-self: flex-end;
  background: var(--user);
}

.message.assistant {
  align-self: flex-start;
  background: var(--assistant);
}

.message-label {
  padding: 10px 14px 0;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 800;
}

.message-body {
  padding: 10px 14px 14px;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  line-height: 1.58;
}

.composer {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 96px;
  gap: 12px;
  padding: 18px min(5vw, 64px) 24px;
  border-top: 1px solid var(--line);
  background: #f7f9fb;
}

.composer textarea {
  min-height: 72px;
  max-height: 180px;
  resize: vertical;
  padding: 12px;
  line-height: 1.45;
}

.composer button {
  align-self: stretch;
}

@media (max-width: 760px) {
  .app-shell {
    grid-template-columns: 1fr;
  }

  .side-panel {
    padding: 18px;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .actions {
    grid-template-columns: 1fr 1fr;
    margin-top: 0;
  }

  .messages {
    padding: 20px;
  }

  .composer {
    grid-template-columns: 1fr;
    padding: 14px 20px 18px;
  }
}
