:root {
  --bg: #0f1115;
  --panel: #181b22;
  --border: #2a2f3a;
  --text: #e8eaed;
  --muted: #9aa1ad;
  --accent: #5b8def;
  --accent-text: #0b1020;
  --error: #e0626b;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.5;
}

main {
  max-width: 640px;
  margin: 0 auto;
  padding: 2rem 1.25rem 4rem;
}

h1 {
  font-size: 1.75rem;
  margin-bottom: 0.25rem;
}

.intro {
  color: var(--muted);
  margin-top: 0;
  margin-bottom: 0.5rem;
}

.search-tip {
  color: var(--muted);
  font-size: 0.85rem;
  margin-top: 0;
  margin-bottom: 2rem;
}

.slot {
  position: relative;
  margin-bottom: 0.75rem;
}

.slot input[type="text"] {
  width: 100%;
  padding: 0.65rem 0.85rem;
  font-size: 1rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--panel);
  color: var(--text);
}

.slot input[type="text"]:focus {
  outline: none;
  border-color: var(--accent);
}

.search-results {
  position: absolute;
  z-index: 10;
  top: calc(100% + 4px);
  left: 0;
  right: 0;
  margin: 0;
  padding: 0;
  list-style: none;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 8px;
  max-height: 280px;
  overflow-y: auto;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
}

.search-results li {
  padding: 0.6rem 0.85rem;
  cursor: pointer;
  border-bottom: 1px solid var(--border);
}

.search-results li:last-child {
  border-bottom: none;
}

.search-results li:hover,
.search-results li:focus {
  background: var(--accent);
  color: var(--accent-text);
  outline: none;
}

.search-results li.no-results,
.search-results li.error {
  cursor: default;
  color: var(--muted);
}

.search-results li.error {
  color: var(--error);
}

.search-results li.no-results:hover,
.search-results li.error:hover {
  background: none;
  color: var(--muted);
}

.chip[hidden] {
  display: none;
}

.chip {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.65rem 0.85rem;
  border: 1px solid var(--accent);
  border-radius: 8px;
  background: rgba(91, 141, 239, 0.12);
}

.chip span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.remove-chip {
  flex: none;
  border: none;
  background: none;
  color: var(--muted);
  font-size: 1.25rem;
  line-height: 1;
  cursor: pointer;
  padding: 0 0.25rem;
}

.remove-chip:hover {
  color: var(--error);
}

#submit-btn {
  display: block;
  width: 100%;
  margin-top: 1.25rem;
  padding: 0.75rem;
  font-size: 1rem;
  font-weight: 600;
  border: none;
  border-radius: 8px;
  background: var(--accent);
  color: var(--accent-text);
  cursor: pointer;
}

#submit-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

#results {
  margin-top: 2.5rem;
}

#results h2 {
  font-size: 1.25rem;
  margin-bottom: 0.25rem;
}

.results-note {
  color: var(--muted);
  font-size: 0.9rem;
  margin-top: 0;
}

#results-list {
  list-style: decimal;
  padding-left: 1.5rem;
  margin: 1rem 0 0;
}

#results-list li {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.4rem 0;
  border-bottom: 1px solid var(--border);
}

#results-list li.error,
#results-list li.empty {
  display: block;
  list-style: none;
  margin-left: -1.5rem;
  color: var(--muted);
}

#results-list li.error {
  color: var(--error);
}

.rec-score {
  flex: none;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}

@media (max-width: 480px) {
  main {
    padding: 1.5rem 1rem 3rem;
  }
}
