:root {
  --font-base: "Segoe UI", "Aptos", "Helvetica Neue", Arial, sans-serif;
  --bg: #f3f6fb;
  --surface: #ffffff;
  --surface-2: #f7f9fe;
  --text: #1a2333;
  --muted: #5b667a;
  --line: #d9e1f0;
  --accent: #2f5bff;
  --positive: #16885f;
  --negative: #bc3e54;
  --needs: #2368a2;
  --shadow: 0 14px 36px rgba(21, 35, 69, 0.08);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: var(--font-base);
  color: var(--text);
  background:
    radial-gradient(circle at 8% 0%, #ffffff 0%, transparent 42%),
    radial-gradient(circle at 100% 30%, #eaf0ff 0%, transparent 48%),
    var(--bg);
}

.app-shell {
  width: min(940px, 100% - 2rem);
  margin: 1.5rem auto 2.75rem;
}

.page-header {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 1.25rem 1.3rem;
  box-shadow: var(--shadow);
}

.eyebrow {
  margin: 0;
  font-size: 0.74rem;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--muted);
  font-weight: 600;
}

h1 {
  margin: 0.35rem 0 0.35rem;
  font-size: clamp(1.8rem, 3vw, 2.2rem);
  letter-spacing: -0.01em;
}

.intro {
  margin: 0;
  color: var(--muted);
  line-height: 1.45;
}

.controls {
  margin-top: 0.95rem;
  display: grid;
  grid-template-columns: minmax(200px, 0.42fr) 1fr;
  gap: 0.7rem;
}

.control-block {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 0.85rem;
}

.control-block h2 {
  margin: 0 0 0.5rem;
  font-size: 0.77rem;
  letter-spacing: 0.08em;
  color: var(--muted);
  text-transform: uppercase;
}

.search-wrap {
  display: flex;
  flex-direction: column;
  justify-content: center;
}

label {
  font-size: 0.86rem;
  margin-bottom: 0.35rem;
  color: var(--muted);
}

input[type="search"] {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 0.62rem 0.75rem;
  font-size: 1rem;
  color: var(--text);
  background: #fff;
}

input[type="search"]:focus {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.segmented {
  display: flex;
  gap: 0.45rem;
  flex-wrap: wrap;
}

.segmented button {
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface-2);
  color: var(--text);
  padding: 0.38rem 0.75rem;
  font-size: 0.9rem;
  cursor: pointer;
}

.segmented button.is-active {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

.results {
  margin-top: 0.75rem;
  display: grid;
  gap: 0.6rem;
}

.group-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-left-width: 4px;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 5px 14px rgba(21, 35, 69, 0.05);
}

.group-card.kind-feeling-positive {
  border-left-color: var(--positive);
}

.group-card.kind-feeling-negative {
  border-left-color: var(--negative);
}

.group-card.kind-needs {
  border-left-color: var(--needs);
}

.group-header {
  width: 100%;
  padding: 0.78rem 0.9rem;
  display: flex;
  align-items: center;
  border: 0;
  background: transparent;
  color: var(--text);
  text-align: left;
  cursor: pointer;
  font-size: 1rem;
}

.group-label {
  font-weight: 600;
}

.child-list {
  display: none;
  gap: 0.42rem;
  padding: 0.05rem 0.9rem 0.85rem;
  flex-wrap: wrap;
}

.group-card.is-open .child-list {
  display: flex;
}

.child-chip {
  border: 1px solid var(--line);
  background: var(--surface-2);
  border-radius: 999px;
  padding: 0.28rem 0.62rem;
  font-size: 0.88rem;
}

.page-footer {
  margin-top: 1rem;
  color: var(--muted);
  font-size: 0.88rem;
  text-align: center;
}

.no-results {
  background: var(--surface);
  border: 1px dashed var(--line);
  border-radius: 12px;
  padding: 1rem;
  text-align: center;
  color: var(--muted);
}

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