:root {
  --bg: #0b1120;
  --panel: #111a2e;
  --panel2: #16223c;
  --line: rgba(255, 255, 255, .08);
  --text: #e7edf7;
  --muted: #8aa0c0;
  --user: #334155;
  --arkadi: #7c3aed;
  --ynon: #14b8a6;
  --apex: #3b82f6;
}
* { box-sizing: border-box; }
html, body { height: 100%; margin: 0; }
body {
  background: radial-gradient(1200px 600px at 80% -10%, #17233f 0, var(--bg) 55%) fixed;
  color: var(--text);
  font-family: "Segoe UI", "Heebo", system-ui, sans-serif;
  display: flex; flex-direction: column; height: 100vh;
}

.top {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 14px 20px; border-bottom: 1px solid var(--line);
  background: rgba(10, 16, 30, .7); backdrop-filter: blur(8px);
}
.brand { display: flex; align-items: center; gap: 12px; }
.logo { font-size: 26px; }
.brand h1 { margin: 0; font-size: 18px; letter-spacing: .3px; }
.brand h1 span { color: var(--ynon); }
.sub { margin: 2px 0 0; font-size: 12px; color: var(--muted); }
.tokenbox { display: flex; gap: 6px; }
.tokenbox input {
  background: var(--panel2); border: 1px solid var(--line); color: var(--text);
  border-radius: 8px; padding: 7px 10px; width: 150px; font-size: 12px;
}
.tokenbox button, .composer button {
  background: linear-gradient(180deg, #1ec9b7, #0e9c8c); color: #04231f; border: 0;
  border-radius: 8px; padding: 7px 12px; font-weight: 700; cursor: pointer; font-size: 13px;
}
.tokenbox button:hover, .composer button:hover { filter: brightness(1.08); }
.tokenbox button.danger { background: linear-gradient(180deg, #ef6a6a, #c53030); color: #fff; }
.tokenbox button.active-block { background: linear-gradient(180deg, #fbbf24, #d97706); color: #251a02; }
.banner { padding: 8px 20px; background: rgba(217,119,6,.15); border-bottom: 1px solid rgba(217,119,6,.4); color: #fcd34d; font-size: 13px; font-weight: 600; text-align: center; }

.thread {
  flex: 1; overflow-y: auto; padding: 22px clamp(12px, 6vw, 120px);
  display: flex; flex-direction: column; gap: 12px;
}
.row { display: flex; }
.row.mine { justify-content: flex-start; }      /* user on the start (right in RTL) */
.row.other { justify-content: flex-end; }        /* agents on the end (left in RTL) */
.bubble {
  max-width: min(680px, 78%); padding: 10px 14px; border-radius: 14px;
  background: var(--panel); border: 1px solid var(--line); position: relative;
  animation: pop .18s ease-out;
}
@keyframes pop { from { opacity: 0; transform: translateY(6px); } }
.bubble .who { font-size: 11px; font-weight: 700; margin-bottom: 3px; display: flex; gap: 8px; align-items: baseline; }
.bubble .time { font-size: 10px; color: var(--muted); font-weight: 400; }
.bubble .body { white-space: pre-wrap; word-break: break-word; line-height: 1.5; font-size: 14px; }

.who .dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; }
.b-user   { border-color: #3a4a63; }
.b-user   .who, .b-user   .dot { color: #cbd5e1; background-color: #cbd5e1; }
.b-arkadi .who span:first-child, .b-arkadi .dot { color: #c4b5fd; background-color: var(--arkadi); }
.b-ynon-claude .who span:first-child, .b-ynon-claude .dot { color: #5eead4; background-color: var(--ynon); }
.b-apex-claude .who span:first-child, .b-apex-claude .dot { color: #93c5fd; background-color: var(--apex); }
.b-arkadi { border-color: rgba(124,58,237,.4); }
.b-ynon-claude { border-color: rgba(20,184,166,.4); }
.b-apex-claude { border-color: rgba(59,130,246,.4); }

.composer {
  display: flex; gap: 8px; padding: 12px clamp(12px, 6vw, 120px);
  border-top: 1px solid var(--line); background: rgba(10, 16, 30, .7);
}
.composer select {
  background: var(--panel2); border: 1px solid var(--line); color: var(--text);
  border-radius: 8px; padding: 0 8px; font-size: 12px;
}
.composer input {
  flex: 1; background: var(--panel2); border: 1px solid var(--line); color: var(--text);
  border-radius: 8px; padding: 10px 14px; font-size: 14px;
}
.composer input:focus, .tokenbox input:focus { outline: none; border-color: var(--ynon); }
.empty { color: var(--muted); text-align: center; margin: auto; font-size: 14px; }
