/* Majelis AI — Grok-style monochrome.
   Background #000000; panels #0A0A0A / #111111 / #171717; hairline #262626.
   Text #FFFFFF, secondary #A3A3A3. No accent color, no gradient, no glow,
   no glassmorphism, no decorative badges. */
* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; }
body {
  background: #000000;
  color: #ffffff;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  font-size: 15px;
  line-height: 1.5;
  overflow: hidden;
}
.hidden { display: none !important; }
.muted { color: #a3a3a3; }
button { font-family: inherit; cursor: pointer; }
input, textarea, select { font-family: inherit; }

#app { display: flex; flex-direction: column; height: 100vh; }

/* ---------- header ---------- */
#topbar {
  display: flex; align-items: center; gap: 14px;
  padding: 10px 18px;
  background: #0a0a0a;
  border-bottom: 1px solid #262626;
  flex-shrink: 0;
}
.group-photo {
  width: 36px; height: 36px; border-radius: 50%;
  background: #171717; border: 1px solid #262626;
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 17px; flex-shrink: 0;
}
.group-title { min-width: 0; }
.group-name { font-weight: 700; font-size: 16px; white-space: nowrap; }
.group-sub { color: #a3a3a3; font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.seat-strip {
  display: flex; gap: 8px; overflow-x: auto; flex: 1;
  padding: 2px 4px; scrollbar-width: none;
}
.seat-strip::-webkit-scrollbar { display: none; }
.seat-chip {
  display: flex; align-items: center; gap: 7px; flex-shrink: 0;
  background: #111111; border: 1px solid #262626; border-radius: 999px;
  padding: 4px 11px 4px 4px; font-size: 12px;
}
.seat-chip .avatar {
  width: 22px; height: 22px; border-radius: 50%;
  background: #171717; border: 1px solid #262626;
  display: flex; align-items: center; justify-content: center;
  font-size: 11px; font-weight: 700;
}
.seat-chip .role { color: #a3a3a3; }
.dot { width: 7px; height: 7px; border-radius: 50%; background: #ffffff; flex-shrink: 0; }
.dot.off { background: #555555; }
.icon-btn {
  background: transparent; border: 1px solid #262626; color: #ffffff;
  width: 34px; height: 34px; border-radius: 50%; font-size: 16px;
  display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.icon-btn:hover { background: #171717; }
.pill-btn {
  background: #ffffff; color: #000000; border: none; border-radius: 999px;
  padding: 8px 16px; font-size: 13px; font-weight: 600; white-space: nowrap;
}
.pill-btn:hover { background: #e5e5e5; }
.pill-btn:disabled { opacity: 0.5; cursor: default; }

/* ---------- demo banner ---------- */
.demo-banner {
  background: #111111; border-bottom: 1px solid #262626;
  color: #a3a3a3; font-size: 13px; text-align: center;
  padding: 8px 16px; flex-shrink: 0;
}

/* ---------- main grid ---------- */
#main { display: flex; flex: 1; min-height: 0; }
#sidebar {
  width: 248px; flex-shrink: 0;
  background: #0a0a0a; border-right: 1px solid #262626;
  overflow-y: auto; padding: 14px 10px;
}
#members {
  width: 248px; flex-shrink: 0;
  background: #0a0a0a; border-left: 1px solid #262626;
  overflow-y: auto; padding: 14px 10px;
}
.side-section { margin-bottom: 22px; }
.side-head {
  display: flex; justify-content: space-between; align-items: center;
  color: #a3a3a3; font-size: 11px; font-weight: 700; letter-spacing: 0.08em;
  padding: 0 8px; margin-bottom: 8px;
}
.mini-btn {
  background: transparent; border: 1px solid #262626; color: #ffffff;
  width: 22px; height: 22px; border-radius: 50%; font-size: 14px; line-height: 1;
}
.mini-btn:hover { background: #171717; }
.room-item {
  padding: 8px 10px; border-radius: 8px; cursor: pointer;
  display: flex; justify-content: space-between; align-items: center; gap: 6px;
}
.room-item:hover { background: #111111; }
.room-item.active { background: rgba(255,255,255,0.09); color: #ffffff; }
.room-item .room-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.room-item .room-seats { color: #a3a3a3; font-size: 11px; white-space: nowrap; }
.room-item .room-edit { opacity: 0; background: transparent; border: none; color: #a3a3a3; font-size: 13px; }
.room-item:hover .room-edit { opacity: 1; }
.channel {
  padding: 8px 10px; border-radius: 8px; cursor: pointer; color: #a3a3a3;
}
.channel:hover { background: #111111; color: #ffffff; }
.channel.active { background: rgba(255,255,255,0.09); color: #ffffff; }
.seat-row {
  display: flex; align-items: center; gap: 9px;
  padding: 7px 10px; border-radius: 8px;
}
.seat-row .avatar {
  width: 28px; height: 28px; border-radius: 50%;
  background: #171717; border: 1px solid #262626;
  display: flex; align-items: center; justify-content: center;
  font-size: 12px; font-weight: 700; flex-shrink: 0;
}
.seat-row .seat-name { font-size: 14px; }
.seat-row .seat-role { color: #a3a3a3; font-size: 12px; }

/* ---------- chat column ---------- */
#chatCol { flex: 1; display: flex; flex-direction: column; min-width: 0; background: #000000; }
#taskPanel {
  background: #0a0a0a; border-bottom: 1px solid #262626;
  padding: 10px 18px; flex-shrink: 0;
}
.task-panel-head { display: flex; align-items: baseline; gap: 10px; }
.task-panel-title { font-weight: 700; font-size: 14px; }
.task-panel-sub { color: #a3a3a3; font-size: 12px; flex: 1; }
#taskList { margin-top: 6px; }
.task-row {
  display: flex; gap: 10px; align-items: baseline;
  padding: 6px 0; border-top: 1px solid #171717; font-size: 13px;
}
.task-row:first-child { border-top: none; }
.task-status { color: #a3a3a3; font-size: 12px; white-space: nowrap; font-family: ui-monospace, monospace; }
.task-title { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.task-snippet { color: #a3a3a3; font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 40%; }
#messages { flex: 1; overflow-y: auto; padding: 18px 22px; }
.msg { display: flex; gap: 11px; margin-bottom: 18px; max-width: 860px; }
.msg .avatar {
  width: 34px; height: 34px; border-radius: 50%; flex-shrink: 0;
  background: #171717; border: 1px solid #262626;
  display: flex; align-items: center; justify-content: center;
  font-size: 13px; font-weight: 700;
}
.msg.owner .avatar { background: #ffffff; color: #000000; border-color: #ffffff; }
.msg-head { font-size: 12px; color: #a3a3a3; margin-bottom: 2px; }
.msg-head .name { color: #ffffff; font-weight: 600; }
.msg-head .time { font-family: ui-monospace, monospace; }
.msg-body { font-size: 15px; white-space: pre-wrap; word-break: break-word; }
.msg-body code { font-family: ui-monospace, monospace; font-size: 13px; background: #111111; padding: 1px 5px; border-radius: 4px; }
.demo-tag {
  display: inline-block; border: 1px solid #262626; color: #a3a3a3;
  font-size: 10px; padding: 1px 7px; border-radius: 999px; margin-left: 8px;
  vertical-align: middle; letter-spacing: 0.06em;
}
.msg-error {
  margin-top: 6px; padding: 8px 10px; background: #111111;
  border: 1px solid #262626; border-radius: 8px;
  font-size: 12px; color: #a3a3a3; font-family: ui-monospace, monospace;
  white-space: pre-wrap; word-break: break-word;
}
.msg-system { color: #a3a3a3; font-size: 13px; font-style: italic; }
#workingBar {
  background: #0a0a0a; border-top: 1px solid #262626;
  padding: 8px 18px; font-size: 13px; color: #a3a3a3; flex-shrink: 0;
}
#workingBar .who { color: #ffffff; font-weight: 600; }
#chips { display: flex; gap: 8px; padding: 10px 18px 0; flex-shrink: 0; }
.chip {
  background: #111111; border: 1px solid #262626; color: #ffffff;
  border-radius: 999px; padding: 6px 13px; font-size: 13px;
}
.chip:hover { background: #171717; }
.chip:disabled { opacity: 0.45; cursor: default; }
#composer {
  display: flex; gap: 10px; padding: 10px 18px 16px; flex-shrink: 0;
  align-items: flex-end;
}
#composerInput {
  flex: 1; background: #111111; border: 1px solid #262626; border-radius: 14px;
  color: #ffffff; padding: 11px 14px; font-size: 15px; resize: none;
  max-height: 140px; outline: none;
}
#composerInput:focus { border-color: #555555; }
.send-btn {
  background: #ffffff; color: #000000; border: none; border-radius: 999px;
  padding: 11px 20px; font-size: 14px; font-weight: 700; flex-shrink: 0;
}
.send-btn:disabled { opacity: 0.4; cursor: default; }

/* ---------- members / memory ---------- */
.member-row {
  display: flex; align-items: center; gap: 9px;
  padding: 7px 10px; border-radius: 8px;
}
.member-row .avatar {
  width: 28px; height: 28px; border-radius: 50%;
  background: #171717; border: 1px solid #262626;
  display: flex; align-items: center; justify-content: center;
  font-size: 12px; font-weight: 700; flex-shrink: 0;
}
.member-row.absent { opacity: 0.45; }
.member-row .member-name { font-size: 14px; }
.member-row .member-role { color: #a3a3a3; font-size: 12px; }
.memory-list { display: flex; flex-direction: column; gap: 8px; }
.memory-item {
  background: #111111; border: 1px solid #262626; border-radius: 8px;
  padding: 8px 10px; font-size: 13px; display: flex; gap: 8px;
  justify-content: space-between; align-items: flex-start;
}
.memory-item span { flex: 1; }
.memory-empty { color: #a3a3a3; font-size: 13px; padding: 4px 10px; }

/* ---------- modal ---------- */
.modal {
  position: fixed; inset: 0; background: rgba(0,0,0,0.75);
  display: flex; align-items: flex-start; justify-content: center;
  padding: 40px 16px; z-index: 50; overflow-y: auto;
}
.modal-card {
  background: #0a0a0a; border: 1px solid #262626; border-radius: 14px;
  width: 560px; max-width: 100%;
}
.modal-head {
  display: flex; justify-content: space-between; align-items: center;
  padding: 16px 20px; border-bottom: 1px solid #262626;
}
.modal-title { font-weight: 700; font-size: 16px; }
.modal-body { padding: 18px 20px 22px; }
.field-label { display: block; font-size: 13px; font-weight: 600; margin: 16px 0 6px; }
.field-label:first-child { margin-top: 0; }
.field {
  width: 100%; background: #111111; border: 1px solid #262626;
  border-radius: 8px; color: #ffffff; padding: 10px 12px; font-size: 14px;
  outline: none;
}
.field:focus { border-color: #555555; }
.hint { color: #a3a3a3; font-size: 12px; margin-top: 6px; }
.toggle-row { display: flex; gap: 8px; align-items: flex-start; font-size: 14px; cursor: pointer; }
.row { display: flex; gap: 12px; align-items: center; margin-top: 14px; }
.row.end { justify-content: flex-end; }
.seat-edit-row, .seat-check-row {
  display: flex; gap: 10px; align-items: center; margin-bottom: 8px; font-size: 14px;
}
.seat-edit-row .seat-role-tag { color: #a3a3a3; font-size: 12px; width: 130px; flex-shrink: 0; }
.seat-edit-row input { flex: 1; }

/* ---------- error screen ---------- */
#errorScreen {
  position: fixed; inset: 0; background: #000000;
  display: flex; align-items: center; justify-content: center; z-index: 100;
}
.error-card {
  background: #0a0a0a; border: 1px solid #262626; border-radius: 14px;
  padding: 28px 32px; max-width: 420px; text-align: center;
}
.error-title { font-weight: 700; font-size: 17px; margin-bottom: 8px; }
.error-text { color: #a3a3a3; font-size: 14px; }
.error-meta { color: #a3a3a3; font-size: 12px; margin-top: 12px; font-family: ui-monospace, monospace; }

/* ---------- opuscar style picker ---------- */
#styleRow {
  display: flex; align-items: center; gap: 8px;
  padding: 8px 14px 0; background: #000000;
}
.style-label { color: #a3a3a3; font-size: 12px; white-space: nowrap; }
.style-select {
  flex: 0 1 340px; min-width: 0;
  background: #111111; color: #ffffff;
  border: 1px solid #262626; border-radius: 8px;
  padding: 6px 8px; font-size: 13px;
}
.style-select:disabled { opacity: 0.5; }
.style-hint {
  font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  flex: 1; min-width: 0;
}
.style-badge {
  font-size: 11px; color: #ffffff; background: #171717;
  border: 1px solid #262626; border-radius: 999px;
  padding: 2px 8px; white-space: nowrap;
}
.task-artifacts { display: flex; gap: 8px; white-space: nowrap; }
.artifact-link {
  font-size: 12px; color: #ffffff; text-decoration: underline;
  text-underline-offset: 2px; white-space: nowrap;
}
.artifact-link:hover { color: #e5e5e5; }

/* ---------- mobile ---------- */
@media (max-width: 900px) {
  #sidebar, #members {
    position: fixed; top: 0; bottom: 0; z-index: 40;
    transition: transform 0.2s ease;
    width: 272px;
  }
  #sidebar { left: 0; transform: translateX(-100%); }
  #sidebar.open { transform: translateX(0); }
  #members { right: 0; transform: translateX(100%); border-left: 1px solid #262626; }
  #members.open { transform: translateX(0); }
  .group-sub { display: none; }
  #messages { padding: 14px 14px; }
  #composer { padding: 10px 12px 14px; }
}
@media (min-width: 901px) {
  #menuBtn { display: none; }
}
