:root{
  --bg: #0b1020;
  --card: rgba(255,255,255,0.06);
  --card2: rgba(255,255,255,0.08);
  --text: rgba(255,255,255,0.92);
  --muted: rgba(255,255,255,0.68);
  --border: rgba(255,255,255,0.12);
  --shadow: 0 16px 50px rgba(0,0,0,0.45);
  --radius: 18px;
}

*{ box-sizing:border-box; }
html,body{ height:100%; }
body{
  margin:0;
  font-family: ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial, "Apple Color Emoji","Segoe UI Emoji";
  background:
    radial-gradient(1100px 700px at 15% 10%, rgba(90,120,255,0.26), transparent 55%),
    radial-gradient(900px 600px at 90% 20%, rgba(110,255,190,0.16), transparent 55%),
    radial-gradient(900px 700px at 30% 95%, rgba(255,140,120,0.14), transparent 55%),
    var(--bg);
  color: var(--text);
}

.shell{ max-width: 1100px; margin: 0 auto; padding: 22px 18px 40px; }
.topbar{
  display:flex; align-items:center; justify-content:space-between;
  padding: 14px 16px;
  border: 1px solid var(--border);
  background: linear-gradient(180deg, rgba(255,255,255,0.08), rgba(255,255,255,0.04));
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  backdrop-filter: blur(10px);
}

.brand{ display:flex; gap:12px; align-items:center; }
.logo{
  width:42px; height:42px; border-radius: 14px;
  display:grid; place-items:center;
  font-weight:700;
  background: linear-gradient(135deg, rgba(90,120,255,0.9), rgba(110,255,190,0.8));
  color: rgba(10,12,18,0.92);
}
.title{ font-size: 16px; font-weight: 700; letter-spacing: 0.2px; }
.subtitle{ font-size: 12.5px; color: var(--muted); margin-top:2px; }

.status{
  font-size: 12px;
  padding: 8px 10px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: rgba(255,255,255,0.06);
  color: var(--muted);
}

.content{ margin-top: 18px; display:grid; gap: 16px; }

.card{
  border: 1px solid var(--border);
  background: linear-gradient(180deg, rgba(255,255,255,0.08), rgba(255,255,255,0.04));
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 18px;
  backdrop-filter: blur(10px);
}

.card h2{ margin: 0 0 8px; font-size: 18px; }
.muted{ color: var(--muted); margin: 0 0 14px; line-height: 1.35; }

.grid{
  display:grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}
@media (max-width: 860px){
  .grid{ grid-template-columns: 1fr; }
}

.field label{
  display:block;
  font-size: 12.5px;
  color: var(--muted);
  margin-bottom: 6px;
}

input, select, textarea{
  width:100%;
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: rgba(10,12,18,0.45);
  color: var(--text);
  outline: none;
}
input:focus, select:focus, textarea:focus{
  border-color: rgba(110,255,190,0.55);
  box-shadow: 0 0 0 3px rgba(110,255,190,0.15);
}

.chips{
  display:flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 10px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: rgba(10,12,18,0.35);
}
.chip{
  display:inline-flex; align-items:center; gap:8px;
  padding: 8px 10px;
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,0.12);
  background: rgba(255,255,255,0.06);
  font-size: 12.5px;
  color: var(--text);
}
.chip input{ width:auto; }
.chip.danger{
  border-color: rgba(255,140,120,0.35);
  background: rgba(255,140,120,0.10);
}

.checkbox{ display:flex; gap:10px; align-items:flex-start; line-height: 1.25; }
.checkbox input{ margin-top: 3px; width:auto; }

.actions{ display:flex; gap:10px; justify-content:flex-end; grid-column: 1 / -1; }

.btn{
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: rgba(255,255,255,0.06);
  color: var(--text);
  cursor: pointer;
  transition: transform 0.06s ease, background 0.15s ease;
}
.btn:hover{ background: rgba(255,255,255,0.10); }
.btn:active{ transform: translateY(1px); }
.btn.primary{
  border-color: rgba(110,255,190,0.35);
  background: rgba(110,255,190,0.16);
}
.btn.danger{
  border-color: rgba(255,140,120,0.35);
  background: rgba(255,140,120,0.14);
}

.hidden{ display:none; }

.chatHeader{
  display:flex; justify-content:space-between; align-items:flex-start; gap:12px;
  margin-bottom: 12px;
}
.chatHeaderActions{ display:flex; gap:10px; }

.chatWindow{
  height: 440px;
  overflow:auto;
  border-radius: 14px;
  border: 1px solid var(--border);
  background: rgba(10,12,18,0.40);
  padding: 12px;
}

.msg{
  display:flex;
  gap: 10px;
  margin: 10px 0;
}
.bubble{
  max-width: 78%;
  padding: 10px 12px;
  border-radius: 14px;
  border: 1px solid rgba(255,255,255,0.10);
  background: rgba(255,255,255,0.06);
  line-height: 1.35;
  white-space: pre-wrap;
}
.msg.user{ justify-content:flex-end; }
.msg.user .bubble{
  background: rgba(90,120,255,0.16);
  border-color: rgba(90,120,255,0.28);
}
.msg.assistant .bubble{
  background: rgba(255,255,255,0.06);
}
.role{
  width:28px; height:28px; border-radius: 10px;
  display:grid; place-items:center;
  border: 1px solid var(--border);
  background: rgba(255,255,255,0.05);
  color: var(--muted);
  font-size: 12px;
}

.chatInputRow{
  display:flex; gap:10px;
  margin-top: 12px;
}
.chatInputRow input{
  flex: 1;
}
.footnote{
  margin-top: 10px;
  font-size: 12px;
  color: var(--muted);
}

/* Loading spinner */
.spinner {
  width: 14px;
  height: 14px;
  border-radius: 999px;
  border: 2px solid rgba(255,255,255,0.25);
  border-top-color: rgba(255,255,255,0.85);
  animation: spin 0.8s linear infinite;
  flex: 0 0 auto;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.bubbleRow {
  display: inline-flex;
  align-items: center;
  gap: 10px;
}


