:root {
  --bg: #070b14;
  --panel: #0e1524;
  --panel-2: #131c2f;
  --line: #22304d;
  --text: #d6e2f5;
  --muted: #7d8aa5;
  --accent: #5fe0ff;
  --pixel: 'Press Start 2P', monospace;
  --mono: 'IBM Plex Mono', ui-monospace, Consolas, monospace;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  height: 100%;
  background: var(--bg);
  color: var(--text);
  font-family: var(--mono);
  font-size: 13px;
}

body {
  display: flex;
  flex-direction: column;
  background:
    radial-gradient(1200px 600px at 50% -10%, #0f2140 0%, transparent 60%),
    var(--bg);
}

button {
  font: inherit;
  color: inherit;
  cursor: pointer;
}

/* ---------- top bar ---------- */
.topbar {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 16px;
  padding: 10px 16px;
  border-bottom: 2px solid var(--line);
  background: #0a1120;
}

.brand { display: flex; align-items: center; gap: 10px; }
.logo { font-size: 26px; color: var(--accent); text-shadow: 0 0 10px var(--accent); }
.brand-title { font-family: var(--pixel); font-size: 14px; letter-spacing: 2px; color: #fff; }
.lab-select { font: inherit; color: inherit; appearance: none; -webkit-appearance: none; background: transparent; border: 1px solid transparent; padding: 1px 16px 1px 2px; margin: -2px 0 0 -2px; cursor: pointer;
  background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%);
  background-position: calc(100% - 8px) 55%, calc(100% - 4px) 55%; background-size: 4px 4px; background-repeat: no-repeat; }
.lab-select:hover, .lab-select:focus-visible { border-color: var(--accent); outline: none; }
.lab-select option { background: var(--panel-2); color: #fff; font-family: var(--mono, monospace); }
.brand-sub { font-size: 11px; color: var(--muted); margin-top: 4px; }
.usage-limits { position: relative; display: flex; align-items: center; gap: 6px; flex: none; }
.limit-badge { --limit-color: #7d8aa5; width: 102px; padding: 4px 5px; border: 1px solid var(--line); background: var(--panel-2); color: var(--limit-color); font-family: var(--pixel); font-size: 8px; }
.limit-badge.good { --limit-color: #4ade80; }
.limit-badge.mid { --limit-color: #facc15; }
.limit-badge.low { --limit-color: #f87171; }
.limit-label { display: block; white-space: nowrap; }
.limit-track { display: block; margin-top: 4px; height: 3px; background: #070b14; }
.limit-fill { display: block; width: 0; height: 100%; background: var(--limit-color); }
.shift-control { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.shift-control button { font-family: var(--pixel); font-size: 8px; padding: 7px; color: var(--text); background: var(--panel-2); border: 1px solid var(--line); cursor: pointer; }
.shift-control button:not(:disabled):hover { border-color: var(--accent); }
.shift-control button:disabled { opacity: .55; cursor: default; }
#shift-indicator { color: #facc15; border: 1px solid #a16207; padding: 6px; font: 8px var(--pixel); white-space: nowrap; }
#shift-error { color: #f87171; font-size: 11px; }
@media (max-width: 1450px) {
  .topbar { gap: 8px; }
  .nav { gap: 4px; }
  .nav button { padding-left: 7px; padding-right: 7px; }
  .limit-badge { width: 90px; font-size: 7px; }
}

.nav { display: flex; gap: 8px; margin-left: auto; flex-wrap: wrap; min-width: 0; }
.nav button, #logout {
  font-family: var(--pixel);
  font-size: 9px;
  padding: 8px 10px;
  background: var(--panel-2);
  border: 2px solid var(--line);
  box-shadow: inset 0 -3px 0 #0006;
}
.nav button:hover, #logout:hover { border-color: var(--accent); color: #fff; }
.nav b { color: var(--accent); margin-left: 4px; }

.sound-controls { display: flex; align-items: center; gap: 6px; }
.sound-controls button { width: 34px; height: 32px; padding: 4px; color: var(--text); background: var(--panel-2); border: 2px solid var(--line); }
.sound-controls button:hover { border-color: var(--accent); }
.sound-controls svg { display: block; width: 100%; height: 100%; }
.sound-controls input { width: 70px; accent-color: var(--accent); cursor: pointer; }

.clock { font-family: var(--pixel); font-size: 11px; display: flex; align-items: center; gap: 8px; }
.conn { font-size: 12px; }
.conn.on { color: #4ade80; text-shadow: 0 0 6px #4ade80; }
.conn.off { color: #f87171; }

/* ---------- layout ---------- */
.layout {
  flex: 1;
  display: flex;
  min-height: 0;
  overflow: hidden;
}

.office {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.stage {
  position: relative;
  flex: 1;
  min-height: 260px;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  padding: 12px;
}

canvas#world {
  display: block;
  cursor: default;
  border: 2px solid var(--line);
  box-shadow: 0 0 0 4px #04070d, 0 10px 40px #000a;
}

.tooltip {
  position: absolute;
  pointer-events: none;
  max-width: 320px;
  padding: 8px 10px;
  background: #050912ee;
  border: 2px solid var(--accent);
  font-size: 12px;
  line-height: 1.4;
  z-index: 5;
}
.tooltip .tt-name { font-family: var(--pixel); font-size: 9px; margin-bottom: 6px; }

/* ---------- crew list ---------- */
.crew {
  flex: 1 1 auto;
  min-width: max-content;
  display: grid;
  /* Cards share the full column height top to bottom (owner, 2026-11-01); scroll only if they can't fit. */
  grid-auto-rows: minmax(max-content, 1fr);
  align-content: stretch;
  gap: 6px;
  min-height: 0;
  overflow-y: auto;
  padding: 8px 12px;
}
.crew-card {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  padding: 4px 8px 4px 4px;
  text-align: left;
  background: var(--panel);
  border: 2px solid var(--line);
  box-shadow: inset 0 -3px 0 #0006;
}
.crew-card:hover { border-color: #3a4d70; }
.crew-card.sel { border-color: var(--accent); }
.crew-card.off-shift { opacity: .55; }
/* Avatars grow with the card (--av, 44..128px, set by resize()) on a transparent background (owner, 2026-11-01). */
.crew-card canvas, .crew-card .cc-avatar { width: var(--av, 56px); height: var(--av, 56px); flex: none; object-fit: contain; }
.crew-card canvas { image-rendering: pixelated; }
img.portrait { image-rendering: auto; object-fit: contain; }
.cc-body { min-width: max-content; flex: 1; }
.cc-name { font-family: var(--pixel); font-size: 9px; display: flex; align-items: center; justify-content: space-between; gap: 6px; white-space: nowrap; min-width: 0; }
.cc-name span { white-space: nowrap; letter-spacing: 0; }
.lamp { width: 7px; height: 7px; display: inline-block; flex: none; }
.crew-card.busy .lamp { animation: blink 0.7s steps(2) infinite; }
@keyframes blink { 50% { opacity: 0.25; } }
.cc-act { width: 0; min-width: 100%; font-size: 11px; color: var(--muted); margin-top: 5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.lib-dir { font-size: 11px; color: var(--muted); margin: 8px 0 4px; }
.doclist.lib { max-height: 64vh; overflow-y: auto; }

/* ---------- feed ---------- */
.feed {
  height: 34%;
  min-height: 160px;
  flex: none;
  border-top: 2px solid var(--line);
  background: #0a1120;
  display: flex;
  flex-direction: column;
}
.feed-title {
  font-family: var(--pixel);
  font-size: 9px;
  color: var(--muted);
  padding: 8px 16px 4px;
}
#feed {
  list-style: none;
  margin: 0;
  padding: 0 16px 8px;
  overflow-y: auto;
  flex: 1;
}
#feed li {
  display: flex;
  gap: 8px;
  padding: 3px 0;
  font-size: 12px;
  line-height: 1.35;
  border-bottom: 1px dashed #1c2740;
}
#feed .t { color: var(--muted); flex: none; }
#feed .a { flex: none; font-weight: 600; width: 7.8em; white-space: nowrap; }
#feed .x {
  min-width: 0;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  word-break: break-word;
}
#feed li.ev-done .x { color: #4ade80; }
#feed li.ev-error .x { color: #f87171; }
#feed li.ev-start .x { color: #fff; }

/* ---------- side panel ---------- */
.side-wrap {
  width: 380px;
  flex: none;
  display: flex;
  flex-direction: column;
  min-height: 0;
  border-left: 2px solid var(--line);
  background: var(--panel);
}
.side {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 16px;
}

.card-head { display: flex; gap: 14px; align-items: center; }
.portrait {
  width: 96px;
  height: 96px;
  flex: none;
  image-rendering: pixelated;
  border: 2px solid var(--line);
  background: #000;
  object-fit: cover;
}
.who { min-width: 0; flex: 1; }
.who h2 {
  font-family: var(--pixel);
  font-size: 15px;
  margin: 0 0 8px;
  letter-spacing: 0;
  overflow-wrap: anywhere;
}
.who .title { color: var(--muted); margin-bottom: 8px; }
.who .chip { max-width: 100%; overflow-wrap: anywhere; }
.chips { display: flex; gap: 6px; flex-wrap: wrap; }
.chip {
  font-size: 11px;
  padding: 2px 6px;
  border: 1px solid var(--line);
  background: var(--panel-2);
}

.status {
  margin: 16px 0 4px;
  padding: 10px 12px;
  background: var(--panel-2);
  border-left: 4px solid var(--muted);
}
.status .st {
  font-family: var(--pixel);
  font-size: 10px;
  display: flex;
  justify-content: space-between;
  gap: 8px;
}
.status .st small { font-family: var(--mono); color: var(--muted); font-size: 11px; }
.status .activity { margin-top: 8px; line-height: 1.45; word-break: break-word; }

.sec { margin-top: 18px; }
.sec h3 {
  font-family: var(--pixel);
  font-size: 9px;
  color: var(--muted);
  margin: 0 0 8px;
  letter-spacing: 1px;
}
.sec p { margin: 0; line-height: 1.45; }
.empty { color: var(--muted); font-style: italic; }
.persona { color: #b8c6de; font-style: italic; }

.plan, .duties { list-style: none; margin: 0; padding: 0; }
.plan li, .duties li { padding: 3px 0 3px 22px; position: relative; line-height: 1.4; }
.plan li::before { content: '☐'; position: absolute; left: 2px; color: var(--muted); }
.plan li.done { color: var(--muted); text-decoration: line-through; }
.plan li.done::before { content: '☑'; color: #4ade80; }
.plan li.active { color: #fff; }
.plan li.active::before { content: '▶'; color: var(--accent); }
.duties li::before { content: '›'; position: absolute; left: 6px; color: var(--accent); }

.doclist { list-style: none; margin: 0; padding: 0; }
.doclist li button {
  width: 100%;
  text-align: left;
  background: var(--panel-2);
  border: 1px solid var(--line);
  padding: 7px 9px;
  margin-bottom: 5px;
  display: flex;
  justify-content: space-between;
  gap: 8px;
}
.doclist li button:hover { border-color: var(--accent); }
.doclist .d { color: var(--muted); font-size: 11px; flex: none; }
.doclist .bad { color: #f87171; }

.mini-feed { list-style: none; margin: 0; padding: 0; font-size: 12px; }
.mini-feed li { padding: 3px 0; border-bottom: 1px dashed #1c2740; line-height: 1.4; word-break: break-word; }
.mini-feed .t { color: var(--muted); margin-right: 6px; }

/* ---------- modal ---------- */
.modal {
  position: fixed;
  inset: 0;
  background: #000b;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  z-index: 10;
}
.modal[hidden] { display: none; }
.modal-box {
  width: min(980px, 100%);
  max-height: 100%;
  display: flex;
  flex-direction: column;
  background: var(--panel);
  border: 2px solid var(--accent);
  box-shadow: 0 0 0 4px #04070d, 0 0 40px #5fe0ff33;
}
.modal-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 16px;
  border-bottom: 2px solid var(--line);
  font-family: var(--pixel);
  font-size: 11px;
}
.modal-head button { background: none; border: 0; font-size: 18px; color: var(--muted); }
.modal-head button:hover { color: #fff; }
.modal-body { padding: 16px; overflow-y: auto; }

/* kanban */
.kanban { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; }
.kcol { background: var(--panel-2); border: 1px solid var(--line); padding: 8px; min-height: 140px; }
.kcol h4 { font-family: var(--pixel); font-size: 9px; margin: 2px 0 10px; color: var(--muted); }
.kcard { background: #0b1220; border-left: 3px solid var(--accent); padding: 7px 8px; margin-bottom: 7px; line-height: 1.35; }
.kcard .kid { color: var(--muted); font-size: 11px; display: flex; flex-wrap: wrap; justify-content: space-between; gap: 2px 8px; margin-bottom: 3px; }

/* doc browser */
.modal-box.wide { width: min(1500px, 100%); }
.docs { display: grid; grid-template-columns: minmax(280px, 360px) minmax(0, 1fr); gap: 16px; min-height: 360px; }
.docs .doclist button span:first-child { min-width: 0; overflow-wrap: anywhere; }
.docs .doclist { max-height: 64vh; overflow-y: auto; }
.docs .doclist button.sel { border-color: var(--accent); background: #10203a; }
.tabs { display: flex; gap: 6px; margin-bottom: 10px; }
.tabs button { background: var(--panel-2); border: 1px solid var(--line); padding: 5px 9px; font-size: 12px; }
.tabs button.sel { border-color: var(--accent); color: #fff; }

/* markdown */
.md { line-height: 1.55; word-break: break-word; }
.md h1, .md h2, .md h3 { font-family: var(--pixel); line-height: 1.5; color: #fff; }
.md h1 { font-size: 14px; }
.md h2 { font-size: 11px; margin-top: 22px; color: var(--accent); }
.md h3 { font-size: 10px; margin-top: 18px; }
.md code { background: #050912; padding: 1px 4px; border: 1px solid var(--line); }
.md pre { background: #050912; padding: 10px; border: 1px solid var(--line); overflow-x: auto; }
.md pre code { border: 0; padding: 0; }
.md table { border-collapse: collapse; margin: 8px 0; }
.md td, .md th { border: 1px solid var(--line); padding: 4px 8px; }
.md a { color: var(--accent); }
.md .meta { color: var(--muted); font-size: 12px; margin-bottom: 10px; }

/* gallery */
.gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 10px; }
.gallery figure { margin: 0; background: var(--panel-2); border: 1px solid var(--line); padding: 6px; }
.gallery img { width: 100%; aspect-ratio: 1; object-fit: contain; image-rendering: pixelated; background: #050912; }
.gallery figcaption { font-size: 11px; color: var(--muted); margin-top: 4px; word-break: break-all; }

/* ---------- comms ---------- */
.comms-btn { border-color: #5fe0ff66 !important; }
.badge { background: #f87171; color: #fff !important; padding: 1px 5px; margin-left: 6px; }
.write-btn {
  width: 100%;
  margin-top: 12px;
  padding: 8px;
  font-family: var(--pixel);
  font-size: 9px;
  background: var(--panel-2);
  border: 2px solid var(--line);
}
.write-btn:hover { border-color: var(--accent); color: #fff; }
.comms-modal { width: min(1100px, 100%); max-width: 100%; min-width: 0; height: min(780px, 100%); }
.comms-modal .modal-body { padding: 0; overflow: hidden; flex: 1; min-height: 0; }
.comms { display: flex; height: 100%; min-height: 0; min-width: 0; }
.chat-sidebar { width: 240px; flex: none; border-right: 1px solid var(--line); display: flex; flex-direction: column; min-height: 0; }
.chat-sidebar-title { padding: 16px; color: var(--muted); font-size: 11px; }
.chat-list { overflow-y: auto; }
.chat-item { width: 100%; display: grid; grid-template-columns: 32px minmax(0, 1fr) auto; gap: 5px 8px; padding: 12px 16px; text-align: left; border: 0; border-bottom: 1px solid #1a2840; background: transparent; }
.chat-list-avatar { grid-column: 1; grid-row: 1 / span 2; align-self: center; }
.chat-name { grid-column: 2; grid-row: 1; white-space: nowrap; }
.chat-time { grid-column: 3; grid-row: 1; }
.chat-preview { grid-column: 2; grid-row: 2; min-width: 0; }
.chat-unread { grid-column: 3; grid-row: 2; justify-self: end; }
.chat-item:hover, .chat-item.sel { background: #192b43; }
.chat-name { color: #fff; font-weight: bold; overflow: hidden; text-overflow: ellipsis; }
.chat-time, .chat-preview { color: var(--muted); font-size: 11px; }
.chat-preview { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.chat-unread { background: var(--accent); color: #07101b; border-radius: 12px; padding: 1px 6px; font-size: 11px; }
.chat-main { min-width: 0; flex: 1; display: flex; flex-direction: column; }
.chat-heading { min-height: 55px; padding: 10px 16px; display: flex; flex-wrap: wrap; align-items: center; gap: 8px 16px; border-bottom: 1px solid var(--line); }
.chat-heading .presence { min-width: 0; max-width: 100%; overflow-wrap: anywhere; padding: 0; background: none; border: 0; font-size: 11px; }
.thread-wrap { flex: 1; min-height: 0; min-width: 0; position: relative; }
.thread { height: 100%; overflow-y: auto; overflow-x: hidden; background: #070c17; padding: 16px; display: flex; flex-direction: column; gap: 12px; }
.msg { max-width: min(78%, 580px); min-width: 0; line-height: 1.45; padding: 9px 12px; border: 1px solid var(--line); border-radius: 12px 12px 12px 3px; background: var(--panel-2); }
.msg.boss { align-self: flex-end; background: #1b3936; border-color: #315e57; border-radius: 12px 12px 3px 12px; }
.msg.agent { align-self: flex-start; }
.chat-message-row { display: flex; align-items: flex-start; gap: 8px; min-width: 0; width: 100%; }
.chat-message-row.own { justify-content: flex-end; }
.chat-message-row .msg { max-width: min(78%, 580px); }
.chat-message-row.incoming .msg { max-width: min(calc(100% - 40px), 580px); }
.chat-avatar-slot { flex: 0 0 32px; width: 32px; height: 32px; }
.chat-avatar { display: grid; place-items: center; position: relative; width: 32px; height: 32px; overflow: hidden; border-radius: 50%; color: #07101b; font-weight: bold; }
.chat-avatar-image { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.chat-avatar-image[hidden] { display: none; }
.msg-meta { display: flex; justify-content: space-between; gap: 20px; color: var(--muted); font-size: 10px; margin-bottom: 4px; }
.msg-meta b { color: #98d9e8; }
.msg-text { white-space: pre-wrap; overflow-wrap: anywhere; }
.msg.err .msg-text { color: #f87171; }
.message-images { display: flex; flex-wrap: wrap; gap: 6px; }
.message-images:not(:empty) { margin-top: 6px; }
.message-images img { display: block; max-width: min(180px, 100%); max-height: 140px; object-fit: contain; }
.new-messages { position: absolute; bottom: 12px; left: 50%; transform: translateX(-50%); border: 1px solid var(--accent); border-radius: 20px; background: #19374a; padding: 8px 14px; white-space: nowrap; }
.new-messages[hidden] { display: none; }
.composer-area { padding: 12px 16px 16px; border-top: 1px solid var(--line); }
.composer { display: flex; align-items: flex-end; gap: 8px; }
.composer textarea { flex: 1; min-width: 0; min-height: 40px; max-height: 144px; resize: none; overflow-y: auto; font: inherit; line-height: 1.4; color: var(--text); background: #070c17; border: 1px solid var(--line); border-radius: 8px; padding: 10px; }
.composer textarea:focus { outline: none; border-color: var(--accent); }
.composer button { min-height: 40px; padding: 0 12px; background: var(--panel-2); border: 1px solid var(--accent); border-radius: 8px; }
.composer button:disabled { opacity: .5; }
@media (max-width: 600px) {
  .comms-modal { height: 100%; }
  .comms { flex-direction: column; }
  .chat-sidebar { width: 100%; min-width: 0; max-height: 110px; border-right: 0; border-bottom: 1px solid var(--line); }
  .chat-sidebar-title { display: none; }
  .chat-list { overflow-x: hidden; overflow-y: auto; }
  .chat-item { padding: 8px 16px; }
  .chat-main { flex: 1; min-height: 0; }
  .chat-heading { min-height: 45px; }
  .chat-message-row.own .msg { max-width: 90%; }
  .chat-message-row.incoming .msg { max-width: calc(100% - 40px); }
}
.comms-attachments { display: flex; flex-wrap: wrap; gap: 8px; }
.pending-image { position: relative; }
.pending-image img { display: block; width: 64px; height: 64px; object-fit: cover; border: 1px solid var(--line); }
.pending-image button { position: absolute; top: 0; right: 0; background: #070c17; color: var(--text); border: 1px solid var(--line); cursor: pointer; }
.comms-error { color: #f87171; font-size: 12px; }
.comms-error:empty, .comms-attachments:empty { display: none; }

.presence { font-size: 12px; padding: 6px 10px; border-left: 3px solid var(--muted); background: var(--panel-2); }
.presence.on { border-left-color: #4ade80; color: #b9f5cf; }
.presence.off { border-left-color: #facc15; color: #f3e3a0; }
.shift-notice { font-size: 12px; padding: 6px 10px; border-left: 3px solid #facc15; color: #f3e3a0; background: var(--panel-2); }
.deputy { font-size: 10px; padding: 0 5px; border: 1px solid #facc1588; color: #facc15; }

/* ---------- small screens ---------- */
@media (max-width: 900px) {
  .layout { flex-direction: column; }
  .side-wrap { width: auto; border-left: 0; border-top: 2px solid var(--line); }
  .side { overflow: visible; }
  .feed { height: 260px; }
  .stage { min-height: 0; padding: 8px; }
  .docs { grid-template-columns: 1fr; }
  .kanban { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .topbar { flex-wrap: wrap; }
}

.memory-section summary { cursor: pointer; font-family: var(--pixel); font-size: 9px; color: var(--muted); letter-spacing: 1px; }
.memory-section .md { margin-top: 10px; }
.archive-tabs { flex-wrap: wrap; }
.archive-history { max-height: 60vh; min-height: 200px; }
.history-day { align-self: center; color: var(--muted); font-size: 11px; margin: 8px 0; }
.archive-footer { color: var(--muted); font-size: 11px; margin-top: 12px; }

.owner-ava { float: right; display: grid; place-items: center; margin-left: 8px; color: #b9f5cf; font-size: 9px; font-weight: bold; }

.limits-panel { position: absolute; top: calc(100% + 6px); left: 0; z-index: 30; width: min(320px, calc(100vw - 32px)); max-height: min(70vh, 480px); overflow: auto; padding: 10px; border: 1px solid var(--line); background: var(--panel); box-shadow: 0 5px 16px #000a; overflow-wrap: anywhere; }
.limits-panel[hidden] { display: none; }
.limits-panel section + section { margin-top: 10px; padding-top: 10px; border-top: 1px solid var(--line); }
.limits-panel strong { color: var(--accent); }
.limits-close { display: block; margin: 0 0 10px auto; padding: 6px 10px; border: 1px solid var(--line); background: var(--panel-2); color: var(--text); }
.limits-close:hover, .limits-close:focus-visible { border-color: var(--accent); }
.limit-badge { cursor: pointer; }

@media (max-width: 500px) { .limits-panel { position: fixed; left: 16px; right: 16px; top: 16px; width: auto; } }

.cc-meta { display: flex; gap: 6px; margin-top: 2px; font-size: 10px; color: var(--muted); white-space: nowrap; width: 0; min-width: 100%; overflow: hidden; }
.cc-ctx { flex: none; }
.cc-also { color: #e8b24a; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.cc-also[hidden] { display: none; }
.also-chip { color: #e8b24a; }
/* Human entry and private conversations use the existing studio palette. */
.login-page { display: grid; place-items: center; min-height: 100vh; margin: 0; background: #070c17; color: #c9d5e9; }
.login-card { width: min(420px, 90vw); padding: 32px; border: 1px solid #354565; background: #10192a; box-sizing: border-box; }
.login-card label { display: grid; gap: 8px; margin: 22px 0; }
.login-card input { width: 100%; padding: 12px; box-sizing: border-box; background: #070c17; color: #e0e8f6; border: 1px solid #536683; font: inherit; }
.login-card button { padding: 12px 24px; }
#login-error { min-height: 1.5em; color: #ff9e9e; }
.human-thread { height: min(50vh, 480px); overflow-y: auto; padding: 12px; }
.human-composer { display: flex; gap: 12px; padding: 12px; }
.human-composer textarea { flex: 1; background: #070c17; color: #e0e8f6; min-height: 54px; }
.guest .shift-control, .guest .usage-limits, .guest .write-btn { display: none; }
.comms-tabs { display: flex; gap: 4px; padding: 12px 12px 4px; }
.comms-tabs button { flex: 1; padding: 8px 5px; border: 1px solid var(--line); border-radius: 6px; background: transparent; color: var(--muted); font-size: 11px; }
.comms-tabs button.active { color: #07101b; background: var(--accent); border-color: var(--accent); }
.human-item .chat-list-avatar { position: relative; }
.human-dot { position: absolute; right: -2px; bottom: -2px; width: 9px; height: 9px; background: #4ade80; border: 2px solid var(--panel); border-radius: 50%; }
.human-contact-name { grid-column: 2 / 4; display: flex; align-items: center; gap: 6px; min-width: 0; }
.human-role { flex: none; padding: 2px 5px; border: 1px solid #405875; border-radius: 8px; color: #a9bdd5; font-size: 10px; }
.human-heading { flex-wrap: nowrap; }
.human-heading-detail { display: block; margin-top: 4px; }
.human-status { margin-left: 5px; color: var(--muted); font-size: 11px; }
.human-status.online { color: #4ade80; }
.human-thread { flex: 1; min-height: 0; overflow: auto; background: #070c17; padding: 16px; display: flex; flex-direction: column; gap: 12px; }
.human-empty { margin: auto; display: grid; justify-items: center; gap: 10px; color: var(--muted); text-align: center; }
.human-empty .human-avatar { width: 64px; height: 64px; font-size: 22px; }
.human-composer { display: flex; align-items: end; gap: 8px; padding: 8px; border: 1px solid var(--line); border-radius: 9px; background: #070c17; }
.human-composer:focus-within { border-color: var(--accent); }
.human-composer textarea { flex: 1; min-width: 0; min-height: 40px; max-height: 144px; resize: vertical; border: 0; outline: 0; background: transparent; color: var(--text); font: inherit; padding: 10px; }
.human-count { color: var(--muted); font-size: 10px; white-space: nowrap; padding-bottom: 12px; }
.human-composer button { min-height: 40px; padding: 0 18px; border: 1px solid var(--accent); border-radius: 7px; background: var(--accent); color: #07101b; font-weight: bold; }
.human-composer button:disabled { opacity: .5; }
.human-avatar { background: #60758f; }
