:root {
  color-scheme: dark;
  --ink: #f4f6fb;
  --muted: #a7b0c1;
  --line: rgba(255, 255, 255, .1);
  --panel: #151e2f;
  --panel-soft: #1d2940;
  --accent: #f4c95d;
  --accent-strong: #e9aa33;
  --green: #65e3a2;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  font-family: "DM Sans", sans-serif;
  background: #0d1421;
  background-image: radial-gradient(circle at 14% 12%, rgba(56, 90, 139, .25), transparent 30%), radial-gradient(circle at 90% 90%, rgba(232, 167, 49, .12), transparent 32%);
}

button, input { font: inherit; }
button { cursor: pointer; }
.app-shell { width: min(1180px, calc(100% - 40px)); min-height: 100vh; margin: auto; display: grid; place-items: center; padding: 50px 0; }
.welcome-card, .chat-card { width: 100%; border: 1px solid var(--line); background: rgba(21, 30, 47, .95); box-shadow: 0 28px 80px rgba(0, 0, 0, .3); border-radius: 28px; overflow: hidden; }
.welcome-card { max-width: 590px; padding: 58px; text-align: left; }
.brand-mark { width: 52px; height: 52px; display: grid; place-items: center; border-radius: 16px; color: #172033; background: var(--accent); font-family: "Space Grotesk", sans-serif; font-weight: 700; letter-spacing: -.08em; }
.brand-mark.small { width: 42px; height: 42px; border-radius: 13px; font-size: 14px; flex: 0 0 auto; }
.eyebrow, .panel-label { margin: 0; color: var(--accent); font-size: 11px; font-weight: 700; letter-spacing: .18em; }
.welcome-card .eyebrow { margin-top: 52px; }
h1 { margin: 13px 0 0; font-family: "Space Grotesk", sans-serif; font-size: clamp(42px, 8vw, 74px); line-height: .96; letter-spacing: -.07em; }
h1 span { color: var(--accent); }
.intro { max-width: 430px; margin: 25px 0 42px; color: var(--muted); font-size: 17px; line-height: 1.55; }
.join-form label { display: block; margin-bottom: 10px; font-size: 13px; font-weight: 600; }
.input-row { display: flex; gap: 10px; }
input { min-width: 0; color: var(--ink); background: #0e1727; border: 1px solid var(--line); outline: none; border-radius: 13px; padding: 15px 16px; transition: border-color .2s, box-shadow .2s; }
input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(244, 201, 93, .12); }
.input-row input { flex: 1; }
button { border: 0; border-radius: 13px; color: #172033; background: var(--accent); padding: 0 20px; font-weight: 700; transition: transform .2s, background .2s; }
button:hover { background: var(--accent-strong); transform: translateY(-1px); }
.input-row button span { margin-left: 12px; font-size: 20px; }
.form-note { margin: 12px 0 0; color: #7f8ba0; font-size: 12px; }
.is-hidden { display: none; }
.chat-header { display: flex; align-items: center; justify-content: space-between; padding: 24px 30px; border-bottom: 1px solid var(--line); }
.header-title { display: flex; align-items: center; gap: 14px; }
.header-title h1 { margin-top: 5px; font-size: 22px; letter-spacing: -.04em; }
.presence { color: var(--muted); font-size: 13px; }
.online-dot { width: 8px; height: 8px; display: inline-block; margin-right: 7px; border-radius: 50%; background: var(--green); box-shadow: 0 0 0 4px rgba(101, 227, 162, .1); }
.chat-layout { min-height: 620px; display: grid; grid-template-columns: 230px 1fr; }
.people-panel { padding: 28px 24px; border-right: 1px solid var(--line); background: rgba(13, 20, 33, .27); }
.people-list { display: flex; flex-direction: column; gap: 12px; padding: 20px 0; margin: 0; list-style: none; }
.person { display: flex; align-items: center; gap: 10px; color: #d9deea; font-size: 14px; overflow: hidden; }
.avatar { width: 28px; height: 28px; display: grid; place-items: center; flex: 0 0 auto; border-radius: 9px; color: #172033; background: var(--accent); font-size: 11px; font-weight: 700; }
.person-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.privacy-note { display: flex; gap: 9px; margin-top: auto; padding-top: 170px; color: #7f8ba0; font-size: 11px; line-height: 1.45; }
.privacy-note span { color: var(--accent); font-size: 14px; }
.privacy-note p { margin: 0; }
.conversation { min-width: 0; display: flex; flex-direction: column; }
.messages { flex: 1; display: flex; flex-direction: column; gap: 15px; overflow-y: auto; padding: 28px 30px; }
.empty-state { display: grid; place-items: center; height: 100%; min-height: 350px; color: #7f8ba0; text-align: center; font-size: 14px; }
.empty-state strong { display: block; margin-bottom: 6px; color: var(--ink); font-family: "Space Grotesk", sans-serif; font-size: 20px; }
.message { max-width: min(75%, 620px); align-self: flex-start; }
.message.mine { align-self: flex-end; }
.message-meta { display: flex; align-items: baseline; gap: 9px; margin-bottom: 5px; color: #c4ccda; font-size: 12px; }
.mine .message-meta { justify-content: flex-end; }
.time { color: #718097; font-size: 10px; }
.bubble { padding: 12px 15px; border: 1px solid var(--line); border-radius: 4px 16px 16px 16px; color: #e9edf5; background: var(--panel-soft); line-height: 1.45; overflow-wrap: anywhere; }
.mine .bubble { border-color: rgba(244, 201, 93, .25); border-radius: 16px 4px 16px 16px; color: #1c2433; background: var(--accent); }
.system-message { align-self: center; color: #718097; font-size: 11px; font-style: italic; }
.message-form { display: flex; gap: 10px; padding: 18px 30px 24px; border-top: 1px solid var(--line); }
.message-form input { flex: 1; }
.message-form button { width: 50px; padding: 0; font-size: 23px; }

@media (max-width: 680px) {
  .app-shell { width: min(100% - 20px, 1180px); padding: 10px 0; }
  .welcome-card { padding: 35px 25px; border-radius: 21px; }
  .welcome-card .eyebrow { margin-top: 35px; }
  .input-row { flex-direction: column; }
  .input-row button { min-height: 50px; }
  .chat-card { border-radius: 21px; }
  .chat-header { padding: 18px; }
  .header-title h1 { font-size: 18px; }
  .chat-layout { display: block; min-height: calc(100vh - 110px); }
  .people-panel { display: none; }
  .messages { padding: 22px 17px; }
  .message { max-width: 88%; }
  .message-form { padding: 14px 17px 18px; }
}
