:root {
  color: #172026;
  background: #f5f7f6;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, Segoe UI, sans-serif;
  letter-spacing: 0;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-width: 320px;
}

main {
  width: min(1120px, calc(100% - 32px));
  margin: 0 auto;
  padding: 24px 0 44px;
}

header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 18px;
}

h1 {
  margin: 0;
  font-size: 28px;
  line-height: 1.15;
  letter-spacing: 0;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.brand img {
  width: 52px;
  height: 52px;
  object-fit: contain;
}

.brand__text {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.brand__name {
  color: #172026;
  font-size: 32px;
  font-weight: 780;
  line-height: 1;
}

.brand__byline {
  color: #58666f;
  font-size: 12px;
  font-weight: 680;
  line-height: 1.1;
}

.status {
  color: #58666f;
  font-size: 13px;
  white-space: nowrap;
}

.search-form {
  display: grid;
  grid-template-columns: minmax(180px, 260px) minmax(0, 1fr) auto;
  gap: 10px;
  align-items: end;
  padding: 14px;
  background: #ffffff;
  border: 1px solid #d9e1dc;
  border-radius: 8px;
}

label {
  display: grid;
  gap: 6px;
  color: #526069;
  font-size: 13px;
  font-weight: 650;
}

select,
input,
button {
  width: 100%;
  min-height: 42px;
  border: 1px solid #bdcac5;
  border-radius: 6px;
  padding: 0 12px;
  background: #ffffff;
  color: #172026;
  font: inherit;
  letter-spacing: 0;
}

button {
  min-width: 116px;
  border-color: #087f8c;
  background: #087f8c;
  color: #ffffff;
  font-weight: 750;
  cursor: pointer;
}

button:disabled {
  cursor: wait;
  opacity: 0.72;
}

.summary {
  margin: 16px 0;
  padding: 16px 18px;
  min-height: 70px;
  background: #ffffff;
  border: 1px solid #d9e1dc;
  border-left: 4px solid #087f8c;
  border-radius: 8px;
}

.summary h2,
.results-heading {
  margin: 0 0 8px;
  font-size: 16px;
  line-height: 1.25;
  letter-spacing: 0;
}

.summary-heading {
  display: flex;
  align-items: center;
  gap: 7px;
}

.ai-indicator {
  display: inline-grid;
  place-items: center;
  width: 24px;
  height: 18px;
  border: 1px solid #087f8c;
  border-radius: 5px;
  background: #edfafa;
  color: #087f8c;
  font-size: 10px;
  font-weight: 800;
  line-height: 1;
}

.summary-body {
  color: #253138;
  line-height: 1.55;
}

.summary-body p {
  margin: 0 0 10px;
}

.summary-body ul {
  margin: 8px 0 0;
  padding-left: 20px;
}

.summary-citation {
  color: #087f8c;
  font-weight: 750;
  text-decoration: none;
}

.results {
  display: grid;
  gap: 10px;
}

.result {
  background: #ffffff;
  border: 1px solid #d9e1dc;
  border-radius: 8px;
  padding: 15px 16px;
}

.result:target {
  border-color: #087f8c;
  box-shadow: 0 0 0 3px rgba(8, 127, 140, 0.14);
}

.result-title {
  display: flex;
  align-items: baseline;
  gap: 8px;
  margin: 0 0 7px;
  font-size: 17px;
  line-height: 1.35;
  letter-spacing: 0;
}

.rank {
  flex: 0 0 auto;
  color: #087f8c;
  font-weight: 800;
}

.result-summary-row {
  display: flex;
  align-items: flex-start;
  gap: 8px;
}

.result-ai-indicator {
  flex: 0 0 auto;
  margin-top: 1px;
}

a {
  color: #174ea6;
  text-decoration-thickness: 1px;
  text-underline-offset: 2px;
}

.result-url,
.result-summary,
.empty,
.error {
  margin: 0;
  color: #526069;
  line-height: 1.5;
}

.result-url {
  margin-bottom: 8px;
  color: #2d6a4f;
  font-size: 13px;
  overflow-wrap: anywhere;
}

.error {
  color: #9f1239;
  font-weight: 700;
}

@media (max-width: 760px) {
  main {
    width: min(100% - 24px, 1120px);
    padding-top: 18px;
  }

  header {
    align-items: flex-start;
    flex-direction: column;
  }

  .search-form {
    grid-template-columns: 1fr;
  }

  button {
    min-width: 0;
  }
}
