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

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: #f5f5f5;
  padding: 24px;
  min-height: 100vh;
}

.container {
  max-width: 720px;
  margin: 0 auto;
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 2px 12px rgba(0,0,0,0.08);
  padding: 32px;
}

header {
  margin-bottom: 28px;
}

header h1 {
  font-size: 1.75rem;
  color: #1a1a1a;
  margin-bottom: 4px;
}

.subtitle {
  color: #666;
  font-size: 0.9rem;
}

.inputs {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.field label {
  display: block;
  font-weight: 500;
  color: #333;
  margin-bottom: 6px;
  font-size: 0.9rem;
}

.field input,
.field textarea {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid #ddd;
  border-radius: 8px;
  font-size: 1rem;
  font-family: inherit;
}

.field input:focus,
.field textarea:focus {
  outline: none;
  border-color: #2563eb;
  box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.15);
}

.field textarea {
  resize: vertical;
  min-height: 120px;
}

.btn {
  align-self: flex-start;
  padding: 10px 20px;
  background: #2563eb;
  color: #fff;
  border: none;
  border-radius: 8px;
  font-size: 1rem;
  font-weight: 500;
  cursor: pointer;
}

.btn:hover {
  background: #1d4ed8;
}

.btn:disabled {
  background: #94a3b8;
  cursor: not-allowed;
}

.results {
  margin-top: 28px;
  padding-top: 28px;
  border-top: 1px solid #eee;
}

.results.hidden {
  display: none;
}

.results h2 {
  font-size: 1.2rem;
  margin-bottom: 8px;
  color: #1a1a1a;
}

.query-display {
  margin-bottom: 16px;
  color: #555;
  font-size: 0.95rem;
}

.rank-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.rank-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  background: #f8fafc;
  border-radius: 8px;
  border: 1px solid #e2e8f0;
}

.rank-item .rank {
  flex-shrink: 0;
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #2563eb;
  color: #fff;
  border-radius: 6px;
  font-weight: 600;
  font-size: 0.85rem;
}

.rank-item .value {
  flex: 1;
  word-break: break-word;
}

.rank-item .scores {
  flex-shrink: 0;
  font-size: 0.8rem;
  color: #64748b;
}

.rank-item .scores span {
  margin-left: 8px;
}

.error {
  margin-top: 16px;
  padding: 12px;
  background: #fef2f2;
  border: 1px solid #fecaca;
  border-radius: 8px;
  color: #b91c1c;
  font-size: 0.9rem;
}

.error.hidden {
  display: none;
}
