:root {
  font-family:
    Inter,
    ui-sans-serif,
    system-ui,
    -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    sans-serif;
  color-scheme: dark;
  background: #090b0f;
  color: #f3f5f7;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(
      circle at top left,
      rgba(188, 24, 43, 0.20),
      transparent 35%
    ),
    radial-gradient(
      circle at top right,
      rgba(116, 7, 20, 0.16),
      transparent 30%
    ),
    #090b0f;
}

button,
textarea {
  font: inherit;
}

.app-shell {
  width: min(1050px, 100%);
  min-height: 100vh;
  margin: 0 auto;
  padding: 28px 22px 18px;
  display: grid;
  grid-template-rows: auto 1fr auto auto;
  gap: 18px;
}

.topbar {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
}

.eyebrow {
  margin: 0 0 6px;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #ff5a67;
}

h1 {
  margin: 0;
  font-size: clamp(1.55rem, 4vw, 2.25rem);
}

.subtitle {
  margin: 8px 0 0;
  color: #9da6b4;
}

.chat {
  min-height: 0;
  overflow-y: auto;
  padding: 22px;
  border: 1px solid #332329;
  border-radius: 20px;
  background: rgba(13, 15, 20, 0.92);
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.22);
}

.message {
  width: fit-content;
  max-width: min(82%, 780px);
  margin-bottom: 18px;
  padding: 14px 16px;
  border-radius: 16px;
  line-height: 1.55;
}

.assistant-message {
  margin-right: auto;
  background: #191b22;
  border: 1px solid #34282d;
}

.user-message {
  margin-left: auto;
  background: linear-gradient(135deg, #b21f32, #7d1020);
}

.message-label {
  margin-bottom: 6px;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  opacity: 0.68;
}

.message-content {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.thinking {
  opacity: 0.72;
}

.composer {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 12px;
  padding: 10px;
  border: 1px solid #39262c;
  border-radius: 18px;
  background: #111319;
}

textarea {
  width: 100%;
  min-height: 48px;
  max-height: 180px;
  resize: none;
  padding: 13px 14px;
  border: 0;
  outline: 0;
  background: transparent;
  color: #f3f5f7;
}

textarea::placeholder {
  color: #747e8d;
}

.send-button,
.secondary-button {
  border: 0;
  border-radius: 12px;
  cursor: pointer;
  transition:
    transform 0.15s ease,
    opacity 0.15s ease;
}

.send-button {
  align-self: end;
  min-width: 92px;
  height: 48px;
  padding: 0 18px;
  background: linear-gradient(135deg, #d52b40, #a41428);
  color: white;
  font-weight: 700;
}

.secondary-button {
  padding: 10px 14px;
  background: #191b21;
  color: #dce1e8;
  border: 1px solid #3a2a30;
}

button:hover:not(:disabled) {
  transform: translateY(-1px);
}

button:disabled {
  cursor: wait;
  opacity: 0.55;
}

.status {
  margin: -8px 4px 0;
  color: #717b8a;
  font-size: 0.8rem;
}

@media (max-width: 700px) {
  .app-shell {
    padding: 18px 12px 12px;
  }

  .topbar {
    display: block;
  }

  .secondary-button {
    margin-top: 14px;
  }

  .chat {
    padding: 14px;
  }

  .message {
    max-width: 92%;
  }

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

  .send-button {
    width: 100%;
  }
}

.mic-button {
  align-self: end;
  width: 48px;
  height: 48px;
  border: 1px solid #3a2a30;
  border-radius: 12px;
  background: #191b21;
  color: white;
  font-size: 1.25rem;
  cursor: pointer;
}

.mic-button:hover:not(:disabled) {
  background: #2a2024;
}

.mic-button.recording {
  background: #d52b40;
  border-color: #ff6675;
}


/* Red accent polish */
.send-button:hover:not(:disabled) {
  box-shadow: 0 8px 24px rgba(213, 43, 64, 0.28);
}

.secondary-button:hover:not(:disabled),
.mic-button:hover:not(:disabled) {
  border-color: #7f2a37;
}

textarea:focus {
  caret-color: #ff5a67;
}

.composer:focus-within {
  border-color: #7f2a37;
  box-shadow: 0 0 0 3px rgba(213, 43, 64, 0.08);
}

::selection {
  background: rgba(213, 43, 64, 0.42);
  color: #fff;
}
