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

* { box-sizing: border-box; }
body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(circle at 15% 0%, rgba(54, 218, 141, .14), transparent 32rem),
    linear-gradient(160deg, #0a1511 0%, #050908 78%);
}
button, input, textarea { font: inherit; }
button { cursor: pointer; }

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

header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 24px;
}
.brand { display: flex; align-items: center; gap: 13px; }
.signal {
  width: 13px; height: 13px; border-radius: 50%;
  background: #35df91;
  box-shadow: 0 0 0 7px rgba(53, 223, 145, .11), 0 0 28px rgba(53, 223, 145, .55);
}
.eyebrow, .kicker {
  margin: 0 0 3px;
  color: #83a894;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .11em;
  text-transform: uppercase;
}
h1 { margin: 0; font-size: clamp(19px, 3vw, 25px); letter-spacing: -.03em; }
.status {
  padding: 9px 13px;
  border: 1px solid #243d32;
  border-radius: 999px;
  color: #8eaa9c;
  background: rgba(11, 24, 18, .68);
  font-size: 13px;
}
.status.online { color: #72eab0; border-color: #245d43; }

.gate {
  align-self: center;
  width: min(520px, 100%);
  margin: 0 auto;
  padding: clamp(28px, 5vw, 48px);
  border: 1px solid #1f3c2f;
  border-radius: 28px;
  background: rgba(12, 24, 19, .85);
  box-shadow: 0 30px 90px rgba(0,0,0,.34);
}
.gate h2, .welcome h2 { margin: 8px 0 12px; letter-spacing: -.035em; font-size: clamp(27px, 5vw, 42px); }
.gate > p:not(.kicker), .welcome p { color: #95ad9f; line-height: 1.6; }
.gate form { margin-top: 28px; }
.gate label { display: block; margin-bottom: 8px; color: #b8cabf; font-size: 14px; }
.inputRow { display: grid; grid-template-columns: 1fr auto; gap: 10px; }
input, textarea {
  width: 100%;
  border: 1px solid #29493a;
  border-radius: 14px;
  outline: 0;
  color: #f4fff8;
  background: #08120e;
}
input { padding: 13px 15px; }
textarea { padding: 17px 18px; resize: vertical; min-height: 96px; line-height: 1.5; }
input:focus, textarea:focus { border-color: #3dcf8a; box-shadow: 0 0 0 3px rgba(61, 207, 138, .12); }
button {
  border: 0;
  border-radius: 13px;
  padding: 12px 18px;
  color: #042015;
  background: #4de49a;
  font-weight: 800;
}
button:hover { background: #68eda9; }
button:disabled { cursor: wait; opacity: .6; }
.error { min-height: 22px; color: #ff8d8d !important; font-size: 13px; }

.desk {
  min-height: 0;
  display: grid;
  grid-template-rows: 1fr auto;
  gap: 14px;
}
.conversation {
  min-height: 420px;
  overflow: auto;
  padding: clamp(20px, 4vw, 42px);
  border: 1px solid #193529;
  border-radius: 26px;
  background: rgba(8, 17, 13, .72);
}
.welcome { max-width: 620px; margin: 11vh auto 0; text-align: center; }
.welcome > span {
  display: inline-block;
  padding: 7px 11px;
  border: 1px solid #28543e;
  border-radius: 999px;
  color: #6fe4aa;
  font-size: 12px;
}
.message {
  max-width: 780px;
  margin: 0 0 18px;
  padding: 18px 20px;
  border: 1px solid #1d3b2e;
  border-radius: 18px;
  background: #0d1b15;
}
.message.user { margin-left: auto; background: #153525; border-color: #275a40; }
.message.activity { color: #a7bcb0; font-size: 14px; }
.message.error { color: #ffaaaa; border-color: #643333; background: #241111; }
.message > span { display: block; margin-bottom: 8px; color: #69dfa6; font-size: 11px; font-weight: 800; text-transform: uppercase; letter-spacing: .1em; }
.message > div { white-space: pre-wrap; line-height: 1.58; }

.composer {
  padding: 12px;
  border: 1px solid #234334;
  border-radius: 22px;
  background: #0c1813;
  box-shadow: 0 18px 55px rgba(0,0,0,.3);
}
.imagePreview {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(92px, 1fr));
  gap: 10px;
  margin-top: 10px;
}
.imageCard {
  position: relative;
  overflow: hidden;
  min-height: 92px;
  margin: 0;
  border: 1px solid #2b5743;
  border-radius: 14px;
  background: #07100d;
}
.imageCard img {
  display: block;
  width: 100%;
  height: 108px;
  object-fit: cover;
}
.removeImage {
  position: absolute;
  top: 6px;
  right: 6px;
  width: 30px;
  height: 30px;
  padding: 0;
  border: 1px solid rgba(255,255,255,.25);
  border-radius: 50%;
  color: white;
  background: rgba(5, 9, 8, .82);
  font-size: 23px;
  font-weight: 500;
  line-height: 1;
}
.removeImage:hover { background: #7e2929; }
.uploadError {
  min-height: 18px;
  margin: 6px 4px 0;
  color: #ff9999;
  font-size: 13px;
}
.actions { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-top: 10px; }
.leftActions { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.attachButton {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 42px;
  padding: 9px 13px;
  border: 1px solid #315542;
  border-radius: 12px;
  color: #c6e4d3;
  background: #10251b;
  cursor: pointer;
  font-size: 13px;
  font-weight: 750;
}
.attachButton:hover { border-color: #49bd82; background: #153324; }
.attachButton > span:first-child { color: #58e39e; font-size: 20px; line-height: 1; }
.fileInput {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  opacity: 0;
  pointer-events: none;
}
.check { display: flex; align-items: center; gap: 8px; color: #9cb1a5; font-size: 13px; }
.check input { width: 16px; height: 16px; }
.hidden { display: none !important; }
.srOnly { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0,0,0,0); }

@media (max-width: 640px) {
  .shell { width: min(100% - 18px, 1040px); padding: 16px 0; }
  header { align-items: flex-start; }
  .status { padding: 7px 10px; }
  .inputRow { grid-template-columns: 1fr; }
  .conversation { min-height: 55vh; }
  .actions { align-items: stretch; flex-direction: column; }
  .leftActions { justify-content: space-between; }
  .attachButton { flex: 1; justify-content: center; }
  .actions button { width: 100%; }
}
