*,
*::before,
*::after {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  background: #f4f6f8;
  color: #1a1a2e;
  line-height: 1.6;
}

.container {
  max-width: 760px;
  margin: 0 auto;
  padding: 2rem 1.5rem;
}

header h1 {
  margin: 0 0 0.35rem;
  font-size: 1.85rem;
  color: #16213e;
}

.subtitle {
  margin: 0 0 1rem;
  color: #444;
  font-size: 0.95rem;
}

.notice {
  background: #fff3cd;
  border: 1px solid #ffc107;
  border-radius: 6px;
  padding: 0.75rem 1rem;
  font-size: 0.9rem;
  color: #664d03;
  margin: 0 0 1.5rem;
}

label {
  display: block;
  font-weight: 600;
  margin-bottom: 0.5rem;
}

textarea {
  width: 100%;
  padding: 0.75rem;
  border: 1px solid #ccc;
  border-radius: 6px;
  font-family: inherit;
  font-size: 1rem;
  resize: vertical;
}

.sample-buttons {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
  margin-top: 0.75rem;
}

.sample-label {
  font-size: 0.85rem;
  color: #555;
  font-weight: 600;
}

.sample-btn {
  padding: 0.4rem 0.85rem;
  background: #e8eef5;
  color: #0f3460;
  border: 1px solid #b8c9dc;
  border-radius: 6px;
  font-size: 0.85rem;
  cursor: pointer;
}

.sample-btn:hover {
  background: #d5e0ed;
}

.primary-btn {
  margin-top: 1rem;
  padding: 0.65rem 1.75rem;
  background: #0f3460;
  color: #fff;
  border: none;
  border-radius: 6px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s ease;
}

.primary-btn:hover {
  background: #16213e;
}

.primary-btn:active {
  transform: translateY(1px);
}

.primary-btn:disabled {
  opacity: 0.65;
  cursor: wait;
}

.loading {
  text-align: center;
  padding: 1rem;
  color: #555;
  font-style: italic;
}

.error {
  background: #f8d7da;
  border: 1px solid #f5c2c7;
  border-radius: 6px;
  padding: 0.75rem 1rem;
  color: #842029;
  margin-top: 1rem;
}

.results {
  margin-top: 1.5rem;
}

.result-card {
  background: #fff;
  border: 1px solid #e0e0e0;
  border-radius: 8px;
  padding: 1rem 1.25rem;
  margin-bottom: 1rem;
}

.result-card h2 {
  margin: 0 0 0.75rem;
  font-size: 1.1rem;
  color: #0f3460;
}

.result-card h3 {
  margin: 1rem 0 0.5rem;
  font-size: 0.9rem;
  color: #555;
}

.result-card h3:first-of-type {
  margin-top: 0.5rem;
}

.risk-badge {
  display: inline-block;
  padding: 0.3rem 0.85rem;
  border-radius: 999px;
  font-weight: 700;
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  margin-bottom: 0.75rem;
}

.risk-badge.low {
  background: #d1e7dd;
  color: #0f5132;
}

.risk-badge.moderate {
  background: #fff3cd;
  color: #664d03;
}

.risk-badge.high {
  background: #f8d7da;
  color: #842029;
}

.warning-banner {
  background: #fff3cd;
  border: 1px solid #ffc107;
  border-radius: 6px;
  padding: 0.6rem 0.85rem;
  font-size: 0.9rem;
  color: #664d03;
  margin: 0 0 0.75rem;
}

.provider-status {
  background: #eef3f8;
  border: 1px solid #cfd9e6;
  border-radius: 8px;
  padding: 0.75rem 1rem;
  margin-bottom: 1rem;
  font-size: 0.85rem;
  color: #334;
}

.provider-status div + div {
  margin-top: 0.25rem;
}

.evidence-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.evidence-list li {
  padding: 0.45rem 0;
  border-bottom: 1px solid #eef1f4;
  font-size: 0.92rem;
}

.evidence-list li:last-child {
  border-bottom: none;
}

.evidence-field {
  font-weight: 600;
  color: #0f3460;
}

.evidence-status {
  color: #666;
  font-size: 0.85rem;
}

.flag-list {
  margin: 0.25rem 0 0.75rem;
  padding-left: 1.25rem;
}

.flag-list li {
  margin: 0.2rem 0;
}

.summary-text {
  margin: 0 0 0.5rem;
  font-size: 0.95rem;
}

.summary-text.muted {
  color: #555;
  font-size: 0.9rem;
}

.check-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.check-list li {
  padding: 0.35rem 0;
  font-size: 0.95rem;
}

.check-list .pass {
  color: #0f5132;
}

.check-list .fail {
  color: #842029;
}

.result-card pre {
  margin: 0;
  white-space: pre-wrap;
  word-break: break-word;
  font-size: 0.85rem;
  background: #f8f9fa;
  padding: 0.75rem;
  border-radius: 4px;
}

#explanation {
  margin: 0;
  font-size: 0.95rem;
}

.technical-details summary {
  cursor: pointer;
  font-weight: 600;
  color: #0f3460;
  margin-bottom: 0.5rem;
}

.hidden {
  display: none;
}

footer {
  margin-top: 2rem;
  text-align: center;
  font-size: 0.85rem;
  color: #666;
}
