@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&family=JetBrains+Mono:wght@400;500&display=swap');

:root {
  --bg: #0b1020; --panel: #111a2e; --panel-2: #0e1628; --raise: #16213a;
  --border: rgba(148,163,184,.16); --border-strong: rgba(148,163,184,.3);
  --text: #e5e7eb; --muted: #94a3b8; --faint: #64748b;
  --accent: #f472b6; --accent-2: #a78bfa; --cyan: #22d3ee; --ok: #34d399; --warn: #fbbf24; --bad: #f87171;
}
* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { background: var(--bg); color: var(--text); }
body {
  font-family: 'Inter', system-ui, -apple-system, Segoe UI, sans-serif; font-size: 15px; line-height: 1.5; min-height: 100vh;
  background:
    radial-gradient(1000px 520px at 5% -10%, rgba(244,114,182,.10), transparent 60%),
    radial-gradient(900px 480px at 100% 0%, rgba(167,139,250,.13), transparent 60%), var(--bg);
}
a { color: var(--cyan); text-decoration: none; }
a:hover { text-decoration: underline; }
button, input, select { font: inherit; color: inherit; }
.wrap { max-width: 1320px; margin: 0 auto; padding: 22px 16px 64px; }
.muted { color: var(--muted); } .faint { color: var(--faint); } .mono { font-family: 'JetBrains Mono', monospace; }

/* Header */
.top { display: flex; justify-content: space-between; align-items: center; gap: 14px; flex-wrap: wrap; margin-bottom: 18px; }
.brand { display: flex; gap: 12px; align-items: center; }
.logo { width: 42px; height: 42px; border-radius: 12px; display: grid; place-items: center; font-size: 22px;
  background: linear-gradient(135deg, rgba(244,114,182,.28), rgba(167,139,250,.28)); border: 1px solid var(--border); }
.brand h1 { font-size: 1.5rem; font-weight: 800; letter-spacing: -.02em;
  background: linear-gradient(90deg, #f9a8d4, #c4b5fd); -webkit-background-clip: text; background-clip: text; color: transparent; }
.brand p { color: var(--muted); font-size: .9rem; }
.pill { font-family: 'JetBrains Mono', monospace; font-size: .74rem; border: 1px solid var(--border-strong); padding: .3rem .65rem;
  border-radius: 999px; background: rgba(255,255,255,.03); color: var(--muted); white-space: nowrap; }
.pill b { color: var(--text); }
.pill.low { color: var(--warn); border-color: rgba(251,191,36,.4); }

/* Layout */
.layout { display: grid; grid-template-columns: minmax(0, 1fr) 280px; gap: 18px; align-items: start; }
@media (max-width: 1020px) { .layout { grid-template-columns: 1fr; } .history { order: 2; } }
.panel { background: linear-gradient(180deg, rgba(255,255,255,.035), rgba(255,255,255,.01)); border: 1px solid var(--border);
  border-radius: 14px; padding: 18px; margin-bottom: 18px; box-shadow: 0 18px 50px rgba(0,0,0,.28); }
.panel h2 { font-size: 1rem; font-weight: 700; margin-bottom: 12px; display: flex; gap: 8px; align-items: center; }
.count { font-size: .74rem; color: var(--muted); background: var(--raise); border-radius: 999px; padding: .1rem .55rem; font-weight: 600; }

/* Search */
.search { display: grid; grid-template-columns: 1fr auto; gap: 10px; }
.search input { background: var(--panel-2); border: 1px solid var(--border); border-radius: 12px; padding: 13px 15px; font-size: 1rem; outline: none; width: 100%; }
.search input:focus { border-color: rgba(244,114,182,.6); box-shadow: 0 0 0 3px rgba(244,114,182,.12); }
.opts { display: flex; flex-wrap: wrap; gap: 10px 20px; align-items: center; margin-top: 12px; color: var(--muted); font-size: .88rem; }
.opts label { display: inline-flex; gap: 8px; align-items: center; cursor: pointer; }
.opts select, .tool select, .tool input { background: var(--panel-2); border: 1px solid var(--border); border-radius: 9px; padding: 7px 10px; outline: none; }
.opts input[type=checkbox], .tool input[type=checkbox] { width: 16px; height: 16px; accent-color: #f472b6; }
.chips { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 12px; }
.chip { font-size: .8rem; border: 1px solid var(--border); background: var(--raise); border-radius: 999px; padding: 5px 11px; cursor: pointer; color: var(--muted); }
.chip:hover { color: var(--text); border-color: var(--border-strong); }
.note { font-size: .8rem; color: var(--faint); margin-top: 10px; }

/* Buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; border-radius: 10px; font-weight: 700; font-size: .86rem;
  padding: 9px 14px; border: 1px solid var(--border); background: var(--raise); color: var(--text); cursor: pointer; white-space: nowrap; text-decoration: none; }
.btn:hover { border-color: var(--border-strong); filter: brightness(1.1); text-decoration: none; }
.btn[disabled] { opacity: .45; pointer-events: none; }
.btn-primary { background: linear-gradient(90deg, #ec4899, #8b5cf6); border: none; color: #fff; padding: 12px 22px; font-size: .95rem; box-shadow: 0 10px 28px rgba(236,72,153,.25); }
.btn-sm { padding: 5px 9px; font-size: .76rem; border-radius: 8px; }
.btn-danger { color: #fecaca; border-color: rgba(248,113,113,.35); background: rgba(248,113,113,.08); }
.spin { width: 14px; height: 14px; border-radius: 50%; border: 2px solid rgba(255,255,255,.3); border-top-color: #fff; animation: rot .8s linear infinite; display: inline-block; }
@keyframes rot { to { transform: rotate(360deg); } }

/* Progress */
#progress { display: none; }
#progress.on { display: block; }
.prog-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-bottom: 10px; }
.log { font-family: 'JetBrains Mono', monospace; font-size: .76rem; line-height: 1.6; color: #cbd5e1; background: #070b16; border: 1px solid var(--border);
  border-radius: 10px; padding: 10px 12px; max-height: 190px; overflow: auto; display: flex; flex-direction: column-reverse; }
.log div:first-child { color: var(--accent); }

/* Stats */
.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; margin-bottom: 14px; }
.stat { background: rgba(255,255,255,.03); border: 1px solid var(--border); border-radius: 12px; padding: 12px 14px; }
.stat .l { font-size: .68rem; color: var(--muted); font-weight: 700; text-transform: uppercase; letter-spacing: .08em; }
.stat .v { font-size: 1.55rem; font-weight: 800; letter-spacing: -.02em; }
.stat .s { font-size: .76rem; color: var(--faint); }
@media (max-width: 700px) { .stats { grid-template-columns: repeat(2, 1fr); } }

/* Toolbar */
.tool { display: flex; flex-wrap: wrap; gap: 8px 14px; align-items: center; margin-bottom: 12px; font-size: .86rem; color: var(--muted); }
.tool input[type=search] { flex: 1 1 200px; padding: 8px 11px; }
.tool label { display: inline-flex; gap: 6px; align-items: center; cursor: pointer; }
.parsed { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 12px; }
.tag { font-size: .74rem; color: var(--muted); background: var(--raise); border: 1px solid var(--border); padding: .15rem .55rem; border-radius: 6px; }
.tag b { color: var(--text); font-weight: 600; }

/* Result cards */
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 12px; }
.card { background: var(--panel-2); border: 1px solid var(--border); border-radius: 12px; padding: 14px; display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.card:hover { border-color: var(--border-strong); }
.c-head { display: flex; gap: 10px; align-items: center; min-width: 0; }
.av { width: 42px; height: 42px; flex: 0 0 42px; border-radius: 50%; display: grid; place-items: center; font-weight: 800; color: #fff;
  background: linear-gradient(135deg, #ec4899, #8b5cf6); }
.av.biz { background: linear-gradient(135deg, #0ea5e9, #64748b); }
.c-name { font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.c-user { font-size: .82rem; }
.badges { display: flex; gap: 6px; flex-wrap: wrap; margin-left: auto; }
.badge { font-size: .68rem; font-weight: 700; border-radius: 999px; padding: .12rem .5rem; border: 1px solid var(--border); color: var(--muted); white-space: nowrap; }
.badge.f { color: var(--cyan); border-color: rgba(34,211,238,.35); }
.badge.b { color: #93c5fd; }
.bio { font-size: .84rem; color: #cbd5e1; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.contact { display: flex; flex-direction: column; gap: 4px; font-size: .84rem; }
.contact .row { display: flex; gap: 6px; align-items: center; min-width: 0; }
.contact .row span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.guess { font-size: .68rem; color: var(--warn); border: 1px solid rgba(251,191,36,.35); border-radius: 6px; padding: 0 5px; }
.why { font-size: .74rem; color: var(--faint); }
.c-foot { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin-top: auto; }
.empty { text-align: center; color: var(--muted); padding: 34px 12px; }
.empty .big { font-size: 2.2rem; }

/* History */
.history { position: sticky; top: 16px; }
.h-item { display: block; padding: 9px 10px; border-radius: 10px; border: 1px solid transparent; cursor: pointer; }
.h-item:hover, .h-item.on { background: rgba(255,255,255,.04); border-color: var(--border); }
.h-q { font-size: .86rem; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.h-m { font-size: .72rem; color: var(--faint); display: flex; justify-content: space-between; gap: 6px; }
.h-del { background: none; border: 0; color: var(--faint); cursor: pointer; font-size: .8rem; }
.h-del:hover { color: var(--bad); }

#toast { position: fixed; right: 16px; bottom: 16px; z-index: 50; display: flex; flex-direction: column; gap: 8px; }
.toast { background: var(--raise); border: 1px solid var(--border-strong); border-left: 4px solid var(--accent); border-radius: 10px; padding: 10px 14px;
  box-shadow: 0 10px 30px rgba(0,0,0,.4); font-size: .88rem; max-width: 360px; }
.toast.err { border-left-color: var(--bad); }
