:root {
  --bg: #f7f4ee;
  --bg-accent: #f0e7da;
  --surface: #ffffff;
  --surface-2: #f9f6f1;
  --ink: #1b1a17;
  --muted: #6f6a60;
  --accent: #d96d2e;
  --accent-2: #2f9c95;
  --shadow: rgba(25, 20, 17, 0.08);
  --radius: 16px;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: "Space Grotesk", "Sora", "Segoe UI", sans-serif;
  color: var(--ink);
  background: radial-gradient(circle at top left, #fff7e9, transparent 45%),
    radial-gradient(circle at 80% 0%, #e9f7f4, transparent 40%),
    linear-gradient(135deg, var(--bg), var(--bg-accent));
  min-height: 100vh;
}

.app {
  max-width: 1200px;
  margin: 32px auto;
  padding: 0 24px 32px;
}

header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 24px;
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: 0 12px 30px var(--shadow);
}

header h2 {
  margin: 0 0 6px;
  font-size: 24px;
  letter-spacing: 0.5px;
}

.status {
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 1px;
  background: #f3d7c3;
  color: #8b3b10;
}

.status.online {
  background: #d6f3ef;
  color: #167c74;
}

.actions button {
  margin-left: 12px;
  border: none;
  padding: 10px 16px;
  border-radius: 999px;
  font-weight: 600;
  background: var(--surface-2);
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.actions button:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 20px var(--shadow);
}

main {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 24px;
  margin-top: 24px;
}

.chat {
  background: var(--surface);
  border-radius: var(--radius);
  box-shadow: 0 12px 30px var(--shadow);
  display: flex;
  flex-direction: column;
  min-height: 520px;
}

.messages {
  padding: 24px;
  flex: 1;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.message {
  display: flex;
  flex-direction: column;
  max-width: 70%;
  animation: slideIn 0.25s ease;
}

.message.other {
  align-self: flex-start;
}

.message.self {
  align-self: flex-end;
  text-align: right;
}

.message .meta {
  font-size: 12px;
  color: var(--muted);
  margin-bottom: 6px;
}

.message .bubble {
  padding: 12px 16px;
  border-radius: 16px;
  background: #fef5ea;
  border: 1px solid #f0d6bf;
}

.message.self .bubble {
  background: #e9f7f4;
  border-color: #bce4df;
}

.message .bubble a {
  color: var(--accent-2);
  font-weight: 600;
  text-decoration: none;
}

.file-size {
  color: var(--muted);
  margin-left: 6px;
}

.composer {
  display: flex;
  gap: 12px;
  padding: 16px 20px 20px;
  border-top: 1px solid #efe5d7;
}

.composer input {
  flex: 1;
  border: 1px solid #e7d8c5;
  border-radius: 999px;
  padding: 10px 16px;
  font-size: 15px;
}

.composer button {
  border: none;
  background: var(--accent);
  color: white;
  padding: 10px 22px;
  border-radius: 999px;
  font-weight: 700;
  cursor: pointer;
}

.files {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.panel {
  background: var(--surface);
  border-radius: var(--radius);
  padding: 20px;
  box-shadow: 0 12px 30px var(--shadow);
}

.panel h3 {
  margin-top: 0;
  margin-bottom: 16px;
}

.file-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.file-row {
  display: flex;
  justify-content: space-between;
  font-size: 14px;
  padding: 8px 10px;
  border-radius: 12px;
  background: #fef8f1;
}

.file-row a {
  color: var(--accent);
  text-decoration: none;
}

.modal {
  position: fixed;
  inset: 0;
  background: rgba(27, 26, 23, 0.35);
  display: flex;
  align-items: center;
  justify-content: center;
  backdrop-filter: blur(6px);
  z-index: 100;
}

.modal-card {
  width: min(420px, 90vw);
  background: var(--surface);
  padding: 32px;
  border-radius: 24px;
  box-shadow: 0 20px 40px var(--shadow);
  display: flex;
  flex-direction: column;
  gap: 16px;
  animation: fadeIn 0.35s ease;
}

.modal-card h1 {
  margin: 0;
}

.modal-card label {
  display: flex;
  flex-direction: column;
  font-size: 14px;
  gap: 6px;
}

.modal-card input {
  border: 1px solid #eadac5;
  border-radius: 12px;
  padding: 10px 12px;
}

.modal-card button {
  border: none;
  background: var(--accent-2);
  color: white;
  padding: 10px 20px;
  border-radius: 999px;
  font-weight: 700;
  cursor: pointer;
}

@keyframes slideIn {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

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

  .message {
    max-width: 100%;
  }
}
