:root {
  color-scheme: light;
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: #f5f7fb;
  color: #1d2433;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
}

button,
select,
textarea {
  font: inherit;
}

.shell {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.topbar {
  min-height: 76px;
  padding: 18px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  background: #ffffff;
  border-bottom: 1px solid #dfe5ef;
}

h1 {
  margin: 0;
  font-size: 20px;
  line-height: 1.2;
  letter-spacing: 0;
}

#status {
  margin: 6px 0 0;
  color: #64748b;
  font-size: 13px;
}

.workspace {
  flex: 1;
  display: grid;
  grid-template-columns: 320px minmax(0, 1fr);
  min-height: 0;
}

.sidebar {
  padding: 18px;
  background: #f9fbfe;
  border-right: 1px solid #dfe5ef;
  min-width: 0;
}

label,
.files-title {
  display: block;
  margin-bottom: 8px;
  font-size: 12px;
  color: #64748b;
  font-weight: 700;
  text-transform: uppercase;
}

select,
textarea {
  width: 100%;
  border: 1px solid #cbd5e1;
  border-radius: 6px;
  background: #ffffff;
  color: #1d2433;
}

select {
  height: 38px;
  padding: 0 10px;
}

.files {
  margin-top: 22px;
}

#fileList {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 4px;
  max-height: calc(100vh - 180px);
  overflow: auto;
}

#fileList li {
  padding: 7px 8px;
  border-radius: 5px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 12px;
  overflow-wrap: anywhere;
  cursor: pointer;
}

#fileList li:hover {
  background: #e8eef8;
}

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

.messages {
  padding: 22px 24px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  overflow: auto;
}

.message {
  max-width: 920px;
  padding: 14px 16px;
  border: 1px solid #dfe5ef;
  border-radius: 8px;
  background: #ffffff;
  white-space: pre-wrap;
  line-height: 1.55;
}

.message.user {
  align-self: flex-end;
  background: #edf7f3;
  border-color: #b7d8cc;
}

.message.system {
  color: #64748b;
  background: transparent;
  border-color: transparent;
  padding: 4px 0;
}

.composer {
  padding: 16px 24px 22px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 92px;
  gap: 12px;
  background: #ffffff;
  border-top: 1px solid #dfe5ef;
}

textarea {
  resize: vertical;
  min-height: 84px;
  max-height: 220px;
  padding: 11px 12px;
}

button {
  border: 1px solid #21324a;
  border-radius: 6px;
  background: #21324a;
  color: white;
  cursor: pointer;
}

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

#syncButton {
  height: 36px;
  padding: 0 14px;
}

@media (max-width: 820px) {
  .workspace {
    grid-template-columns: 1fr;
  }

  .sidebar {
    border-right: 0;
    border-bottom: 1px solid #dfe5ef;
  }

  #fileList {
    max-height: 180px;
  }

  .composer {
    grid-template-columns: 1fr;
  }

  button {
    height: 40px;
  }
}
