:root {
  font: 15px/1.45 system-ui, sans-serif;
  color: #e6eaf2;
  background: #0c111a;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }

body { margin: 0; padding: clamp(12px, 4vw, 44px) 12px; }
#office {
  max-width: 760px;
  min-height: 520px;
  margin: auto;
  padding: clamp(12px, 3vw, 24px);
  border: 1px solid #283344;
  border-radius: 16px;
  background: #111722;
}

h1 { font-size: 24px; line-height: 1.15; margin: 0; }
h2 { margin: 0 0 8px; font-size: 17px; }
p { margin: 8px 0 0; }
.muted { color: #aebacf; font-size: 13px; }
.head, .actions, .tabs { display: flex; align-items: center; gap: 8px; }
.head { justify-content: space-between; }
.actions, .tabs { flex-wrap: wrap; }
.tabs { margin: 16px 0; }

button, input, select, textarea { font: inherit; }
button {
  cursor: pointer;
  min-height: 40px;
  border: 1px solid #4b5871;
  border-radius: 8px;
  padding: 8px 12px;
  background: #222d40;
  color: #eef2ff;
}
button:hover { background: #34445e; }
button:disabled { cursor: default; opacity: .55; }
button:focus-visible, input:focus-visible, textarea:focus-visible,
select:focus-visible, summary:focus-visible { outline: 2px solid #b4b6ff; outline-offset: 3px; }
button.primary { background: #5a47c4; border-color: #a192ff; }
button.primary:hover { background: #6855d1; }
.tabs [aria-pressed="true"] { background: #394460; border-color: #9ba8ff; }

.stats, .world { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.stats { margin: 14px 0 0; }
.stat { background: #1c2636; border-radius: 9px; padding: 10px; }
.stat strong { font-size: 24px; display: block; line-height: 1.2; }
.world {
  background: radial-gradient(ellipse at center, #293c3c, #18262c);
  border: 1px solid #435757;
  border-radius: 12px;
  padding: 12px;
}
button.agent {
  border-color: #50686b;
  background: #1b2a31;
  padding: 8px 3px;
  text-align: center;
  min-width: 0;
  overflow-wrap: anywhere;
}
button.agent:hover { border-color: #a5b4fc; background: #24383f; }
button.agent[aria-pressed="true"] { border-color: var(--agent-color); }
.agent b, .agent .muted { display: block; }
.agent .activity { display: block; font-size: 11px; margin-top: 5px; color: var(--agent-color); }
.house { width: 100%; max-width: 94px; height: 72px; margin: auto; display: block; }
[data-agent="alex"] { --agent-color: #a78bfa; }
[data-agent="max"] { --agent-color: #60a5fa; }
[data-agent="anna"] { --agent-color: #34d399; }
[data-agent="lev"] { --agent-color: #fbbf24; }
[data-agent="sofia"] { --agent-color: #22d3ee; }
[data-agent="mark"] { --agent-color: #a5b4fc; }
[data-agent="eva"] { --agent-color: #f472b6; }
.agent-title { color: var(--agent-color); }

.detail, .task, .login {
  background: #202b3c;
  border-radius: 10px;
  padding: 14px;
}
.detail { margin: 12px 0; }
.detail .actions, #assign { margin-top: 12px; }
.task { margin: 8px 0; }
.task p, .result { white-space: pre-wrap; overflow-wrap: anywhere; }
.result { background: #151f2e; border-radius: 8px; padding: 12px; margin: 8px 0; }
.task details, .task .actions { margin-top: 10px; }
.task summary { cursor: pointer; }
.task .pill {
  display: inline-block;
  color: #e3e5ff;
  background: #393f64;
  border-radius: 12px;
  padding: 3px 8px;
  font-size: 12px;
}
.task .pill[data-status="completed"] { color: #b4f2d5; background: #1d4e42; }
.task .pill[data-status="failed"] { color: #ffd0d0; background: #6e353b; }
.task .error { white-space: normal; }
.empty { text-align: center; color: #aebacf; padding: 32px 8px; }
.pagination { justify-content: space-between; }
.error { color: #ffc3c3; margin: 10px 0; }

.login { max-width: 380px; margin: 56px auto 0; padding: 20px; }
.login header { margin-bottom: 18px; }
.login button { margin-top: 4px; }
label { display: block; font-weight: 600; }
input, select, textarea {
  width: 100%;
  color: #eef2ff;
  background: #131c2a;
  border: 1px solid #52617d;
  border-radius: 7px;
  padding: 9px 10px;
  margin: 5px 0 10px;
}
textarea { resize: vertical; }

@media (max-width: 420px) {
  .world { padding: 7px; gap: 5px; }
  .head > .actions { justify-content: flex-end; }
  button { padding-inline: 9px; }
  .house { height: 56px; }
  .agent .muted, .agent .activity { font-size: 11px; }
}

@media (max-width: 340px) {
  .world { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
