:root {
  color-scheme: light;
  --bg: #202322;
  --desk: #2b2e2c;
  --paper: #f6f2e8;
  --paper-2: #fffaf0;
  --paper-3: #ebe4d5;
  --ink: #151614;
  --ink-2: #30342f;
  --muted: #747970;
  --line: #d5cbbb;
  --line-strong: #938978;
  --accent: #e34e3a;
  --accent-2: #0f766e;
  --accent-3: #c08a26;
  --blue: #244e7a;
  --danger: #a93632;
  --pass-bg: #d8eee7;
  --maybe-bg: #f8e7bc;
  --reject-bg: #f2d6d1;
  --radius: 8px;
  --radius-sm: 6px;
  --font: "Avenir Next", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", ui-sans-serif, system-ui, sans-serif;
  --serif: "Songti SC", "Noto Serif CJK SC", "STSong", Georgia, serif;
  --mono: "SFMono-Regular", "Cascadia Mono", "Menlo", monospace;
  --shadow: 0 24px 70px rgba(0, 0, 0, 0.22);
  --shadow-soft: 0 12px 32px rgba(26, 22, 16, 0.1);
}

* {
  box-sizing: border-box;
}

html,
body {
  min-height: 100%;
}

body {
  margin: 0;
  background:
    linear-gradient(90deg, rgba(255, 255, 255, 0.035) 1px, transparent 1px) 0 0 / 48px 48px,
    linear-gradient(rgba(255, 255, 255, 0.03) 1px, transparent 1px) 0 0 / 48px 48px,
    linear-gradient(145deg, #191b1a 0%, #252926 42%, #343029 100%);
  color: var(--ink);
  font-family: var(--font);
  letter-spacing: 0;
  text-rendering: optimizeLegibility;
}

body::before {
  position: fixed;
  inset: 0;
  pointer-events: none;
  content: "";
  background-image:
    repeating-linear-gradient(0deg, rgba(255, 255, 255, 0.018) 0 1px, transparent 1px 4px),
    repeating-linear-gradient(90deg, rgba(0, 0, 0, 0.05) 0 1px, transparent 1px 7px);
  mix-blend-mode: soft-light;
}

button,
textarea,
input,
select {
  font: inherit;
}

button {
  cursor: pointer;
}

button:disabled,
select:disabled,
textarea:disabled,
input:disabled {
  cursor: not-allowed;
}

::selection {
  background: rgba(227, 78, 58, 0.22);
}

:focus-visible {
  outline: 2px solid rgba(227, 78, 58, 0.55);
  outline-offset: 2px;
}

.shell {
  width: min(1500px, 100%);
  margin: 0 auto;
  padding: 18px;
}

.topbar {
  min-height: 92px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  position: relative;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: var(--radius);
  background:
    linear-gradient(90deg, rgba(227, 78, 58, 0.14), transparent 28%),
    linear-gradient(135deg, #111211, #242723 78%);
  box-shadow: var(--shadow);
  padding: 18px;
}

.topbar::after {
  position: absolute;
  right: 18px;
  bottom: 0;
  width: 240px;
  height: 5px;
  content: "";
  background: linear-gradient(90deg, var(--accent), var(--accent-3), var(--accent-2));
}

.eyebrow {
  margin: 0 0 6px;
  color: #b9c1b9;
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 800;
  line-height: 1.2;
  text-transform: uppercase;
}

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

h1 {
  margin-bottom: 0;
  color: #fff7e8;
  font-family: var(--serif);
  font-size: 38px;
  font-weight: 900;
  line-height: 1.05;
}

h2 {
  margin-bottom: 0;
  color: var(--ink);
  font-size: 16px;
  font-weight: 900;
  line-height: 1.25;
}

.top-actions,
.inline-actions,
.run-actions,
.run-meta {
  display: flex;
  align-items: center;
  gap: 10px;
}

.workspace {
  display: grid;
  grid-template-columns: minmax(360px, 455px) minmax(0, 1fr);
  gap: 18px;
  padding-top: 18px;
}

.input-pane,
.result-pane {
  display: flex;
  flex-direction: column;
  gap: 18px;
  min-width: 0;
}

.section-block,
.runbar,
.summary-band,
.table-tools,
.results-wrap {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background:
    linear-gradient(rgba(255, 255, 255, 0.6), rgba(255, 255, 255, 0.18)),
    linear-gradient(135deg, var(--paper-2), var(--paper));
  box-shadow: var(--shadow-soft);
}

.section-block {
  position: relative;
  overflow: hidden;
  padding: 15px;
}

.section-block::before {
  position: absolute;
  top: 0;
  left: 0;
  width: 48px;
  height: 4px;
  content: "";
  background: var(--accent);
}

.section-block::after {
  position: absolute;
  top: 14px;
  right: 14px;
  color: rgba(21, 22, 20, 0.14);
  font-family: var(--mono);
  font-size: 22px;
  font-weight: 900;
  line-height: 1;
}

.input-pane .section-block:nth-child(1)::after {
  content: "01";
}

.input-pane .section-block:nth-child(2)::after {
  content: "02";
}

.section-head,
.runbar,
.table-tools {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.section-head {
  min-height: 42px;
  margin-bottom: 12px;
  padding-right: 40px;
}

.runbar {
  min-height: 74px;
  padding: 13px;
  background:
    linear-gradient(90deg, rgba(15, 118, 110, 0.12), transparent 42%),
    linear-gradient(135deg, #fffdf6, #f1eadc);
}

.run-meta {
  min-width: 0;
  color: var(--muted);
  font-size: 13px;
  flex-wrap: wrap;
}

.run-meta span {
  display: inline-flex;
  align-items: center;
  min-height: 29px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.5);
  padding: 0 10px;
  white-space: nowrap;
}

.segmented {
  display: inline-grid;
  grid-auto-flow: column;
  min-height: 40px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: var(--radius);
  background: rgba(0, 0, 0, 0.2);
}

.segmented.small {
  min-height: 36px;
  border-color: var(--line);
  background: rgba(255, 255, 255, 0.38);
}

.segment {
  min-width: 78px;
  border: 0;
  border-right: 1px solid rgba(255, 255, 255, 0.12);
  background: transparent;
  color: #d6d8d0;
  padding: 0 14px;
  font-size: 13px;
  font-weight: 850;
  white-space: nowrap;
  transition: background 0.15s ease, color 0.15s ease;
}

.segment:last-child {
  border-right: 0;
}

.segmented.small .segment {
  min-width: 62px;
  border-right-color: var(--line);
  color: var(--muted);
  padding: 0 11px;
  font-size: 12px;
}

.segment:hover {
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
}

.segmented.small .segment:hover {
  background: rgba(227, 78, 58, 0.08);
  color: var(--ink);
}

.segment.active {
  background: var(--accent);
  color: #fff;
}

.segmented.small .segment.active {
  background: var(--ink);
  color: #fff;
}

.icon-button,
.primary-button,
.secondary-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 40px;
  max-width: 100%;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  transition: transform 0.15s ease, border-color 0.15s ease, background 0.15s ease, box-shadow 0.15s ease;
}

.icon-button {
  width: 40px;
  padding: 0;
  background: var(--ink);
  color: #fff;
  box-shadow: 0 9px 20px rgba(0, 0, 0, 0.2);
}

.icon-button.quiet {
  border-color: rgba(255, 255, 255, 0.14);
  background: rgba(255, 255, 255, 0.08);
  color: #fff7e8;
  box-shadow: none;
}

.section-block .icon-button.quiet,
.inline-actions .icon-button.quiet {
  border-color: var(--line);
  background: rgba(255, 255, 255, 0.52);
  color: var(--ink);
}

.primary-button,
.secondary-button {
  padding: 0 14px;
  white-space: nowrap;
  font-size: 14px;
  font-weight: 900;
}

.primary-button {
  border-color: rgba(104, 31, 22, 0.32);
  background: linear-gradient(180deg, #f0634d, var(--accent));
  color: #fff;
  box-shadow: 0 12px 26px rgba(227, 78, 58, 0.24);
}

.secondary-button {
  border-color: var(--line);
  background: rgba(255, 255, 255, 0.55);
  color: var(--ink);
}

.icon-button:hover,
.primary-button:hover,
.secondary-button:hover {
  transform: translateY(-1px);
  border-color: var(--ink);
  box-shadow: 0 12px 24px rgba(0, 0, 0, 0.14);
}

.icon-button:active,
.primary-button:active,
.secondary-button:active {
  transform: translateY(0);
}

.icon-button svg,
.primary-button svg,
.secondary-button svg,
.dropzone svg,
.empty-state svg {
  width: 18px;
  height: 18px;
  flex: 0 0 auto;
}

i[data-lucide] {
  width: 18px;
  height: 18px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
}

i[data-lucide]::before {
  width: 8px;
  height: 8px;
  border: 2px solid currentColor;
  transform: rotate(45deg);
  content: "";
}

input[type="file"] {
  position: absolute;
  inline-size: 1px;
  block-size: 1px;
  opacity: 0;
  pointer-events: none;
}

.roles-list,
.resume-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.role-item {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background:
    linear-gradient(90deg, rgba(21, 22, 20, 0.04) 0 54px, transparent 54px),
    rgba(255, 255, 255, 0.35);
  padding: 10px;
}

.role-title-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 40px;
  gap: 8px;
  margin-bottom: 8px;
}

.role-title-row input,
.role-item textarea,
.paste-row textarea,
select {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.72);
  color: var(--ink);
  outline: none;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.75);
  transition: border-color 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
}

.role-title-row input:focus,
.role-item textarea:focus,
.paste-row textarea:focus,
select:focus {
  border-color: rgba(227, 78, 58, 0.72);
  background: #fffefa;
  box-shadow: 0 0 0 3px rgba(227, 78, 58, 0.1);
}

.role-title-row input,
select {
  min-height: 38px;
  padding: 0 10px;
  font-weight: 800;
}

.role-item textarea {
  min-height: 74px;
  resize: vertical;
  padding: 9px 10px;
  margin-top: 8px;
  line-height: 1.45;
}

.role-item textarea.compact {
  min-height: 58px;
}

.role-item label {
  display: block;
  color: var(--muted);
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 850;
  margin-top: 8px;
  text-transform: uppercase;
}

.dropzone {
  min-height: 96px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin-bottom: 10px;
  border: 1px dashed var(--line-strong);
  border-radius: var(--radius);
  background:
    repeating-linear-gradient(135deg, rgba(21, 22, 20, 0.035) 0 1px, transparent 1px 12px),
    rgba(255, 255, 255, 0.38);
  color: var(--muted);
  cursor: pointer;
  text-align: center;
  transition: border-color 0.16s ease, color 0.16s ease, background 0.16s ease;
}

.dropzone span {
  overflow-wrap: anywhere;
  font-weight: 850;
}

.dropzone.dragover,
.dropzone:hover {
  border-color: var(--accent);
  color: var(--accent);
  background: rgba(255, 255, 255, 0.6);
}

.paste-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 40px;
  gap: 8px;
  margin-bottom: 10px;
}

.paste-row textarea {
  min-height: 92px;
  resize: vertical;
  padding: 10px;
  line-height: 1.5;
}

.resume-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto 32px;
  align-items: center;
  gap: 8px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.5);
  transition: border-color 0.15s ease, transform 0.15s ease, box-shadow 0.15s ease;
}

.resume-item:hover {
  border-color: var(--line-strong);
  transform: translateY(-1px);
  box-shadow: 0 8px 18px rgba(26, 22, 16, 0.08);
}

.resume-title {
  min-width: 0;
}

.resume-title strong {
  display: block;
  overflow: hidden;
  color: var(--ink);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.resume-title span,
.resume-size {
  color: var(--muted);
  font-size: 12px;
}

.resume-size {
  white-space: nowrap;
}

.mini-button {
  width: 32px;
  height: 32px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 0;
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--muted);
  transition: background 0.15s ease, color 0.15s ease;
}

.mini-button:hover {
  background: rgba(169, 54, 50, 0.1);
  color: var(--danger);
}

.mini-button svg {
  width: 16px;
  height: 16px;
}

.summary-band {
  min-height: 96px;
  display: grid;
  grid-template-columns: repeat(3, minmax(96px, 118px)) minmax(0, 1fr);
  align-items: stretch;
  gap: 12px;
  padding: 14px;
  background:
    linear-gradient(90deg, rgba(0, 0, 0, 0.86), rgba(21, 22, 20, 0.9)),
    #151614;
  border-color: rgba(255, 255, 255, 0.1);
  color: #fff8e9;
}

.summary-band > div:not(.summary-note) {
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-left: 4px solid var(--line-strong);
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.06);
  padding: 9px 10px;
}

.summary-band > div:nth-child(1) {
  border-left-color: var(--accent-2);
}

.summary-band > div:nth-child(2) {
  border-left-color: var(--accent-3);
}

.summary-band > div:nth-child(3) {
  border-left-color: var(--accent);
}

.summary-value {
  display: block;
  color: #fffdf6;
  font-family: var(--mono);
  font-size: 31px;
  font-weight: 900;
  line-height: 1;
  font-variant-numeric: tabular-nums;
}

.summary-label {
  color: #b8bdb3;
  font-size: 12px;
  font-weight: 850;
}

.summary-note {
  min-width: 0;
  align-self: center;
  color: #d7dacd;
  line-height: 1.5;
  overflow-wrap: anywhere;
}

.table-tools {
  padding: 10px 12px;
}

select {
  width: 188px;
  background: rgba(255, 255, 255, 0.74);
}

.results-wrap {
  min-height: 440px;
  overflow: auto;
  position: relative;
}

.results-table {
  width: 100%;
  min-width: 960px;
  border-collapse: collapse;
  table-layout: fixed;
}

.results-table th,
.results-table td {
  text-align: left;
  vertical-align: top;
  padding: 13px 12px;
  border-bottom: 1px solid var(--line);
  overflow-wrap: anywhere;
}

.results-table th:nth-child(1) {
  width: 15%;
}

.results-table th:nth-child(2) {
  width: 15%;
}

.results-table th:nth-child(3) {
  width: 10%;
}

.results-table th:nth-child(4) {
  width: 9%;
}

.results-table th:nth-child(5) {
  width: 27%;
}

.results-table th:nth-child(6) {
  width: 24%;
}

.results-table th {
  position: sticky;
  top: 0;
  z-index: 1;
  background: #292b28;
  color: #ebe5d7;
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 900;
  text-transform: uppercase;
}

.results-table tbody tr {
  background: rgba(255, 255, 255, 0.42);
  transition: background 0.15s ease;
}

.results-table tbody tr:nth-child(even) {
  background: rgba(255, 255, 255, 0.24);
}

.results-table tbody tr:hover {
  background: rgba(255, 255, 255, 0.66);
}

.candidate-cell {
  min-width: 140px;
}

.candidate-cell strong,
.role-cell strong {
  display: block;
  margin-bottom: 4px;
  color: var(--ink);
  line-height: 1.35;
  overflow-wrap: anywhere;
}

.cell-muted {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.4;
}

.decision-pill {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  border: 1px solid transparent;
  border-radius: 999px;
  padding: 0 10px;
  font-size: 12px;
  font-weight: 900;
  white-space: nowrap;
}

.decision-pass {
  background: var(--pass-bg);
  border-color: rgba(15, 118, 110, 0.2);
  color: var(--accent-2);
}

.decision-maybe {
  background: var(--maybe-bg);
  border-color: rgba(192, 138, 38, 0.2);
  color: #8a5e14;
}

.decision-reject {
  background: var(--reject-bg);
  border-color: rgba(169, 54, 50, 0.18);
  color: var(--danger);
}

.score {
  color: var(--ink);
  font-family: var(--mono);
  font-size: 22px;
  font-weight: 900;
  font-variant-numeric: tabular-nums;
}

.details-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  max-width: 370px;
}

.details-list span {
  color: var(--muted);
  line-height: 1.45;
}

.details-list b {
  color: var(--ink);
}

.empty-state {
  position: absolute;
  inset: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  border: 1px dashed var(--line-strong);
  border-radius: var(--radius);
  background:
    linear-gradient(90deg, transparent 0 49%, rgba(21, 22, 20, 0.05) 49% 51%, transparent 51%),
    rgba(255, 255, 255, 0.3);
  color: var(--muted);
  pointer-events: none;
  text-align: center;
  font-weight: 850;
}

.results-wrap.has-results .empty-state {
  display: none;
}

.toast {
  position: fixed;
  left: 50%;
  bottom: 22px;
  z-index: 5;
  min-width: min(440px, calc(100vw - 32px));
  max-width: calc(100vw - 32px);
  transform: translateX(-50%) translateY(16px);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: var(--radius);
  background: #101110;
  color: #fff8e9;
  box-shadow: var(--shadow);
  opacity: 0;
  padding: 12px 14px;
  pointer-events: none;
  text-align: center;
  transition: opacity 0.18s ease, transform 0.18s ease;
  font-weight: 850;
}

.toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

.is-busy .primary-button {
  background: linear-gradient(180deg, #d69229, var(--accent-3));
}

.is-busy .primary-button svg {
  animation: pulse-spin 1.1s linear infinite;
}

@keyframes pulse-spin {
  from {
    transform: rotate(0deg);
  }

  to {
    transform: rotate(360deg);
  }
}

@media (prefers-reduced-motion: no-preference) {
  .section-block,
  .runbar,
  .summary-band,
  .table-tools,
  .results-wrap {
    animation: surface-in 0.28s ease both;
  }

  .result-pane > *:nth-child(2) {
    animation-delay: 0.04s;
  }

  .result-pane > *:nth-child(3) {
    animation-delay: 0.08s;
  }

  .result-pane > *:nth-child(4) {
    animation-delay: 0.12s;
  }
}

@keyframes surface-in {
  from {
    opacity: 0;
    transform: translateY(6px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (max-width: 980px) {
  .shell {
    padding: 12px;
  }

  .topbar,
  .runbar,
  .table-tools {
    align-items: stretch;
    flex-direction: column;
  }

  .topbar::after {
    left: 18px;
    right: auto;
    width: 180px;
  }

  .top-actions,
  .run-actions {
    width: 100%;
    justify-content: space-between;
    flex-wrap: wrap;
  }

  .top-actions .segmented {
    flex: 1 1 220px;
  }

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

  .run-actions > button {
    flex: 1 1 140px;
  }

  .summary-band {
    grid-template-columns: repeat(3, 1fr);
  }

  .summary-note {
    grid-column: 1 / -1;
  }

  select {
    width: 100%;
  }
}

@media (max-width: 560px) {
  .shell {
    padding: 10px;
  }

  .topbar {
    padding: 14px;
  }

  h1 {
    font-size: 30px;
  }

  .top-actions,
  .inline-actions {
    gap: 8px;
  }

  .segmented {
    width: 100%;
  }

  .segment {
    min-width: 0;
    padding: 0 10px;
  }

  .section-block,
  .runbar,
  .summary-band,
  .table-tools {
    padding: 10px;
  }

  .summary-band {
    grid-template-columns: 1fr;
  }

  .summary-value {
    font-size: 26px;
  }

  .run-actions > button {
    flex-basis: 100%;
  }

  .resume-item {
    grid-template-columns: minmax(0, 1fr) 32px;
  }

  .resume-size {
    grid-column: 1 / -1;
    grid-row: 2;
  }

  .results-wrap {
    min-height: 360px;
  }
}
