:root {
  color-scheme: light;
  --ink: #202124;
  --muted: #6d7074;
  --line: #c9ccd0;
  --panel: #f1f2f3;
  --paper: #ffffff;
  --accent: #22a9a2;
  --accent-dark: #147c77;
  --green: #2d8138;
  --danger: #a22b2b;
}

* { box-sizing: border-box; }

html, body { margin: 0; min-height: 100%; }

body {
  background: transparent;
  color: var(--ink);
  font-family: Arial, Helvetica, sans-serif;
  font-size: 14px;
  letter-spacing: .025em;
}

button, input, textarea { font: inherit; }

.lounge {
  width: 100%;
  min-height: 590px;
  display: grid;
  grid-template-rows: auto 1fr auto;
  background: var(--panel);
  border: 1px solid #e4e5e6;
}

.lounge-header {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  align-items: flex-start;
  padding: 18px 20px 16px;
  border-bottom: 1px solid var(--line);
}

.eyebrow { margin: 0 0 4px; color: var(--muted); font-size: 11px; text-transform: uppercase; letter-spacing: .12em; }
.status-dot { display: inline-block; width: 8px; height: 8px; margin-right: 6px; border-radius: 50%; background: var(--green); }
h1 { margin: 0; font-size: 22px; line-height: 1.2; letter-spacing: .01em; }
.intro { margin: 5px 0 0; color: var(--muted); }
.live-label { border: 1px solid var(--line); background: var(--paper); padding: 7px 10px; font-size: 11px; text-transform: uppercase; }

.messages {
  min-height: 270px;
  max-height: 370px;
  overflow-y: auto;
  padding: 18px 20px;
  scroll-behavior: smooth;
}

.empty-state { min-height: 240px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; color: var(--muted); text-align: center; }
.empty-icon { width: 42px; height: 42px; display: grid; place-items: center; background: #f3ad00; color: #111; font-size: 22px; font-weight: 800; border: 2px solid #111; box-shadow: 3px 3px 0 #111; margin-bottom: 6px; }
.empty-state strong { color: var(--ink); }

.message { display: grid; grid-template-columns: 38px minmax(0, 1fr); gap: 10px; margin-bottom: 15px; }
.avatar { width: 38px; height: 38px; display: grid; place-items: center; background: var(--accent); color: white; font-weight: 700; text-transform: uppercase; }
.message-content { min-width: 0; }
.message-meta { display: flex; align-items: baseline; gap: 8px; margin-bottom: 4px; }
.message-name { font-weight: 700; overflow-wrap: anywhere; }
.message-time { color: var(--muted); font-size: 11px; }
.message-body { margin: 0; line-height: 1.45; white-space: pre-wrap; overflow-wrap: anywhere; }
.message-image { display: block; max-width: min(100%, 520px); max-height: 340px; margin-top: 8px; border: 1px solid var(--line); object-fit: contain; background: white; cursor: zoom-in; }

.composer { padding: 15px 20px 17px; background: var(--paper); border-top: 1px solid var(--line); }
.form-row { display: grid; grid-template-columns: minmax(180px, 280px) 1fr; gap: 14px; align-items: end; }
label > span { display: block; margin-bottom: 6px; color: var(--muted); font-size: 11px; text-transform: uppercase; letter-spacing: .08em; }
input[type="text"], textarea { width: 100%; border: 1px solid var(--line); border-radius: 0; background: white; color: var(--ink); padding: 10px 11px; outline: none; }
input:focus, textarea:focus { border-color: var(--accent); box-shadow: inset 3px 0 0 var(--accent); }
textarea { resize: vertical; min-height: 66px; max-height: 140px; }
.community-note { padding-bottom: 10px; color: var(--muted); font-size: 12px; text-align: right; }
.message-field { display: block; margin-top: 12px; }
.actions { display: flex; gap: 10px; align-items: center; margin-top: 10px; }
.image-button, .send-button { border: 1px solid var(--line); border-radius: 0; background: white; color: var(--ink); padding: 9px 13px; cursor: pointer; }
.image-button:hover { border-color: var(--ink); }
.send-button { margin-left: auto; border-color: var(--accent-dark); background: var(--accent); color: white; font-weight: 700; min-width: 100px; }
.send-button:hover { background: var(--accent-dark); }
.send-button:disabled { opacity: .55; cursor: wait; }
#counter { color: var(--muted); font-size: 11px; }
.preview { position: relative; width: fit-content; margin-top: 10px; }
.preview img { display: block; max-width: 150px; max-height: 100px; border: 1px solid var(--line); }
.preview button { position: absolute; right: -9px; top: -9px; width: 24px; height: 24px; border: 1px solid var(--line); border-radius: 50%; background: white; cursor: pointer; line-height: 18px; }
.form-status { min-height: 16px; margin: 8px 0 0; color: var(--danger); font-size: 12px; }

@media (max-width: 600px) {
  body { font-size: 13px; }
  .lounge { min-height: 600px; }
  .lounge-header { padding: 15px 12px 13px; }
  h1 { font-size: 19px; }
  .intro { line-height: 1.4; }
  .live-label { display: none; }
  .messages { padding: 15px 12px; max-height: 350px; }
  .composer { padding: 13px 12px 14px; }
  .form-row { grid-template-columns: 1fr; gap: 0; }
  .community-note { display: none; }
  .message-image { max-height: 280px; }
  .actions { flex-wrap: wrap; }
  .send-button { min-width: 88px; }
}

