:root {
  --bg: #07131d;
  --bg-deep: #030a11;
  --glass: rgba(10, 24, 36, 0.58);
  --glass-strong: rgba(8, 18, 29, 0.78);
  --paper: rgba(15, 31, 45, 0.72);
  --paper-soft: rgba(18, 36, 52, 0.54);
  --line: rgba(173, 214, 255, 0.14);
  --line-strong: rgba(173, 214, 255, 0.26);
  --text: #edf6ff;
  --muted: #98aec4;
  --accent: #79d6ff;
  --accent-strong: #c5f2ff;
  --accent-soft: rgba(121, 214, 255, 0.14);
  --success: #7df7ce;
  --shadow: 0 24px 80px rgba(0, 0, 0, 0.34);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: 'Manrope', sans-serif;
  color: var(--text);
  background:
    radial-gradient(circle at 12% 18%, rgba(103, 169, 255, 0.24), transparent 24%),
    radial-gradient(circle at 84% 10%, rgba(69, 222, 198, 0.18), transparent 22%),
    radial-gradient(circle at 78% 76%, rgba(99, 132, 255, 0.16), transparent 26%),
    linear-gradient(180deg, #0b1825 0%, var(--bg) 42%, var(--bg-deep) 100%);
}

button,
input,
select {
  font: inherit;
}

.page-shell {
  width: min(1360px, calc(100% - 32px));
  margin: 0 auto;
  padding: 28px 0 48px;
}

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(300px, 0.9fr);
  gap: 24px;
  align-items: stretch;
}

.hero-copy,
.hero-panel,
.search-panel,
.results-panel,
.result-card {
  border: 1px solid var(--line);
  background: var(--glass);
  backdrop-filter: blur(22px) saturate(150%);
  -webkit-backdrop-filter: blur(22px) saturate(150%);
  box-shadow: var(--shadow);
}

.hero-copy {
  padding: 32px;
  border-radius: 28px;
  position: relative;
  overflow: hidden;
}

.hero-copy::after {
  content: '';
  position: absolute;
  inset: auto -40px -60px auto;
  width: 220px;
  height: 220px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(121, 214, 255, 0.24), transparent 68%);
}

.eyebrow {
  margin: 0 0 12px;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  color: var(--accent);
  font-weight: 800;
}

h1,
h2,
h3,
p {
  margin: 0;
}

h1 {
  max-width: 12ch;
  font-size: clamp(2.6rem, 5vw, 4.8rem);
  line-height: 1;
  letter-spacing: -0.05em;
}

.hero-text {
  max-width: 60ch;
  margin-top: 18px;
  color: var(--muted);
  line-height: 1.65;
}

.hero-panel {
  padding: 26px;
  border-radius: 24px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 14px;
}

.status-line {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
}

.status-dot {
  width: 11px;
  height: 11px;
  border-radius: 50%;
  background: var(--success);
  box-shadow: 0 0 0 8px rgba(125, 247, 206, 0.12);
}

.status-copy {
  color: var(--muted);
  line-height: 1.6;
  max-width: 34ch;
}

.main-grid {
  display: grid;
  grid-template-columns: 380px minmax(0, 1fr);
  gap: 24px;
  margin-top: 24px;
}

.search-panel,
.results-panel {
  border-radius: 28px;
  padding: 24px;
}

.search-form,
.field-group,
.field,
.results-panel {
  display: flex;
  flex-direction: column;
}

.search-form {
  gap: 18px;
}

.field span,
.field-title {
  margin-bottom: 10px;
  color: var(--muted);
  font-size: 14px;
  font-weight: 700;
}

input,
select,
button {
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 14px 16px;
  background: var(--paper);
  color: var(--text);
}

input:focus,
select:focus,
button:focus {
  outline: 2px solid rgba(121, 214, 255, 0.24);
  outline-offset: 2px;
}

.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.chip {
  position: relative;
}

.chip input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.chip span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 12px 14px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--paper);
  color: var(--text);
  font-weight: 700;
  cursor: pointer;
  transition: 160ms ease;
}

.chip input:checked + span {
  border-color: var(--accent);
  background: var(--accent-soft);
  color: var(--accent-strong);
  box-shadow: inset 0 0 0 1px rgba(121, 214, 255, 0.08);
}

.period-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.actions {
  display: flex;
  gap: 12px;
}

button {
  cursor: pointer;
  font-weight: 800;
  transition: transform 160ms ease, background-color 160ms ease, border-color 160ms ease;
}

button:hover {
  transform: translateY(-1px);
}

#searchButton {
  flex: 1;
  background: linear-gradient(135deg, rgba(76, 194, 255, 0.95), rgba(24, 110, 164, 0.95));
  color: #031019;
  border: none;
}

.ghost-button {
  background: rgba(255, 255, 255, 0.03);
}

.results-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.summary-card {
  min-width: 180px;
  padding: 14px 16px;
  border-radius: 18px;
  border: 1px solid var(--line);
  background: var(--paper-soft);
  font-weight: 700;
}

.summary-query {
  color: var(--accent-strong);
}

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

.summary-pill {
  padding: 7px 10px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.04);
  color: var(--muted);
  font-size: 12px;
}

.feedback {
  margin-top: 16px;
  padding: 14px 16px;
  border-radius: 16px;
  background: rgba(255, 143, 92, 0.12);
  border: 1px solid rgba(255, 143, 92, 0.16);
  color: #ffd7c7;
  font-weight: 700;
}

.hidden {
  display: none;
}

.results-list {
  display: flex;
  flex-direction: column;
  gap: 16px;
  margin-top: 22px;
}

.result-card {
  position: relative;
  padding: 20px;
  border-radius: 24px;
  animation: rise 240ms ease;
  overflow: hidden;
}

.result-card::before {
  content: '';
  position: absolute;
  inset: 0 0 auto 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(197, 242, 255, 0.55), transparent);
}

.result-card::after {
  content: '';
  position: absolute;
  inset: -40% auto auto 65%;
  width: 180px;
  height: 180px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(121, 214, 255, 0.14), transparent 70%);
  pointer-events: none;
}

.result-card:hover {
  transform: translateY(-2px);
  border-color: var(--line-strong);
}

.result-top {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: flex-start;
}

.result-main {
  min-width: 0;
}

.task-kicker,
.task-submeta,
.match-label,
.match-item-meta {
  color: var(--muted);
}

.task-kicker,
.task-submeta,
.match-item-meta {
  font-size: 14px;
}

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

.task-id,
.task-state,
.task-hitcount,
.meta-pill {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  padding: 6px 10px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.04);
}

.task-id {
  color: var(--accent-strong);
  font-family: 'IBM Plex Mono', monospace;
  font-size: 12px;
}

.task-state {
  background: rgba(121, 214, 255, 0.09);
}

.task-hitcount {
  color: #9cf7d7;
}

.task-title {
  margin-top: 12px;
  font-size: 1.2rem;
  line-height: 1.3;
  max-width: 90%;
}

.task-link {
  white-space: nowrap;
  text-decoration: none;
  font-weight: 800;
  color: var(--accent-strong);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  padding: 0 14px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.04);
}

.task-submeta {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 14px;
}

.match-groups {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: 16px;
}

.match-group {
  padding: 14px 15px;
  border-radius: 18px;
  border: 1px solid var(--line);
  background: var(--paper-soft);
}

.match-label {
  margin-bottom: 10px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 11px;
}

.match-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 28px;
  min-height: 28px;
  padding: 0 8px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.04);
  color: var(--accent-strong);
}

.match-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.match-item {
  padding-top: 10px;
  border-top: 1px solid var(--line);
}

.match-item:first-child {
  padding-top: 0;
  border-top: none;
}

.match-item p {
  line-height: 1.55;
}

mark {
  padding: 0 4px;
  border-radius: 6px;
  background: rgba(121, 214, 255, 0.3);
  color: #f8fdff;
}

.mono {
  font-family: 'IBM Plex Mono', monospace;
}

@keyframes rise {
  from {
    opacity: 0;
    transform: translateY(8px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (max-width: 1080px) {
  .hero,
  .main-grid {
    grid-template-columns: 1fr;
  }

  .period-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 720px) {
  .page-shell {
    width: min(100% - 20px, 1360px);
    padding-top: 16px;
  }

  .hero-copy,
  .hero-panel,
  .search-panel,
  .results-panel,
  .result-card {
    padding: 18px;
    border-radius: 22px;
  }

  .result-top,
  .results-head,
  .actions {
    flex-direction: column;
  }

  .summary-card,
  .task-link,
  #searchButton,
  .ghost-button {
    width: 100%;
  }
}
