:root {
  font-family: Inter, system-ui, sans-serif;
  color: #17243b;
  background: #eaf0f5;
}

* { box-sizing: border-box; }

body {
  min-height: 100vh;
  margin: 0;
  display: grid;
  place-items: center;
  padding: 24px;
  background:
    radial-gradient(circle at top left, #ccdce8, transparent 35%),
    #eaf0f5;
}

.shell {
  width: min(900px, 100%);
  height: min(820px, calc(100vh - 48px));
  display: grid;
  grid-template-rows: auto 1fr auto auto;
  gap: 18px;
  padding: 24px;
  border: 1px solid #b8cdd9;
  border-radius: 24px;
  background: rgba(255, 255, 255, .9);
  box-shadow: 0 24px 70px rgba(0, 58, 93, .12);
}

header {
  display: flex;
  gap: 16px;
  align-items: center;
}

.mark {
  display: grid;
  place-items: center;
  width: 70px;
  height: 70px;
  border-radius: 18px;
  color: white;
  background: #003A5D;
  font-weight: 800;
}

h1 { margin: 0 0 4px; font-size: clamp(22px, 4vw, 34px); }
p { margin: 0; color: #5e6d68; }

.messages {
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 18px;
  border-radius: 18px;
  background: #f2f6f9;
}

.message {
  max-width: 82%;
  padding: 13px 16px;
  border-radius: 16px;
  white-space: pre-wrap;
  line-height: 1.5;
}

.assistant { align-self: flex-start; background: white; border: 1px solid #c8dae6; }
.user { align-self: flex-end; color: white; background: #003A5D; }

.assistant a, .user a {
  color: inherit;
  text-decoration: underline;
  word-break: break-all;
}

form { display: grid; grid-template-columns: 1fr auto; gap: 12px; }

textarea {
  resize: none;
  padding: 14px;
  border: 1px solid #b8cdd9;
  border-radius: 14px;
  font: inherit;
}

button {
  padding: 0 22px;
  border: 0;
  border-radius: 14px;
  color: white;
  background: #003A5D;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}

button:hover { background: #002d49; }

@media (max-width: 600px) {
  body { padding: 0; }
  .shell { height: 100vh; border-radius: 0; padding: 16px; }
  .mark { width: 54px; height: 54px; border-radius: 14px; }
  form { grid-template-columns: 1fr; }
  button { min-height: 48px; }
}

.n8n-status {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: #5e6d68;
}

.status-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #c0ccc8;
  flex-shrink: 0;
  transition: background .4s;
}

.status-dot.ok  { background: #003A5D; }
.status-dot.err { background: #e74c3c; }
