/* Mobile first, one column, no frameworks and no external requests. */

:root {
  --bg: #0b0f14;
  --panel: #131a22;
  --line: #223040;
  --text: #e6edf3;
  --muted: #93a4b5;
  --accent: #4cc2ff;
  --ok: #3ddc97;
  --warn: #ffb454;
  --bad: #ff6b6b;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  min-height: 100%;
  background: var(--bg);
  color: var(--text);
  font: 16px/1.5 ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  -webkit-text-size-adjust: 100%;
}

.shell {
  max-width: 34rem;
  margin: 0 auto;
  padding: max(0.75rem, env(safe-area-inset-top)) 0.85rem max(1.5rem, env(safe-area-inset-bottom));
  display: grid;
  gap: 0.75rem;
}

.masthead {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding-top: 0.35rem;
}

.mark { font-weight: 700; letter-spacing: 0.18em; color: var(--accent); }
.title { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--muted); font-size: 0.85rem; }

.status {
  font-size: 0.75rem;
  padding: 0.15rem 0.55rem;
  border-radius: 999px;
  border: 1px solid var(--line);
  color: var(--muted);
  white-space: nowrap;
}
.status-ok { color: var(--ok); border-color: color-mix(in srgb, var(--ok) 45%, var(--line)); }
.status-wait { color: var(--warn); border-color: color-mix(in srgb, var(--warn) 45%, var(--line)); }
.status-bad { color: var(--bad); border-color: color-mix(in srgb, var(--bad) 45%, var(--line)); }

.banner {
  margin: 0;
  padding: 0.5rem 0.7rem;
  border: 1px solid color-mix(in srgb, var(--warn) 45%, var(--line));
  border-radius: 0.6rem;
  background: color-mix(in srgb, var(--warn) 12%, var(--panel));
  color: var(--warn);
  font-size: 0.85rem;
}

.card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 0.9rem;
  padding: 0.85rem;
}

h1 { font-size: 0.78rem; margin: 0 0 0.6rem; text-transform: uppercase; letter-spacing: 0.08em; color: var(--muted); }

.facts { display: grid; grid-template-columns: auto 1fr; gap: 0.3rem 0.8rem; margin: 0; font-size: 0.9rem; }
.facts dt { color: var(--muted); }
.facts dd { margin: 0; overflow-wrap: anywhere; }
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 0.8rem; }

.plan { margin: 0.6rem 0 0; font-size: 0.85rem; color: var(--muted); overflow-wrap: anywhere; }

.agents, .activity { list-style: none; margin: 0; padding: 0; display: grid; gap: 0.45rem; font-size: 0.88rem; }
.agents li { display: grid; grid-template-columns: auto 1fr; gap: 0.5rem; align-items: start; }
.dot { width: 0.55rem; height: 0.55rem; border-radius: 50%; margin-top: 0.45rem; background: var(--muted); }
.dot-on { background: var(--ok); }
.dot-run { background: var(--accent); animation: pulse 1.2s ease-in-out infinite; }
.dot-off { background: var(--bad); }
@keyframes pulse { 50% { opacity: 0.35; } }

.agent-meta { color: var(--muted); font-size: 0.78rem; overflow-wrap: anywhere; }
.agent-activity { color: var(--muted); font-size: 0.78rem; overflow-wrap: anywhere; }

.activity li { border-left: 2px solid var(--line); padding-left: 0.55rem; }
.activity .when { color: var(--muted); font-size: 0.72rem; margin-right: 0.4rem; }
.activity .who { color: var(--accent); font-size: 0.78rem; margin-right: 0.4rem; }
.activity .text { overflow-wrap: anywhere; }

.observer { margin: 0 0 0.6rem; font-size: 0.85rem; white-space: pre-wrap; overflow-wrap: anywhere; }
.muted { color: var(--muted); }

button {
  font: inherit;
  font-size: 0.9rem;
  padding: 0.5rem 0.9rem;
  border-radius: 0.6rem;
  border: 1px solid var(--line);
  background: var(--accent);
  color: #04121d;
  min-height: 2.6rem;
}
button.ghost { background: transparent; color: var(--text); }
button:disabled { opacity: 0.5; }

.composer { display: grid; gap: 0.5rem; }
textarea {
  font: inherit;
  font-size: 0.95rem;
  padding: 0.55rem;
  border-radius: 0.6rem;
  border: 1px solid var(--line);
  background: var(--bg);
  color: var(--text);
  resize: vertical;
}
.actions { display: flex; gap: 0.5rem; flex-wrap: wrap; }
.sent { margin: 0.5rem 0 0; font-size: 0.8rem; color: var(--muted); min-height: 1.2rem; }

.foot { color: var(--muted); font-size: 0.72rem; text-align: center; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

@media (prefers-color-scheme: light) {
  :root {
    --bg: #f6f8fa; --panel: #fff; --line: #d7dee7; --text: #12181f; --muted: #5a6b7c;
    --accent: #0969da; --ok: #1a7f4b; --warn: #9a6700; --bad: #b42318;
  }
  button { color: #f5faff; }
  button.ghost { color: var(--text); }
}
