*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

:root {
  --primary: #2563eb;
  --primary-dark: #1d4ed8;
  --accent: #f59e0b;
  --bg: #f8fafc;
  --surface: #ffffff;
  --text: #1e293b;
  --text-muted: #64748b;
  --border: #e2e8f0;
  --error: #ef4444;
  --radius: 12px;
  --shadow: 0 1px 3px rgba(0,0,0,0.08), 0 4px 12px rgba(0,0,0,0.04);
  --shadow-lg: 0 4px 16px rgba(0,0,0,0.1), 0 8px 32px rgba(0,0,0,0.06);
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  min-height: 100vh;
}

.container {
  max-width: 800px;
  margin: 0 auto;
  padding: 2rem 1.5rem;
}

/* Header */
header {
  text-align: center;
  margin-bottom: 2.5rem;
}

header h1 {
  font-size: 2.75rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--text);
}

header h1 .accent {
  color: var(--primary);
}

.tagline {
  color: var(--text-muted);
  font-size: 1.125rem;
  margin-top: 0.25rem;
}

/* Form */
.search-form {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 2rem;
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.form-group label {
  font-weight: 600;
  font-size: 0.875rem;
  color: var(--text);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.form-group select,
.form-group input {
  padding: 0.75rem 1rem;
  border: 1.5px solid var(--border);
  border-radius: 8px;
  font-size: 1rem;
  color: var(--text);
  background: var(--surface);
  transition: border-color 0.2s, box-shadow 0.2s;
}

.form-group select:focus,
.form-group input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
}

button[type="submit"] {
  padding: 0.85rem 1.5rem;
  background: var(--primary);
  color: #fff;
  border: none;
  border-radius: 8px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s, transform 0.1s;
}

button[type="submit"]:hover {
  background: var(--primary-dark);
}

button[type="submit"]:active {
  transform: scale(0.98);
}

button[type="submit"]:disabled {
  opacity: 0.7;
  cursor: not-allowed;
}

/* Spinner */
.spinner {
  display: inline-block;
  width: 16px;
  height: 16px;
  border: 2px solid rgba(255,255,255,0.3);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
  vertical-align: middle;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* Error */
.error {
  background: #fef2f2;
  border: 1px solid #fecaca;
  color: var(--error);
  padding: 0.75rem 1rem;
  border-radius: 8px;
  margin-top: 1rem;
  font-size: 0.925rem;
}

/* Results */
.results {
  margin-top: 2rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 2rem;
  box-shadow: var(--shadow-lg);
  animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

.result-content {
  line-height: 1.75;
}

.result-content h1,
.result-content h2 {
  color: var(--text);
  margin-top: 1.5rem;
  margin-bottom: 0.5rem;
  font-weight: 700;
}

.result-content h1 { font-size: 1.5rem; }
.result-content h2 { font-size: 1.25rem; border-bottom: 2px solid var(--border); padding-bottom: 0.3rem; }
.result-content h3 { font-size: 1.1rem; margin-top: 1.25rem; margin-bottom: 0.25rem; color: var(--primary-dark); }
.result-content h4 { font-size: 1rem; margin-top: 1rem; margin-bottom: 0.25rem; }

.result-content p {
  margin-bottom: 0.75rem;
}

.result-content ul, .result-content ol {
  margin-left: 1.5rem;
  margin-bottom: 0.75rem;
}

.result-content li {
  margin-bottom: 0.3rem;
}

.result-content strong {
  color: var(--text);
}

.result-content hr {
  border: none;
  border-top: 1px solid var(--border);
  margin: 1.5rem 0;
}

/* Footer */
footer {
  text-align: center;
  margin-top: 3rem;
  color: var(--text-muted);
  font-size: 0.825rem;
}

/* Utility */
header {
  position: relative;
  text-align: center;
}

.version-label {
  position: absolute;
  top: 0;
  right: 0;
  font-size: 0.75rem;
  color: var(--text-secondary, #999);
  font-weight: 300;
}

.optional {
  font-weight: 400;
  font-size: 0.85em;
  color: var(--text-secondary, #666);
}

.hidden {
  display: none !important;
}

/* Responsive */
@media (max-width: 600px) {
  .container {
    padding: 1rem;
  }
  header h1 {
    font-size: 2rem;
  }
  .search-form {
    padding: 1.25rem;
  }
  .results {
    padding: 1.25rem;
  }
}
