:root {
  --bg: #241228;
  --panel: #3a1d42;
  --text: #fff5fb;
  --muted: #e7c3d8;
  --accent: #ff4f93;
  --me: #ff4f93;
  --me-text: #fff;
  --them: #542848;
  --them-text: #fff5fb;
  color-scheme: dark;
  font-family: "Segoe UI", system-ui, sans-serif;
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--text); }
button, input { font: inherit; color: inherit; }
button { cursor: pointer; }
h1, h2 { margin: 0 0 8px; }
.muted { color: var(--muted); font-size: 0.9rem; }
.error { color: #ffb4c8; }
.warn { margin: 0; padding: 10px 12px; background: #6b2430; }
.card {
  width: min(440px, calc(100% - 24px));
  margin: 8vh auto;
  background: var(--panel);
  border-radius: 18px;
  padding: 18px;
  display: grid;
  gap: 10px;
}
.card.wide { width: min(860px, calc(100% - 24px)); }
label, .label { display: grid; gap: 4px; font-weight: 650; }
input {
  background: color-mix(in srgb, var(--bg) 70%, black);
  border: 1px solid color-mix(in srgb, var(--text) 20%, transparent);
  border-radius: 12px;
  padding: 10px 12px;
}
.primary { background: var(--accent); color: white; border: 0; border-radius: 999px; padding: 10px 14px; }
.chip, .tools button, .room-head button, .msg button {
  background: transparent;
  border: 1px solid color-mix(in srgb, var(--text) 25%, transparent);
  border-radius: 999px;
  padding: 6px 10px;
}
.chip.picked, .pick.picked { outline: 2px solid var(--accent); }
.row, .picks, .compose { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.pick { font-size: 1.4rem; border-radius: 12px; border: 1px solid transparent; background: color-mix(in srgb, var(--bg) 55%, transparent); padding: 6px 8px; }
#shell { display: grid; grid-template-columns: 300px 1fr; min-height: 100vh; }
aside { background: var(--panel); display: flex; flex-direction: column; min-height: 100vh; }
.me, .room-head { display: flex; gap: 10px; align-items: center; padding: 12px; }
.avatar, .bubble-avatar {
  width: 42px; height: 42px; border-radius: 50%; display: grid; place-items: center;
  background: color-mix(in srgb, var(--accent) 30%, var(--bg)); font-size: 1.4rem; border: 0;
}
.dot { width: 9px; height: 9px; border-radius: 50%; display: inline-block; background: #777; }
.dot.on { background: #3ddc84; }
.dot.away { background: #f0c14a; }
.tools { display: grid; gap: 8px; padding: 0 12px 12px; }
.tools form { display: flex; gap: 6px; }
.tools input { flex: 1; }
#rooms { overflow: auto; }
.room {
  width: 100%; text-align: left; background: transparent; border: 0; border-bottom: 1px solid color-mix(in srgb, var(--text) 10%, transparent);
  padding: 10px 12px; display: flex; gap: 8px; align-items: center;
}
.room small { display: block; color: var(--muted); }
.badge { background: var(--accent); color: white; border-radius: 999px; padding: 0 6px; font-size: 0.8rem; }
main { display: grid; grid-template-rows: auto auto auto 1fr auto auto; min-height: 100vh; }
#log { overflow: auto; padding: 12px; display: flex; flex-direction: column; gap: 8px; }
.msg { display: flex; gap: 8px; max-width: 70%; }
.msg.mine { margin-left: auto; flex-direction: row-reverse; }
.bubble { background: var(--them); color: var(--them-text); border-radius: 16px; padding: 8px 10px; }
.msg.mine .bubble { background: var(--me); color: var(--me-text); }
.reply { font-size: 0.85rem; opacity: 0.8; border-left: 3px solid var(--accent); padding-left: 6px; margin-bottom: 4px; }
.msg img, .msg audio, video { max-width: 240px; border-radius: 12px; display: block; }
#composer, #typing, #members { padding: 0 12px 8px; }
#members { display: flex; flex-wrap: wrap; gap: 8px; }
.person { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.boss-tabs { display: flex; gap: 8px; }
.feature {
  display: flex; justify-content: space-between; gap: 12px; align-items: center;
  padding: 10px 0; border-bottom: 1px solid color-mix(in srgb, var(--text) 12%, transparent);
}
.feature strong { display: block; }
.switch { border: 0; border-radius: 999px; min-width: 64px; padding: 8px 12px; }
.switch.on { background: #1f8a4c; color: white; }
.switch.off { background: #6b2430; color: white; }
.modal { position: fixed; inset: 0; background: rgba(0,0,0,.45); overflow: auto; }
#show-list { display: none; }
@media (max-width: 800px) {
  #shell { grid-template-columns: 1fr; }
  aside { display: none; min-height: auto; }
  body.show-list aside { display: flex; }
  body.show-list main { display: none; }
  #show-list { display: inline-block; }
  .msg { max-width: 90%; }
}
