body {
  margin: 0;
  font-family: Arial, sans-serif;
  background: #f3f4f6;
  color: #111827;
}

.container {
  max-width: 1100px;
  margin: 0 auto;
  padding: 24px;
}

header {
  margin-bottom: 24px;
}

.app-header {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: flex-start;
}

.user-panel {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.signed-in-user {
  font-size: 13px;
  color: #4b5563;
}

#logoutButton {
  font-size: 13px;
  padding: 7px 10px;
}

h1 {
  margin-bottom: 6px;
}

.search-panel {
  background: white;
  border: 1px solid #d1d5db;
  border-radius: 10px;
  padding: 18px;
  margin-bottom: 16px;
}

label {
  font-weight: 600;
}

.search-row {
  display: flex;
  gap: 10px;
  align-items: center;
  margin-top: 8px;
  margin-bottom: 14px;
}

input[type="search"] {
  flex: 1;
  width: 100%;
  font-size: 18px;
  padding: 12px;
  border: 1px solid #9ca3af;
  border-radius: 8px;
}

button {
  font-size: 16px;
  padding: 12px 16px;
  border: 1px solid #9ca3af;
  border-radius: 8px;
  background: #ffffff;
  color: #111827;
  cursor: pointer;
}

button:hover {
  background: #f3f4f6;
}

button:active {
  background: #e5e7eb;
}

.options,
.dataset-list {
  margin-top: 10px;
}

.dataset-item {
  display: block;
  margin-top: 8px;
  font-weight: normal;
}

.status {
  margin: 12px 0;
  color: #4b5563;
}

.result-card {
  background: white;
  border: 1px solid #d1d5db;
  border-radius: 10px;
  padding: 16px;
  margin-bottom: 12px;
}

.result-title-row {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 6px;
}

.result-title {
  font-size: 18px;
  font-weight: 700;
  margin-bottom: 6px;
}

.copy-title-button {
  flex: 0 0 auto;
  font-size: 13px;
  padding: 6px 10px;
  white-space: nowrap;
}

.result-meta {
  color: #374151;
  margin-bottom: 8px;
}

.result-source,
.result-raw {
  font-size: 14px;
  color: #4b5563;
}

.badge {
  display: inline-block;
  background: #e5e7eb;
  border-radius: 999px;
  padding: 2px 8px;
  margin-right: 6px;
  font-size: 13px;
}

.result-card.top-result {
  border: 2px solid #111827;
}

.top-label {
  display: inline-block;
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  background: #111827;
  color: white;
  border-radius: 999px;
  padding: 3px 8px;
  margin-bottom: 8px;
}

.score {
  font-size: 12px;
  color: #6b7280;
  margin-top: 8px;
}

@media (max-width: 640px) {
  .app-header {
    flex-direction: column;
  }

  .user-panel {
    justify-content: flex-start;
  }

  .search-row {
    flex-direction: column;
    align-items: stretch;
  }

  button {
    width: 100%;
  }

  .result-title-row {
    flex-direction: column;
  }

  .copy-title-button {
    width: 100%;
  }
}

.hidden {
  display: none !important;
}

.auth-container {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  box-sizing: border-box;
}

.auth-card {
  width: 100%;
  max-width: 420px;
  background: white;
  border: 1px solid #d1d5db;
  border-radius: 12px;
  padding: 24px;
  box-sizing: border-box;
}

.auth-intro {
  color: #4b5563;
  margin-top: 0;
}

.login-form {
  display: grid;
  gap: 10px;
}

.login-form input {
  font-size: 17px;
  padding: 12px;
  border: 1px solid #9ca3af;
  border-radius: 8px;
}

.auth-message {
  min-height: 1.4em;
  color: #991b1b;
  font-weight: 600;
}
