:root{
  --bg:#0b1020;
  --panel:#111a33;
  --stroke:rgba(255,255,255,.10);
  --txt:rgba(255,255,255,.92);
  --muted:rgba(255,255,255,.68);
  --primary:#6ea8ff;
  --primary2:#89ffb6;
  --danger:#ff6e6e;
  --shadow: 0 12px 30px rgba(0,0,0,.35);
  --radius:18px;
  --pad:14px;
  --gap:14px;
  font-family: system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
}

*{ box-sizing:border-box; }
html,body{ height:100%; }
body{
  margin:0;
  background: radial-gradient(1200px 600px at 10% 10%, rgba(110,168,255,.15), transparent 60%),
              radial-gradient(900px 500px at 90% 0%, rgba(137,255,182,.10), transparent 55%),
              var(--bg);
  color:var(--txt);
}

.topbar{
  display:flex; align-items:center; justify-content:space-between;
  padding:16px 18px;
  border-bottom:1px solid var(--stroke);
  position:sticky; top:0; backdrop-filter: blur(10px);
  background: rgba(11,16,32,.65);
  z-index:10;
}

.brand{ display:flex; align-items:center; gap:12px; }
.dot{
  width:14px; height:14px; border-radius:999px;
  background: linear-gradient(135deg, var(--primary), var(--primary2));
  box-shadow: 0 0 0 6px rgba(110,168,255,.12);
}
.title{ font-weight:800; letter-spacing:.2px; }
.subtitle{ font-size:12px; color:var(--muted); }

.layout{
  display:grid;
  grid-template-columns: 420px 1fr;
  gap: var(--gap);
  padding: var(--gap);
}

.panel{
  background: rgba(17,26,51,.72);
  border:1px solid var(--stroke);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: var(--pad);
  min-height: calc(100vh - 110px);
}

.panel h2{ margin: 0 0 10px 0; font-size:16px; }
.muted{ color: var(--muted); font-size:13px; }

.form{
  display:flex; flex-direction:column; gap:10px;
  border:1px dashed rgba(255,255,255,.16);
  border-radius: 14px;
  padding: 12px;
  margin: 10px 0 14px;
}

label{ display:flex; flex-direction:column; gap:6px; font-size:12px; color:var(--muted); }
input, textarea, select{
  background: rgba(0,0,0,.22);
  color: var(--txt);
  border:1px solid rgba(255,255,255,.14);
  border-radius: 12px;
  padding: 10px 12px;
  outline:none;
}
textarea{ resize: vertical; }

.hint{ font-size:12px; color: var(--muted); }

.btn{
  border:1px solid rgba(255,255,255,.18);
  background: rgba(255,255,255,.06);
  color: var(--txt);
  padding: 9px 12px;
  border-radius: 12px;
  cursor:pointer;
}
.btn:hover{ background: rgba(255,255,255,.10); }
.btn:disabled{ opacity:.45; cursor:not-allowed; }

.btn.primary{
  background: linear-gradient(135deg, rgba(110,168,255,.25), rgba(137,255,182,.12));
  border-color: rgba(110,168,255,.35);
}
.btn.ghost{ background: transparent; }

.profiles{ display:flex; flex-wrap:wrap; gap:10px; margin-bottom: 8px; }
.profileChip{
  display:flex; align-items:center; gap:10px;
  padding: 9px 12px;
  border-radius: 999px;
  border:1px solid rgba(255,255,255,.14);
  background: rgba(0,0,0,.14);
  cursor:pointer;
  user-select:none;
}
.profileChip.active{
  border-color: rgba(137,255,182,.55);
  box-shadow: 0 0 0 6px rgba(137,255,182,.10);
}
.avatar{
  width:28px; height:28px; border-radius:999px;
  display:grid; place-items:center;
  background: linear-gradient(135deg, rgba(110,168,255,.35), rgba(137,255,182,.18));
  font-weight:800;
}

.tabs{ display:flex; flex-direction:column; gap:8px; }
.tab{
  display:flex; align-items:center; justify-content:space-between;
  gap:10px;
  padding: 10px 12px;
  border-radius: 14px;
  border:1px solid rgba(255,255,255,.14);
  background: rgba(0,0,0,.14);
}
.tab.active{
  border-color: rgba(110,168,255,.55);
  box-shadow: 0 0 0 6px rgba(110,168,255,.10);
}
.tab .meta{ display:flex; flex-direction:column; gap:3px; cursor:pointer; }
.tab .name{ font-weight:700; font-size:13px; }
.tab .q{ font-size:12px; color: var(--muted); max-width: 280px; overflow:hidden; text-overflow: ellipsis; white-space:nowrap; }

.iconBtn{
  border:1px solid rgba(255,255,255,.14);
  background: rgba(255,255,255,.06);
  color: var(--txt);
  padding: 6px 10px;
  border-radius: 12px;
  cursor:pointer;
}
.iconBtn.danger{ border-color: rgba(255,110,110,.35); }
.iconBtn:hover{ background: rgba(255,255,255,.10); }

.resultsHeader{
  display:flex; align-items:flex-start; justify-content:space-between;
  gap:12px; margin-bottom: 10px;
}
.status{ margin: 10px 0; }
.results{ display:flex; flex-direction:column; gap:10px; }

.card{
  border:1px solid rgba(255,255,255,.12);
  background: rgba(0,0,0,.14);
  border-radius: 16px;
  padding: 12px;
}
.card a{ color: var(--primary); text-decoration:none; }
.card a:hover{ text-decoration: underline; }
.card .link{ font-size:12px; color: var(--muted); margin-top:6px; word-break:break-all; }
.card .snippet{ margin-top:8px; color: rgba(255,255,255,.82); font-size:13px; line-height:1.35; }

.pagerTop, .pagerBottom{
  display:flex; align-items:center; gap:10px;
}
.pagerBottom{ margin-top: 12px; justify-content:flex-end; }

.debug{
  margin-top: 12px;
  border:1px solid rgba(255,255,255,.10);
  border-radius: 14px;
  padding: 10px 12px;
  background: rgba(0,0,0,.10);
}
.debug summary{ cursor:pointer; color: var(--muted); }
.debug pre{
  white-space: pre-wrap;
  word-break: break-word;
  margin: 10px 0 0;
  color: rgba(255,255,255,.85);
  font-size: 12px;
}

@media (max-width: 1050px){
  .layout{ grid-template-columns: 1fr; }
  .panel{ min-height:auto; }
}
