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

body {
  margin: 0;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: #020617;
  color: #e5e7eb;
}

.app {
  min-height: 100vh;
  max-width: 600px;
  margin: 0 auto;
  padding: 1rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.app-header {
  text-align: center;
  padding: 0.5rem 0 0.25rem;
}

.app-header h1 {
  font-size: 1.5rem;
  margin: 0 0 0.25rem;
}

.app-header p {
  margin: 0;
  font-size: 0.9rem;
  color: #9ca3af;
}

.app-main {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.card {
  background: rgba(15, 23, 42, 0.95);
  border-radius: 0.9rem;
  padding: 0.9rem 1rem;
  box-shadow: 0 14px 35px rgba(0, 0, 0, 0.45);
  border: 1px solid rgba(148, 163, 184, 0.15);
}

.card h2 {
  margin: 0 0 0.5rem;
  font-size: 1rem;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  font-size: 0.85rem;
}

.field span {
  color: #9ca3af;
}

.field input {
  border-radius: 999px;
  padding: 0.6rem 0.9rem;
  border: 1px solid #334155;
  background: #020617;
  color: #f9fafb;
  font-size: 1rem;
  outline: none;
}

.field input:focus {
  border-color: #38bdf8;
  box-shadow: 0 0 0 1px rgba(56, 189, 248, 0.6);
}

.results-card {
  max-height: 50vh;
  display: flex;
  flex-direction: column;
}

.results-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.4rem;
}

.results-header h2 {
  margin: 0;
}

#clearBtn {
  border-radius: 999px;
  border: none;
  padding: 0.3rem 0.75rem;
  background: #1e293b;
  color: #e5e7eb;
  font-size: 0.8rem;
}

#clearBtn:active {
  transform: scale(0.97);
}

.results-list {
  list-style: none;
  padding: 0;
  margin: 0;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

.result-item {
  padding: 0.5rem 0.25rem;
  border-bottom: 1px solid rgba(51, 65, 85, 0.7);
}

.result-main {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.5rem;
}

.result-name {
  font-size: 0.95rem;
}

.result-code {
  font-family: "SF Mono", ui-monospace, Menlo, Monaco, Consolas, "Liberation Mono",
    "Courier New", monospace;
  font-size: 0.9rem;
  background: #0f172a;
  padding: 0.15rem 0.4rem;
  border-radius: 999px;
}

.result-meta {
  margin-top: 0.18rem;
  font-size: 0.75rem;
  color: #9ca3af;
}

.empty-message {
  text-align: center;
  padding: 0.7rem 0.4rem;
  font-size: 0.9rem;
  color: #9ca3af;
}

.app-footer {
  text-align: center;
  font-size: 0.8rem;
  color: #6b7280;
  padding-bottom: 0.25rem;
}

/* Slightly nicer layout on bigger screens */
@media (min-width: 640px) {
  .app-main {
    flex-direction: row;
    flex-wrap: wrap;
  }

  .card {
    flex: 1 1 48%;
  }

  .results-card {
    flex-basis: 100%;
  }
}
