:root{
  --bg:#070b16;
  --card: rgba(255,255,255,0.04);
  --border: rgba(255,255,255,0.10);
  --text:#eaf0ff;
  --muted:#a7b3d6;
  --primary:#5b8cff;
  --primary2:#3d63ff;
  --danger:#ff4d6d;
  --ok:#48ffb5;
  --shadow: 0 18px 50px rgba(0,0,0,0.45);
  --radius: 18px;
}

*{ box-sizing:border-box; }

body{
  margin:0;
  font-family: ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Arial;
  background: radial-gradient(1000px 600px at 30% 0%, #121e3a 0%, var(--bg) 70%);
  color: var(--text);
}

.bgGlow{
  position:fixed;
  inset:0;
  background:
    radial-gradient(500px 250px at 80% 20%, rgba(91,140,255,0.25), transparent 60%),
    radial-gradient(450px 250px at 20% 70%, rgba(72,255,181,0.16), transparent 60%);
  pointer-events:none;
  z-index:-1;
}

.container{
  max-width: 1100px;
  margin: 30px auto;
  padding: 16px;
}

.header{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap: 16px;
  padding: 18px 18px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.brand{
  display:flex;
  align-items:center;
  gap: 12px;
}

.logo{
  width: 44px;
  height: 44px;
  border-radius: 14px;
  background: linear-gradient(135deg, rgba(91,140,255,1), rgba(72,255,181,0.9));
  display:flex;
  align-items:center;
  justify-content:center;
  font-weight: 900;
  color: #071126;
}

.header h1{
  margin:0;
  font-size: 18px;
}

.header p{
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 12px;
}

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

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

.grid{
  display:grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
  margin-top: 18px;
}

@media (max-width: 1000px){
  .grid{ grid-template-columns: 1fr; }
}

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

.cardTitle{
  display:flex;
  align-items:center;
  gap: 10px;
  margin-bottom: 10px;
}

.pill{
  font-size: 11px;
  color: var(--muted);
  border: 1px solid var(--border);
  padding: 5px 10px;
  border-radius: 999px;
  background: rgba(0,0,0,0.25);
}

h2{
  margin:0;
  font-size: 16px;
}

label{
  display:block;
  margin-top: 12px;
  margin-bottom: 6px;
  font-size: 12px;
  color: var(--muted);
}

input, textarea{
  width:100%;
  padding: 12px 12px;
  border-radius: 14px;
  border: 1px solid var(--border);
  background: rgba(0,0,0,0.25);
  color: var(--text);
  outline:none;
}

textarea{
  min-height: 170px;
  resize: vertical;
  line-height: 1.5;
}

.tabs{
  display:flex;
  gap: 10px;
  margin-top: 12px;
}

.tab{
  flex:1;
  padding: 10px 12px;
  border-radius: 14px;
  border: 1px solid var(--border);
  background: rgba(0,0,0,0.25);
  color: var(--muted);
  cursor:pointer;
  font-weight: 600;
}

.tab.active{
  background: rgba(91,140,255,0.22);
  color: var(--text);
  border-color: rgba(91,140,255,0.55);
}

.panel{ margin-top: 8px; }
.hidden{ display:none; }

.row{
  display:flex;
  align-items:center;
  gap: 10px;
  margin-top: 12px;
}

.btn{
  border: none;
  cursor:pointer;
  font-weight: 700;
  border-radius: 14px;
  padding: 11px 14px;
  transition: transform 0.05s ease;
}

.btn:active{ transform: translateY(1px); }

.btn.primary{
  background: linear-gradient(135deg, var(--primary), var(--primary2));
  color: white;
}

.btn.ghost{
  background: rgba(0,0,0,0.25);
  border: 1px solid var(--border);
  color: var(--text);
}

.status{
  color: var(--muted);
  font-size: 12px;
}

.metaRow{
  display:flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 12px;
}

.badge{
  font-size: 11px;
  color: var(--muted);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 6px 10px;
  background: rgba(0,0,0,0.25);
}

.hint{
  margin-top: 10px;
  font-size: 12px;
  color: var(--muted);
}

.answerCard{
  margin-top: 14px;
  border-top: 1px solid var(--border);
  padding-top: 14px;
}

.answerHeader{
  display:flex;
  justify-content:space-between;
  align-items:flex-start;
  gap: 12px;
}

.answerHeader h3{
  margin:0;
  font-size: 14px;
}

.kpis{
  display:flex;
  gap: 8px;
  flex-wrap: wrap;
}

.kpi{
  font-size: 11px;
  color: var(--muted);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 6px 10px;
  background: rgba(0,0,0,0.25);
}

.answerText{
  margin-top: 10px;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: rgba(0,0,0,0.25);
  color: var(--text);
  line-height: 1.5;
}

.sourcesHeader{
  margin-top: 14px;
}

.sourcesHeader h3{
  margin:0;
  font-size: 14px;
}

.sourcesHeader p{
  margin: 6px 0 0;
  font-size: 12px;
  color: var(--muted);
}

.sources{
  margin-top: 10px;
  display:flex;
  flex-direction: column;
  gap: 10px;
}

.sourceItem{
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: rgba(0,0,0,0.22);
}

.sourceTop{
  display:flex;
  justify-content:space-between;
  gap: 8px;
  align-items:center;
}

.sourceTitle{
  font-weight: 800;
  font-size: 13px;
}

.sourceMeta{
  font-size: 11px;
  color: var(--muted);
}

.sourceText{
  margin-top: 10px;
  font-size: 12px;
  color: var(--text);
  white-space: pre-wrap;
  line-height: 1.45;
  opacity: 0.95;
}

.footer{
  margin-top: 16px;
  color: var(--muted);
  font-size: 12px;
  text-align:center;
}
