:root {
  color-scheme: light;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: #172033;
  background: #f5f7fb;
  font-synthesis: none;
  text-rendering: optimizeLegibility;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-width: 320px;
  min-height: 100vh;
  background:
    radial-gradient(ellipse at 85% 4%, rgba(116, 140, 255, 0.12), transparent 34rem),
    #f5f7fb;
}

.page {
  width: min(100% - 40px, 1000px);
  margin: 0 auto;
  padding: 92px 0 80px;
}

.intro {
  max-width: 680px;
  margin: 0 auto 34px;
  text-align: center;
}

.eyebrow {
  margin: 0 0 12px;
  color: #5969d8;
  font-size: 0.73rem;
  font-weight: 750;
  letter-spacing: 0.12em;
}

h1,
h2,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 12px;
  font-size: clamp(2.35rem, 6vw, 3.8rem);
  letter-spacing: -0.055em;
  line-height: 1.05;
}

.subtitle {
  margin-bottom: 0;
  color: #647087;
  font-size: 1.05rem;
  line-height: 1.6;
}

.search-card {
  padding: 26px;
  border: 1px solid #e6e9f1;
  border-radius: 18px;
  background: #fff;
  box-shadow: 0 18px 50px rgba(37, 49, 79, 0.08);
}

.search-card h2 {
  margin-bottom: 16px;
  font-size: 1.05rem;
}

textarea {
  display: block;
  width: 100%;
  min-height: 112px;
  resize: vertical;
  padding: 16px;
  border: 1px solid #dfe4ed;
  border-radius: 11px;
  outline: none;
  color: #172033;
  font: inherit;
  line-height: 1.55;
  transition: border-color 150ms ease, box-shadow 150ms ease;
}

textarea:focus {
  border-color: #6978e6;
  box-shadow: 0 0 0 3px rgba(105, 120, 230, 0.13);
}

textarea::placeholder {
  color: #9aa3b3;
}

.form-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-top: 16px;
}

.form-footer > span {
  color: #7a8497;
  font-size: 0.82rem;
}

button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  min-height: 46px;
  padding: 0 18px;
  border: 0;
  border-radius: 9px;
  background: #5363d2;
  color: #fff;
  font: inherit;
  font-size: 0.9rem;
  font-weight: 650;
  cursor: pointer;
  transition: background 150ms ease, transform 150ms ease;
}

button:hover:not(:disabled) {
  transform: translateY(-1px);
  background: #4352bc;
}

button:disabled {
  cursor: wait;
  opacity: 0.7;
}

.privacy-note {
  margin: 18px 0 0;
  color: #8a93a3;
  font-size: 0.77rem;
  line-height: 1.55;
}

.message {
  margin-top: 18px;
  padding: 12px 15px;
  border: 1px solid #d9e8dd;
  border-radius: 9px;
  background: #f0f8f2;
  color: #326344;
  font-size: 0.9rem;
}

.message.error {
  border-color: #f0d7d4;
  background: #fff5f3;
  color: #9d4036;
}

.results-section {
  margin-top: 38px;
}

.results-heading {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 12px;
}

.results-heading .eyebrow {
  margin-bottom: 7px;
}

.results-heading h2 {
  margin: 0;
  font-size: 1.4rem;
  letter-spacing: -0.025em;
}

#sql-output {
  overflow: auto;
  margin: 0;
  padding: 18px;
  border: 1px solid #e6e9f1;
  border-radius: 12px;
  background: #fff;
  color: #44506a;
  font-size: 0.86rem;
  line-height: 1.6;
  white-space: pre-wrap;
}

@media (max-width: 640px) {
  .page {
    width: min(100% - 28px, 1000px);
    padding-top: 56px;
  }

  .search-card {
    padding: 20px;
  }

  .form-footer {
    align-items: stretch;
    flex-direction: column;
  }

  .results-heading {
    align-items: stretch;
    flex-direction: column;
  }

  .form-footer button {
    width: 100%;
  }
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  clip-path: inset(50%);
}

[hidden] {
  display: none !important;
}
