:root {
  --ink: #172026;
  --muted: #65717b;
  --line: #d9e1e7;
  --surface: #ffffff;
  --page: #f5f7f8;
  --teal: #0f8b8d;
  --green: #2f9e44;
  --coral: #e76f51;
  --yellow: #f2c94c;
  --shadow: 0 18px 50px rgba(23, 32, 38, 0.12);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  background: var(--page);
  font-family: Arial, Helvetica, sans-serif;
}

.app-shell {
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
  padding: 32px 0;
}

.hero {
  display: grid;
  grid-template-columns: 1.3fr 0.7fr;
  gap: 24px;
  align-items: end;
  padding: 32px;
  color: #fff;
  background:
    linear-gradient(120deg, rgba(15, 139, 141, 0.94), rgba(23, 32, 38, 0.9)),
    url("https://images.unsplash.com/photo-1551434678-e076c223a692?auto=format&fit=crop&w=1400&q=80");
  background-size: cover;
  background-position: center;
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.eyebrow {
  margin: 0 0 8px;
  color: currentColor;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0;
  text-transform: uppercase;
  opacity: 0.72;
}

h1,
h2 {
  margin: 0;
  letter-spacing: 0;
}

h1 {
  max-width: 720px;
  font-size: clamp(2.2rem, 5vw, 4.5rem);
  line-height: 0.98;
}

h2 {
  font-size: 1.25rem;
}

.hero-copy {
  max-width: 720px;
  margin: 18px 0 0;
  color: rgba(255, 255, 255, 0.9);
  font-size: 1rem;
  line-height: 1.6;
}

.hero-stats {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.hero-stats span {
  min-height: 54px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, 0.32);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.14);
  font-weight: 700;
}

.workspace {
  display: grid;
  grid-template-columns: 380px 1fr;
  gap: 24px;
  align-items: start;
  margin-top: 24px;
}

.input-panel,
.results-panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 10px 28px rgba(23, 32, 38, 0.06);
}

.input-panel {
  position: sticky;
  top: 20px;
  display: grid;
  gap: 12px;
  padding: 22px;
}

label {
  font-weight: 700;
}

textarea {
  width: 100%;
  min-height: 260px;
  resize: vertical;
  padding: 14px;
  color: var(--ink);
  border: 1px solid var(--line);
  border-radius: 8px;
  font: inherit;
  line-height: 1.5;
}

textarea:focus,
input:focus {
  outline: 3px solid rgba(15, 139, 141, 0.18);
  border-color: var(--teal);
}

.upload-box {
  display: grid;
  gap: 8px;
  padding: 16px;
  border: 1px dashed var(--teal);
  border-radius: 8px;
  background: #f1fbfb;
}

.upload-box p {
  margin: 0;
  color: var(--muted);
  font-size: 0.9rem;
}

button {
  min-height: 48px;
  border: 0;
  border-radius: 8px;
  color: #fff;
  background: var(--teal);
  font: inherit;
  font-weight: 800;
  cursor: pointer;
}

button:hover {
  background: #0b7476;
}

button:disabled {
  cursor: wait;
  background: #8aa6a8;
}

.status-message {
  min-height: 22px;
  margin: 0;
  color: var(--muted);
  font-size: 0.92rem;
}

.results-panel {
  min-width: 0;
  padding: 22px;
}

.section-heading {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
}

.ranking-heading {
  margin-top: 26px;
}

.top-candidates {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  margin-top: 14px;
}

.candidate-card {
  min-width: 0;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfd;
}

.candidate-card:first-child {
  border-color: rgba(47, 158, 68, 0.5);
  background: #f2fbf4;
}

.rank-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 34px;
  height: 28px;
  padding: 0 10px;
  color: #fff;
  background: var(--coral);
  border-radius: 999px;
  font-weight: 800;
}

.candidate-card h3 {
  margin: 14px 0 8px;
  font-size: 1rem;
}

.score {
  color: var(--green);
  font-size: 1.7rem;
  font-weight: 900;
}

.meta-line {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 0.9rem;
}

.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 10px;
}

.chip {
  padding: 5px 8px;
  border-radius: 999px;
  background: #eef3f6;
  color: #34414a;
  font-size: 0.78rem;
  font-weight: 700;
}

.table-wrap {
  overflow-x: auto;
  margin-top: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
}

table {
  width: 100%;
  min-width: 760px;
  border-collapse: collapse;
}

th,
td {
  padding: 14px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
}

th {
  background: #eef3f6;
  font-size: 0.82rem;
  text-transform: uppercase;
}

tr:last-child td {
  border-bottom: 0;
}

.score-bar {
  width: 120px;
  height: 8px;
  margin-top: 6px;
  overflow: hidden;
  border-radius: 999px;
  background: #e8edf0;
}

.score-bar span {
  display: block;
  height: 100%;
  background: var(--yellow);
}

.empty-state,
.empty-table {
  color: var(--muted);
}

.empty-state {
  display: block;
  padding: 18px;
  border: 1px dashed var(--line);
  border-radius: 8px;
}

.error-list {
  display: grid;
  gap: 8px;
  margin-top: 16px;
}

.error-item {
  padding: 10px 12px;
  color: #842029;
  border: 1px solid #f1b0b7;
  border-radius: 8px;
  background: #fff4f5;
}

.site-footer {
  padding: 24px 0 6px;
  color: var(--muted);
  font-size: 0.95rem;
  font-weight: 700;
  text-align: center;
}

@media (max-width: 940px) {
  .hero,
  .workspace {
    grid-template-columns: 1fr;
  }

  .input-panel {
    position: static;
  }

  .top-candidates {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 560px) {
  .app-shell {
    width: min(100% - 20px, 1180px);
    padding: 10px 0;
  }

  .hero,
  .input-panel,
  .results-panel {
    padding: 16px;
  }

  .hero-stats {
    grid-template-columns: 1fr;
  }
}
