:root {
  color-scheme: light;
  --ink: #202124;
  --muted: #61646b;
  --line: #d7d9dd;
  --bg: #f7f8fa;
  --panel: #ffffff;
  --accent: #0b6bcb;
  --accent-ink: #ffffff;
  --danger: #b3261e;
}

* {
  box-sizing: border-box;
}

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

button,
input {
  font: inherit;
}

button {
  border: 1px solid var(--accent);
  border-radius: 8px;
  background: var(--accent);
  color: var(--accent-ink);
  padding: 10px 14px;
  cursor: pointer;
}

button.secondary {
  background: var(--panel);
  color: var(--accent);
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.55;
}

label {
  display: grid;
  gap: 6px;
  color: var(--muted);
}

input {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px 12px;
  color: var(--ink);
  background: #fff;
}

.app {
  min-height: 100vh;
}

.auth {
  width: min(1120px, 100%);
  margin: 0 auto;
  padding: 48px 20px;
  display: grid;
  grid-template-columns: 1fr 360px 360px;
  gap: 20px;
  align-items: start;
}

.eyebrow,
.muted {
  color: var(--muted);
}

.intro {
  max-width: 560px;
  color: var(--muted);
  line-height: 1.55;
}

.panel,
.tools,
.profile,
.chat-header,
.composer {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
}

.panel,
.tools {
  padding: 18px;
  display: grid;
  gap: 14px;
}

.main {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 360px 1fr;
}

.sidebar {
  border-right: 1px solid var(--line);
  background: #fff;
  padding: 18px;
  overflow-y: auto;
}

.profile {
  padding: 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.profile-name {
  margin: 0;
  font-weight: 700;
}

.list {
  display: grid;
  gap: 8px;
  margin-bottom: 22px;
}

.item {
  width: 100%;
  text-align: left;
  background: #fff;
  color: var(--ink);
  border: 1px solid var(--line);
}

.item.active {
  border-color: var(--accent);
}

.item small {
  display: block;
  color: var(--muted);
  margin-top: 4px;
}

.chat {
  min-width: 0;
  display: grid;
  grid-template-rows: auto 1fr auto;
}

.chat-header {
  margin: 18px;
  padding: 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.chat-header h2 {
  margin: 0;
}

.call-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.messages {
  padding: 0 18px 18px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.message {
  max-width: min(640px, 82%);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px 12px;
  background: #fff;
}

.message.mine {
  align-self: flex-end;
  border-color: var(--accent);
}

.message small {
  display: block;
  color: var(--muted);
  margin-top: 6px;
}

.composer {
  margin: 0 18px 18px;
  padding: 12px;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
}

.toast {
  position: fixed;
  right: 16px;
  bottom: 16px;
  max-width: min(420px, calc(100vw - 32px));
  border-radius: 8px;
  padding: 12px 14px;
  background: var(--ink);
  color: #fff;
}

.modal {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.4);
  display: grid;
  place-items: center;
  padding: 16px;
  z-index: 40;
}

.modal-card {
  width: min(420px, 100%);
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 18px;
  display: grid;
  gap: 12px;
}

.modal-card h3 {
  margin: 0;
}

.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}

.mono {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
}

.hidden {
  display: none !important;
}

@media (max-width: 900px) {
  .auth,
  .main {
    grid-template-columns: 1fr;
  }

  .sidebar {
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }
}
