* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background: #ffffff;
  color: #1f2328;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  line-height: 1.5;
}

.page {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

body:not(.has-query) .search-header {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 2rem 1.25rem 6rem;
  gap: 1.5rem;
}

body:not(.has-query) .brand {
  font-size: 2.5rem;
  font-weight: 700;
}

body:not(.has-query) .search-form {
  width: 100%;
  max-width: 600px;
}

body.has-query .search-header {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 1rem 1.5rem;
  padding: 1rem 1.5rem;
  border-bottom: 1px solid #e5e7eb;
  background: #ffffff;
  position: sticky;
  top: 0;
}

body.has-query .brand {
  font-size: 1.25rem;
  font-weight: 700;
}

body.has-query .search-form {
  flex: 1;
  min-width: 260px;
  max-width: 640px;
}

.brand {
  color: #1f2328;
  text-decoration: none;
}

.search-row {
  display: flex;
  gap: 0.5rem;
}

.search-input {
  flex: 1;
  min-width: 0;
  font: inherit;
  font-size: 1rem;
  padding: 0.65rem 1rem;
  border: 1px solid #d0d7de;
  border-radius: 999px;
  background: #f6f8fa;
  color: #1f2328;
}

.search-input:focus {
  outline: 2px solid #2563eb;
  outline-offset: 1px;
  background: #ffffff;
}

.search-btn {
  font: inherit;
  font-size: 1rem;
  font-weight: 600;
  padding: 0.65rem 1.3rem;
  border: none;
  border-radius: 999px;
  background: #2563eb;
  color: #ffffff;
  cursor: pointer;
}

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

.search-btn:disabled {
  opacity: 0.6;
  cursor: wait;
}

.form-error {
  margin: 0.45rem 0 0 1rem;
  font-size: 0.9rem;
  color: #c62828;
}

.results-area {
  width: 100%;
  max-width: 760px;
  padding: 1.25rem 1.5rem 3rem;
}

@media (min-width: 900px) {
  body.has-query .results-area {
    margin-left: 10rem;
  }
}

.status-bar {
  font-size: 0.9rem;
  color: #57606a;
  margin-bottom: 1.25rem;
}

.status-bar.is-error {
  color: #c62828;
}

.results-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 1.4rem;
}

.result-item {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}

.result-host {
  font-size: 0.85rem;
  color: #57606a;
}

.result-link {
  font-size: 1.15rem;
  font-weight: 500;
  color: #1a56db;
  text-decoration: none;
  word-break: break-word;
}

.result-link:hover {
  text-decoration: underline;
}

.result-link:visited {
  color: #6b21a8;
}

.result-url {
  font-size: 0.82rem;
  color: #57606a;
  word-break: break-all;
}

.result-snippet {
  margin: 0.3rem 0 0;
  font-size: 0.95rem;
}

.pagination:not([hidden]) {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-top: 2rem;
  padding-top: 1.25rem;
  border-top: 1px solid #e5e7eb;
}

.page-btn {
  font: inherit;
  font-size: 0.95rem;
  padding: 0.5rem 1.1rem;
  border: 1px solid #d0d7de;
  border-radius: 8px;
  background: #f6f8fa;
  color: #1f2328;
  cursor: pointer;
}

.page-btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.page-indicator {
  font-size: 0.9rem;
  color: #57606a;
}
