:root {
  --bg: #f7f7f5;
  --panel: #ffffff;
  --ink: #1a1a1a;
  --muted: #6b6b6b;
  --line: #e6e6e2;
  --accent: #2563eb;
  --accent-ink: #ffffff;
  --user: #eef3ff;
  --assistant: #ffffff;
  --danger: #b42318;
  font-family:
    'Segoe UI',
    -apple-system,
    BlinkMacSystemFont,
    'Apple SD Gothic Neo',
    sans-serif;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  height: 100%;
  background: var(--bg);
  color: var(--ink);
}

#app {
  display: flex;
  flex-direction: column;
  height: 100%;
  min-height: 100vh;
}

.top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 12px 14px;
  border-bottom: 1px solid var(--line);
  background: var(--panel);
}

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

.brand-mark {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  background: linear-gradient(145deg, #2563eb, #0f172a);
}

.brand strong {
  display: block;
  font-size: 14px;
  line-height: 1.2;
}

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

.skills {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 10px 12px;
  border-bottom: 1px solid var(--line);
  background: var(--panel);
}

.skills button {
  border: 1px solid var(--line);
  background: #fafafa;
  color: var(--ink);
  border-radius: 999px;
  padding: 5px 10px;
  font-size: 12px;
  cursor: pointer;
}

.skills button:hover {
  border-color: #c7d2fe;
  background: #eff6ff;
}

.messages {
  flex: 1;
  overflow: auto;
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.bubble {
  max-width: 100%;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 10px 12px;
  white-space: pre-wrap;
  word-break: break-word;
  font-size: 13px;
  line-height: 1.45;
  background: var(--assistant);
}

.bubble.user {
  background: var(--user);
  border-color: #dbe4ff;
  align-self: flex-end;
}

.bubble.system {
  background: #f3f4f6;
  color: var(--muted);
  font-size: 12px;
}

.composer {
  border-top: 1px solid var(--line);
  background: var(--panel);
  padding: 10px 12px 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.attach-row {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: var(--muted);
}

#prompt {
  width: 100%;
  resize: vertical;
  min-height: 72px;
  max-height: 180px;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 10px;
  font: inherit;
  font-size: 13px;
  background: #fff;
}

.composer-row,
.action-row {
  display: flex;
  gap: 8px;
  align-items: center;
}

.composer-row select {
  flex: 1;
  min-width: 0;
  height: 34px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 8px;
  background: #fff;
  font-size: 12px;
}

button {
  font: inherit;
}

button.primary {
  border: none;
  background: var(--accent);
  color: var(--accent-ink);
  border-radius: 8px;
  padding: 0 14px;
  height: 34px;
  cursor: pointer;
  white-space: nowrap;
}

button.primary:disabled {
  opacity: 0.55;
  cursor: default;
}

button.ghost {
  border: 1px solid var(--line);
  background: #fff;
  color: var(--ink);
  border-radius: 8px;
  padding: 6px 10px;
  font-size: 12px;
  cursor: pointer;
}

.action-row {
  flex-wrap: wrap;
}

.status {
  margin: 0;
  min-height: 16px;
  font-size: 11px;
  color: var(--muted);
}

.status.error {
  color: var(--danger);
}

.empty {
  margin: auto;
  text-align: center;
  color: var(--muted);
  font-size: 13px;
  padding: 24px 12px;
}
