:root{
  --border:#e5e7eb;
  --bg:#ffffff;
  --bg2:#f7f7f7;
  --text:#111827;
  --muted:#6b7280;
  --shadow:0 1px 0 rgba(0,0,0,.02);
}

*{ box-sizing:border-box; }
html,body{ height:100%; }
body{
  margin:0;
  background:#fafafa;
  color:var(--text);
  font-family:system-ui,-apple-system,Segoe UI,Roboto,Arial,sans-serif;
}

a{ color:inherit; text-decoration:none; }
.muted{ color:var(--muted); }
.mono{ font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,"Liberation Mono","Courier New",monospace; }

.h1{ margin:0 0 8px; font-size:28px; letter-spacing:-.2px; }
.h2{ margin:0 0 6px; font-size:18px; }

.topbar{
  position:sticky; top:0; z-index:10;
  display:flex; justify-content:space-between; align-items:center;
  padding:12px 16px;
  border-bottom:1px solid var(--border);
  background:var(--bg);
}

.brand{ font-weight:900; letter-spacing:.2px; }

.container{ max-width:1100px; margin:0 auto; padding:18px; }

.card{
  background:var(--bg);
  border:1px solid var(--border);
  border-radius:16px;
  box-shadow:var(--shadow);
  padding:14px;
}

.hero{
  display:grid;
  grid-template-columns: 1fr;
  gap:14px;
}
@media (min-width: 920px){
  .hero{ grid-template-columns: 1.05fr .95fr; }
}

.formrow{ display:flex; flex-direction:column; gap:8px; margin-top:10px; }
.label{ font-weight:700; margin-top:8px; }
.input,.select{
  padding:10px;
  border:1px solid var(--border);
  border-radius:12px;
  background:#fff;
  outline:none;
}
.input:focus,.select:focus{
  border-color:#cbd5e1;
  box-shadow:0 0 0 3px rgba(59,130,246,.12);
}

.actions{ display:flex; gap:10px; flex-wrap:wrap; margin-top:10px; }

.btn{
  padding:10px 14px;
  border-radius:12px;
  border:1px solid #d1d5db;
  background:#111827;
  color:#fff;
  cursor:pointer;
  font-weight:800;
}
.btn--ghost{ background:#fff; color:#111827; }
.btn:disabled{ opacity:.6; cursor:not-allowed; }

.error{
  margin-top:10px;
  padding:10px;
  border-radius:12px;
  border:1px solid #fecaca;
  background:#fef2f2;
  color:#991b1b;
}

.squad{ display:flex; flex-direction:column; gap:10px; }
.agent{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
  border:1px solid var(--border);
  border-radius:14px;
  padding:10px;
  background:#fff;
}
.agent__icon{ width:34px; height:34px; display:flex; align-items:center; justify-content:center; border:1px solid var(--border); border-radius:12px; }
.agent__meta{ flex:1 1 auto; }
.agent__name{ font-weight:900; }
.agent__desc{ font-size:13px; }

.chip{
  display:inline-flex; align-items:center;
  padding:6px 10px;
  border-radius:999px;
  border:1px solid var(--border);
  font-size:12px;
  font-weight:800;
  white-space:nowrap;
}
.chip--muted{ background:#f3f4f6; color:#374151; }
.chip--run{ background:#fffbeb; border-color:#fcd34d; color:#92400e; }
.chip--done{ background:#ecfdf5; border-color:#a7f3d0; color:#065f46; }

.pulsebox{
  margin-top:12px;
  border:1px dashed #d1d5db;
  background:#fafafa;
  border-radius:14px;
  padding:10px;
}
.pulsebox__bar{
  height:10px;
  border-radius:999px;
  background:linear-gradient(90deg, rgba(17,24,39,.15), rgba(17,24,39,.55), rgba(17,24,39,.15));
  background-size:200% 100%;
  animation:pulse 1.1s linear infinite;
  margin-bottom:8px;
}
@keyframes pulse{
  0%{ background-position:0% 50%; }
  100%{ background-position:200% 50%; }
}

.results{ margin-top:14px; }

.page-head{
  display:flex;
  justify-content:space-between;
  align-items:flex-start;
  gap:10px;
  margin:12px 0;
}
.page-head__actions{ display:flex; gap:10px; flex-wrap:wrap; }

.grid{ display:grid; gap:12px; grid-template-columns:1fr; }
.grid--2{ grid-template-columns:1fr; }
@media (min-width: 920px){
  .grid--2{ grid-template-columns:1fr 1fr; }
}

.report-card{
  border:1px solid var(--border);
  border-radius:16px;
  background:#fff;
  box-shadow:var(--shadow);
  overflow:hidden;
  display:flex;
  flex-direction:column;
  min-height: 260px;
}
.report-card__head{
  display:flex; justify-content:space-between; align-items:center;
  gap:10px;
  padding:12px 14px;
  border-bottom:1px solid var(--border);
  background:#fbfbfb;
}
.report-card__title{ font-weight:900; display:flex; align-items:center; gap:10px; }
.icon-chip{
  width:28px; height:28px;
  display:flex; align-items:center; justify-content:center;
  border:1px solid var(--border);
  border-radius:10px;
  background:#fff;
}

.tinybtn{
  padding:6px 10px;
  border-radius:999px;
  border:1px solid var(--border);
  background:#fff;
  cursor:pointer;
  font-weight:800;
  font-size:12px;
}
.tinybtn:hover{ background:#f3f4f6; }

.report-card__body{
  padding:12px 14px;
  flex:1 1 auto;
  overflow:auto;
}

/* Markdown styling */
.md { font-size: 14px; line-height: 1.55; }
.md p { margin: 0 0 10px; }
.md h1, .md h2, .md h3 { margin: 14px 0 8px; line-height: 1.25; }
.md h1 { font-size: 18px; }
.md h2 { font-size: 16px; }
.md h3 { font-size: 15px; }
.md ul, .md ol { margin: 8px 0 10px; padding-left: 18px; }
.md li { margin: 4px 0; }
.md pre { padding: 10px; border: 1px solid #e6e6e6; border-radius: 10px; overflow: auto; }
.md code { font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace; font-size: 12.5px; }

.footer{
  padding:14px 18px;
  border-top:1px solid var(--border);
  background:var(--bg);
}
