:root {
  color-scheme: dark;
  font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: #06110e;
  color: #eefbf6;
  --panel: rgba(14, 36, 30, 0.88);
  --line: rgba(174, 238, 214, 0.13);
  --muted: #9fb9ae;
  --accent: #4ee2a5;
}
* { box-sizing: border-box; }
body { margin: 0; min-height: 100vh; background: radial-gradient(circle at 15% -10%, #164838 0, transparent 36rem), #06110e; }
header { display: flex; justify-content: space-between; align-items: center; padding: calc(1.4rem + env(safe-area-inset-top)) max(1.2rem, env(safe-area-inset-right)) 1.2rem max(1.2rem, env(safe-area-inset-left)); border-bottom: 1px solid var(--line); }
h1, h2, p { margin-top: 0; }
h1 { font-size: clamp(1.65rem, 5vw, 2.35rem); margin-bottom: 0; letter-spacing: -0.04em; }
h2 { font-size: 1.05rem; }
.eyebrow { color: var(--accent); font-size: .7rem; font-weight: 800; letter-spacing: .15em; }
main { width: min(1100px, calc(100% - 2rem)); margin: 1.5rem auto; }
.card { background: var(--panel); border: 1px solid var(--line); border-radius: 1.2rem; box-shadow: 0 20px 55px rgba(0,0,0,.22); backdrop-filter: blur(14px); }
.login-card { max-width: 430px; margin: 8vh auto; padding: 1.4rem; }
.login-card p, footer { color: var(--muted); line-height: 1.55; }
label { display: block; color: var(--muted); font-size: .8rem; margin-bottom: .45rem; }
input, button { font: inherit; border-radius: .8rem; }
input { width: 100%; border: 1px solid var(--line); padding: .85rem 1rem; color: inherit; background: rgba(2, 13, 10, .75); outline: none; }
input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(78,226,165,.12); }
button { border: 0; padding: .82rem 1rem; font-weight: 750; cursor: pointer; color: #03120c; background: var(--accent); }
.login-card button { width: 100%; margin-top: .8rem; }
.ghost { width: auto; color: #dff8ee; background: rgba(255,255,255,.06); border: 1px solid var(--line); }
.toolbar { display: flex; justify-content: space-between; align-items: center; padding: .8rem 1rem; margin-bottom: 1rem; }
.dot { width: .65rem; height: .65rem; display: inline-block; border-radius: 50%; background: #e7a33d; margin-right: .5rem; }
.dot.online { background: var(--accent); box-shadow: 0 0 18px var(--accent); }
.search { display: grid; grid-template-columns: 1fr auto; gap: .6rem; margin-bottom: 1rem; }
.layout { display: grid; grid-template-columns: minmax(250px, .8fr) minmax(0, 1.6fr); gap: 1rem; }
.panel { min-height: 58vh; overflow: hidden; }
.panel > h2, .messages-head { padding: 1rem 1rem 0; }
.list { max-height: 66vh; overflow-y: auto; }
.chat { width: 100%; display: block; text-align: left; border-radius: 0; border-top: 1px solid var(--line); color: inherit; background: transparent; padding: .9rem 1rem; }
.chat:hover, .chat.active { background: rgba(78,226,165,.09); }
.chat strong, .chat small { display: block; }
.chat small { color: var(--muted); margin-top: .25rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.messages-panel .search { margin: 1rem; }
.messages { margin: 0; padding: 1rem; white-space: pre-wrap; overflow-wrap: anywhere; font: .92rem/1.65 ui-monospace, SFMono-Regular, Menlo, monospace; color: #dff7ed; max-height: 59vh; overflow-y: auto; border-top: 1px solid var(--line); }
.empty, .error { color: var(--muted); padding: 1rem; }
.error { color: #ffb0a5; }
footer { text-align: center; padding: 1rem 1rem calc(1.3rem + env(safe-area-inset-bottom)); font-size: .78rem; }
@media (max-width: 740px) {
  .layout { grid-template-columns: 1fr; }
  .panel { min-height: auto; }
  .list { max-height: 36vh; }
  .messages { max-height: 52vh; }
}

