/* Swalife Studios MVP v2 - clean light corporate biotech UI */
:root{
  --bg:#f5f7fb;
  --card:#ffffff;
  --text:#0f172a;
  --muted:#64748b;
  --line:#e2e8f0;
  --accent:#2563eb;   /* blue */
  --accent2:#0ea5e9;  /* sky */
  --shadow: 0 10px 30px rgba(15, 23, 42, .08);
  --shadow2: 0 18px 45px rgba(15, 23, 42, .10);
}

*{box-sizing:border-box}
html,body{height:100%}
body{
  margin:0;
  font-family: system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial, "Noto Sans";
  background: radial-gradient(1000px 700px at 15% 0%, rgba(37,99,235,.09), transparent 55%),
              radial-gradient(900px 650px at 85% 10%, rgba(14,165,233,.08), transparent 55%),
              var(--bg);
  color:var(--text);
}

.topbar{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
  padding:14px 16px;
  background: rgba(255,255,255,.75);
  backdrop-filter: blur(10px);
  border-bottom:1px solid var(--line);
  position:sticky;
  top:0;
  z-index:20;
}

.brand{display:flex; align-items:center; gap:12px;}
.brand-mark{
  width:38px;height:38px;border-radius:14px;
  display:grid;place-items:center;
  background: linear-gradient(135deg, rgba(37,99,235,.16), rgba(14,165,233,.16));
  border:1px solid rgba(37,99,235,.18);
  font-weight:900;
  color:#0b2a6f;
}
.brand-title{font-weight:900; letter-spacing:.2px}
.brand-subtitle{font-size:12px; color:var(--muted)}

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

.projectbar{
  max-width:1200px;
  margin:14px auto 0 auto;
  padding:14px;
  border:1px solid var(--line);
  border-radius:18px;
  background: rgba(255,255,255,.85);
  box-shadow: var(--shadow);
}

.projectbar-row{
  display:flex;
  justify-content:space-between;
  gap:12px;
  align-items:flex-start;
}
.projectbar-title{font-weight:900}
.projectbar-sub{font-size:12px; color:var(--muted); margin-top:2px}
.projectbar-right{display:flex; gap:10px; flex-wrap:wrap}

.projectbar-form{margin-top:12px; display:block;}
.grid4{display:grid; grid-template-columns: repeat(4, 1fr); gap:12px;}
.grid3{display:grid; grid-template-columns: repeat(3, 1fr); gap:12px; margin-top:10px;}
@media (max-width: 1100px){ .grid4{grid-template-columns:1fr 1fr} .grid3{grid-template-columns:1fr} }
@media (max-width: 640px){ .grid4{grid-template-columns:1fr} }

.wrap{
  max-width:1200px;
  margin:14px auto 34px auto;
  padding:0 14px;
}

.tabs{
  display:flex;
  gap:10px;
  flex-wrap:wrap;
  margin:14px 0;
}
.tab{
  border:1px solid var(--line);
  background: rgba(255,255,255,.85);
  color: var(--text);
  padding:10px 12px;
  border-radius:999px;
  cursor:pointer;
  font-weight:800;
  box-shadow: 0 6px 16px rgba(15, 23, 42, .06);
}
.tab.active{
  border-color: rgba(37,99,235,.35);
  background: linear-gradient(135deg, rgba(37,99,235,.12), rgba(14,165,233,.10));
  color:#0b2a6f;
}

.panel-head{
  display:flex;
  justify-content:space-between;
  gap:14px;
  align-items:flex-start;
  margin-bottom:12px;
}
h1{margin:0; font-size:22px; letter-spacing:.2px}
.small{font-size:12px}
.muted{color:var(--muted)}

.llmbar{max-width: 560px; text-align:right;}
.llm-buttons{
  display:flex;
  gap:8px;
  flex-wrap:wrap;
  justify-content:flex-end;
  margin-top:8px;
}

.grid2{
  display:grid;
  grid-template-columns: 1fr 1fr;
  gap:14px;
}
@media (max-width: 1000px){
  .grid2{grid-template-columns:1fr}
  .llmbar{text-align:left; max-width:100%}
  .llm-buttons{justify-content:flex-start}
}

.card{
  background: rgba(255,255,255,.9);
  border:1px solid var(--line);
  border-radius:18px;
  box-shadow: var(--shadow2);
  overflow:hidden;
}
.card-head{
  display:flex;
  justify-content:space-between;
  gap:12px;
  align-items:center;
  padding:14px;
  border-bottom:1px solid var(--line);
}
.card-title{font-weight:900}
.card-body{padding:14px}

.row{display:flex; gap:10px; align-items:center}
.row.between{justify-content:space-between}
@media (max-width: 640px){ .row{flex-direction:column; align-items:stretch} }

.label{display:block; font-size:12px; color:var(--muted); margin:10px 0 6px 0}

.input,.select,.textarea{
  width:100%;
  border:1px solid var(--line);
  background: #fff;
  border-radius:14px;
  padding:10px 12px;
  color:var(--text);
  outline:none;
}
.select{cursor:pointer}
.textarea{resize:vertical; line-height:1.45; min-height:120px}

.btn{
  border:1px solid var(--line);
  background: #fff;
  color: var(--text);
  padding:9px 12px;
  border-radius:14px;
  cursor:pointer;
  font-weight:800;
  transition: transform .08s ease, box-shadow .12s ease, border-color .12s ease;
  white-space:nowrap;
}
.btn:hover{transform: translateY(-1px); box-shadow: 0 10px 20px rgba(15,23,42,.08); border-color: rgba(37,99,235,.25)}
.btn:active{transform: translateY(0px)}
.btn-primary{
  background: linear-gradient(135deg, rgba(37,99,235,.16), rgba(14,165,233,.14));
  border-color: rgba(37,99,235,.25);
  color:#0b2a6f;
}
.btn-ghost{background: transparent;}
.btn-llm{font-size:12px}

.pill{
  font-size:12px;
  color: var(--muted);
  border:1px solid var(--line);
  background: rgba(248,250,252,.9);
  padding:6px 10px;
  border-radius:999px;
  max-width: 56ch;
  overflow:hidden;
  text-overflow:ellipsis;
  white-space:nowrap;
}

.inline-help{
  margin:10px 0 6px 0;
  padding:10px 12px;
  border-radius:14px;
  border:1px dashed rgba(37,99,235,.25);
  background: rgba(37,99,235,.06);
  color:#0b2a6f;
  font-size:12px;
  line-height:1.4;
}

.runs{display:flex; flex-direction:column; gap:10px}
.run{
  border:1px solid var(--line);
  border-radius:16px;
  background: rgba(248,250,252,.85);
  padding:12px;
}
.run-head{
  display:flex;
  justify-content:space-between;
  gap:12px;
  align-items:flex-start;
}
.run-title{font-weight:900}
.run-meta{font-size:12px; color:var(--muted); margin-top:2px}
.run-actions{display:flex; gap:8px; flex-wrap:wrap; justify-content:flex-end}
.badge{
  font-size:11px;
  padding:3px 8px;
  border-radius:999px;
  border:1px solid var(--line);
  background: #fff;
  color: var(--muted);
}
.badge.good{border-color: rgba(16,185,129,.35); color: rgba(16,185,129,.95)}
.badge.warn{border-color: rgba(245,158,11,.35); color: rgba(245,158,11,.95)}
.badge.bad{border-color: rgba(244,63,94,.35); color: rgba(244,63,94,.95)}

.run-body{
  margin-top:10px;
  display:grid;
  grid-template-columns: 1fr 1fr;
  gap:10px;
}
@media (max-width: 900px){ .run-body{grid-template-columns:1fr} }

.run-box{
  border:1px solid var(--line);
  background:#fff;
  border-radius:14px;
  padding:10px;
  min-height: 84px;
  overflow:auto;
  max-height: 260px;
  white-space: pre-wrap;
  line-height:1.4;
  font-size:13px;
}

.toast{
  position: fixed;
  right: 16px;
  bottom: 16px;
  padding: 12px 14px;
  border-radius: 16px;
  background: rgba(255,255,255,.95);
  border: 1px solid var(--line);
  box-shadow: var(--shadow2);
  color: var(--text);
  display:none;
  max-width: 560px;
  z-index: 50;
}


/* Chain Builder */
.chainbox{
  margin-top:10px;
  padding:12px;
  border-radius:16px;
  border:1px solid rgba(37,99,235,.18);
  background: rgba(37,99,235,.04);
}
.chainhead{
  display:flex;
  align-items:flex-start;
  justify-content:space-between;
  gap:10px;
}
.chainbody{display:block}
