:root {
  color-scheme: light;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: #f4f7f0;
  color: #15221a;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
}

button,
input {
  font: inherit;
}

.shell {
  width: min(1120px, calc(100vw - 32px));
  margin: 0 auto;
  padding: 40px 0 56px;
}

.hero {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 28px;
}

.eyebrow {
  margin: 0 0 8px;
  color: #4f735d;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0;
  text-transform: uppercase;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 12px;
  font-size: clamp(2rem, 5vw, 4.6rem);
  line-height: 1;
  letter-spacing: 0;
}

h2 {
  margin-bottom: 8px;
  font-size: 1.75rem;
}

h3 {
  margin-bottom: 14px;
  font-size: 1rem;
}

.intro {
  max-width: 620px;
  margin-bottom: 0;
  color: #506256;
  line-height: 1.7;
}

.health,
.image-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  padding: 0 14px;
  border: 1px solid #c6d3c1;
  border-radius: 6px;
  color: #2d5f3b;
  text-decoration: none;
  white-space: nowrap;
  background: rgba(255, 255, 255, 0.66);
}

.workspace {
  display: grid;
  grid-template-columns: minmax(280px, 420px) minmax(0, 1fr);
  gap: 18px;
  align-items: stretch;
}

.uploader,
.preview-panel,
.result article,
.result {
  border: 1px solid #dce5d6;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.78);
  box-shadow: 0 18px 50px rgba(44, 69, 50, 0.08);
}

.uploader {
  padding: 18px;
}

.token-field {
  display: grid;
  gap: 8px;
  margin-bottom: 14px;
}

.token-field span {
  color: #506256;
  font-size: 0.86rem;
  font-weight: 700;
}

.token-field input {
  width: 100%;
  min-height: 42px;
  border: 1px solid #c6d3c1;
  border-radius: 6px;
  padding: 0 12px;
  color: #15221a;
  background: #fbfcf8;
}

.drop-zone {
  display: flex;
  min-height: 240px;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 10px;
  border: 1px dashed #a9bfa6;
  border-radius: 8px;
  background: #fbfcf8;
  cursor: pointer;
  text-align: center;
  padding: 20px;
}

.drop-zone input {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
}

.drop-title {
  font-size: 1.25rem;
  font-weight: 700;
}

.drop-copy,
.status,
.latin {
  color: #5d6b60;
  line-height: 1.6;
}

.actions {
  display: flex;
  gap: 10px;
  margin-top: 16px;
}

button {
  min-height: 44px;
  border: 0;
  border-radius: 6px;
  padding: 0 18px;
  color: #fff;
  background: #2c6a41;
  cursor: pointer;
}

button:disabled {
  cursor: not-allowed;
  background: #9cad9d;
}

button.secondary {
  color: #2c5137;
  background: #e7efe3;
}

.status {
  min-height: 28px;
  margin: 14px 0 0;
}

.status.error {
  color: #9a3328;
}

.error-detail {
  max-height: 180px;
  margin: 8px 0 0;
  overflow: auto;
  border: 1px solid #e3b6ae;
  border-radius: 6px;
  padding: 10px;
  color: #6d2018;
  background: #fff7f5;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.78rem;
  line-height: 1.5;
  white-space: pre-wrap;
  word-break: break-word;
}

.preview-panel {
  display: grid;
  place-items: center;
  min-height: 340px;
  overflow: hidden;
  background: #eef4e8;
}

.preview-panel img {
  width: 100%;
  height: 100%;
  max-height: 520px;
  object-fit: contain;
  background: #15221a;
}

.empty-preview {
  color: #7a887a;
}

.result {
  margin-top: 18px;
  padding: 18px;
}

.result-header {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: flex-start;
  margin-bottom: 18px;
}

.profile-card {
  margin-bottom: 14px;
}

.profile-heading {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
}

.profile-description {
  margin-bottom: 14px;
  color: #435349;
  line-height: 1.7;
}

.profile-facts {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px 14px;
  margin: 0;
}

.profile-facts dt {
  color: #5d6b60;
  font-size: 0.78rem;
  font-weight: 700;
}

.profile-facts dd {
  margin: 4px 0 0;
  color: #203026;
  line-height: 1.55;
}

.grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr;
  gap: 14px;
}

.result article {
  padding: 16px;
  box-shadow: none;
}

.candidate-list {
  display: grid;
  gap: 10px;
  margin: 0;
  padding-left: 20px;
}

.candidate-list li {
  padding-left: 4px;
}

.candidate-row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
}

.candidate-name {
  font-weight: 650;
}

.candidate-score {
  color: #3f7a4a;
  white-space: nowrap;
}

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

.contact-hero {
  margin-bottom: 18px;
}

.contact-panel {
  border: 1px solid #dce5d6;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.78);
  box-shadow: 0 18px 50px rgba(44, 69, 50, 0.08);
}

.contact-list {
  display: grid;
  margin: 0;
  padding: 4px 0;
}

.contact-item {
  display: grid;
  grid-template-columns: minmax(150px, 220px) minmax(0, 1fr);
  gap: 18px;
  padding: 22px 24px;
  border-bottom: 1px solid #dce5d6;
}

.contact-item:last-child {
  border-bottom: 0;
}

.contact-item dt {
  color: #4f735d;
  font-size: 0.86rem;
  font-weight: 700;
}

.contact-item dd {
  margin: 0;
  color: #203026;
  font-size: 1.05rem;
  line-height: 1.6;
}

.contact-item a {
  color: #2c6a41;
  text-decoration: none;
}

.contact-item a:hover {
  text-decoration: underline;
}

.contact-footer {
  margin-top: auto;
  padding-top: 24px;
  color: #5d6b60;
  font-size: 0.9rem;
}

.contact-footer a,
.policy-panel a {
  color: #2c6a41;
  text-decoration: none;
}

.contact-footer a:hover,
.policy-panel a:hover {
  text-decoration: underline;
}

.policy-shell {
  max-width: 920px;
}

.policy-hero {
  margin-bottom: 18px;
}

.policy-panel {
  border: 1px solid #dce5d6;
  border-radius: 8px;
  padding: 24px;
  background: rgba(255, 255, 255, 0.82);
  box-shadow: 0 18px 50px rgba(44, 69, 50, 0.08);
}

.policy-panel h2 {
  margin: 26px 0 10px;
  font-size: 1.15rem;
}

.policy-panel p {
  margin-bottom: 10px;
  color: #435349;
  line-height: 1.8;
}

.policy-meta {
  margin-bottom: 18px;
  padding-bottom: 12px;
  border-bottom: 1px solid #dce5d6;
}

.policy-meta p {
  margin-bottom: 5px;
  color: #5d6b60;
}

@media (max-width: 820px) {
  .hero,
  .result-header {
    flex-direction: column;
  }

  .workspace,
  .grid,
  .profile-facts {
    grid-template-columns: 1fr;
  }

  .shell {
    width: min(100vw - 24px, 680px);
    padding-top: 24px;
  }

  .contact-item {
    grid-template-columns: 1fr;
    gap: 8px;
    padding: 18px;
  }

  .policy-panel {
    padding: 18px;
  }
}
