*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background: #0b0b0f;
  color: #e2e2e8;
  min-height: 100vh;
}

.page {
  max-width: 860px;
  margin: 0 auto;
  padding: 3rem 1.25rem 4rem;
}

.hero {
  text-align: center;
  margin-bottom: 2.5rem;
}

.hero-icon {
  display: flex;
  justify-content: center;
  margin-bottom: 1rem;
}

h1 {
  font-size: 28px;
  font-weight: 700;
  color: #fff;
  letter-spacing: -.02em;
  margin-bottom: 8px;
}

.hero-sub {
  font-size: 15px;
  color: #666;
  max-width: 420px;
  margin: 0 auto;
  line-height: 1.6;
}

.search-wrap {
  max-width: 600px;
  margin: 0 auto 2.5rem;
}

.search-box {
  display: flex;
  gap: 8px;
}

.search-box input {
  flex: 1;
  height: 50px;
  border-radius: 12px;
  border: 1.5px solid #2a2a35;
  background: #16161f;
  color: #fff;
  padding: 0 18px;
  font-size: 15px;
  font-family: inherit;
  transition: border-color .15s;
}

.search-box input:focus {
  outline: none;
  border-color: #6366f1;
}

.search-box input::placeholder { color: #444; }

.search-box button {
  height: 50px;
  padding: 0 22px;
  border-radius: 12px;
  border: none;
  background: #6366f1;
  color: #fff;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
  display: flex;
  align-items: center;
  gap: 8px;
  transition: background .15s;
  white-space: nowrap;
}

.search-box button:hover { background: #4f46e5; }
.search-box button:disabled { background: #3a3a50; cursor: not-allowed; }

.search-hint {
  text-align: center;
  font-size: 12px;
  color: #444;
  margin-top: 8px;
}

.status {
  text-align: center;
  padding: 1.5rem;
  font-size: 14px;
  color: #666;
}

.spinner {
  display: inline-block;
  width: 18px;
  height: 18px;
  border: 2px solid #2a2a35;
  border-top-color: #6366f1;
  border-radius: 50%;
  animation: spin .7s linear infinite;
  vertical-align: middle;
  margin-right: 8px;
}

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

.results { display: flex; flex-direction: column; gap: 1.5rem; }

.group {
  background: #16161f;
  border: 1px solid #2a2a35;
  border-radius: 14px;
  overflow: hidden;
}

.group-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 18px;
  border-bottom: 1px solid #2a2a35;
  cursor: pointer;
  user-select: none;
  transition: background .12s;
}

.group-header:hover { background: #1e1e2a; }

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

.group-name {
  font-size: 14px;
  font-weight: 600;
  color: #e2e2e8;
}

.group-count {
  font-size: 11px;
  padding: 2px 8px;
  border-radius: 100px;
  background: #1e1b4b;
  color: #818cf8;
  font-weight: 600;
}

.group-chevron {
  font-size: 16px;
  color: #444;
  transition: transform .2s;
}

.group.collapsed .group-chevron { transform: rotate(-90deg); }
.group.collapsed .group-body { display: none; }

.group-query {
  font-family: 'Courier New', monospace;
  font-size: 11px;
  color: #444;
  padding: 6px 18px;
  border-bottom: 1px solid #1e1e2a;
  background: #0f0f16;
}

.result-list { list-style: none; }

.result-item {
  padding: 14px 18px;
  border-bottom: 1px solid #1e1e2a;
  transition: background .12s;
}

.result-item:last-child { border-bottom: none; }
.result-item:hover { background: #1e1e2a; }

.result-title {
  font-size: 14px;
  font-weight: 500;
  color: #818cf8;
  text-decoration: none;
  display: block;
  margin-bottom: 3px;
  line-height: 1.4;
}

.result-title:hover { color: #a5b4fc; text-decoration: underline; }

.result-url {
  font-size: 11px;
  color: #3d6b3d;
  margin-bottom: 5px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.result-desc {
  font-size: 12px;
  color: #555;
  line-height: 1.5;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.no-results {
  text-align: center;
  padding: 3rem 1rem;
  color: #444;
  font-size: 14px;
}

.summary-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 0;
  margin-bottom: 1rem;
  border-bottom: 1px solid #1e1e2a;
}

.summary-text {
  font-size: 13px;
  color: #666;
}

.summary-text strong { color: #a5b4fc; }

.btn-collapse-all {
  font-size: 12px;
  color: #555;
  background: none;
  border: none;
  cursor: pointer;
  font-family: inherit;
  padding: 0;
}

.btn-collapse-all:hover { color: #888; }

@media (max-width: 500px) {
  h1 { font-size: 22px; }
  .search-box { flex-direction: column; }
  .search-box button { width: 100%; justify-content: center; }
}
