:root {
  color-scheme: light;
  --bg: #eef2f5;
  --panel: #ffffff;
  --text: #17202a;
  --muted: #5d6b7a;
  --line: #d6dee8;
  --accent: #176b87;
  --accent-strong: #0d4f65;
  --cyan-soft: #e6f4f7;
  --warn-bg: #fff7df;
  --warn-line: #e8c557;
  --ok: #1b7f56;
  --bad: #b33a3a;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

.shell {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 390px;
  gap: 24px;
  width: min(1240px, calc(100% - 32px));
  margin: 28px auto;
}

.workspace,
.side {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.topbar,
.panel-head,
.progress-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.eyebrow {
  margin: 0 0 4px;
  color: var(--muted);
  font-size: 13px;
}

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

h1 {
  font-size: 30px;
  line-height: 1.15;
}

h2 {
  font-size: 16px;
}

.notice,
.panel {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
}

.notice {
  padding: 12px 14px;
  border-color: var(--warn-line);
  background: var(--warn-bg);
  color: #57420a;
  line-height: 1.45;
}

.panel {
  padding: 18px;
}

.compact {
  padding: 16px;
}

.upload-panel {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.resume-panel {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 16px;
  border: 1px solid #e0a83b;
  border-radius: 8px;
  background: #fff4d8;
  color: #4a3710;
}

.resume-panel p {
  margin: 4px 0 0;
  color: #6a531f;
}

.resume-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

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

.grid.three {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.field {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

label {
  font-weight: 650;
}

.field span,
.upload-slot span,
.soft-label {
  color: var(--muted);
  font-size: 13px;
}

.upload-slot {
  position: relative;
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr);
  gap: 12px;
  align-items: center;
  min-height: 108px;
  padding: 18px;
  border: 1px dashed #9ab3c1;
  border-radius: 8px;
  background: var(--cyan-soft);
}

.compact-slot {
  grid-template-columns: 28px minmax(0, 1fr);
  min-height: 126px;
  background: #fff;
  border-style: solid;
}

.upload-slot > svg {
  color: var(--accent);
  width: 32px;
  height: 32px;
}

.compact-slot > svg {
  width: 22px;
  height: 22px;
}

.upload-slot input,
.slot-footer {
  grid-column: 1 / -1;
}

.slot-footer {
  display: grid;
  gap: 7px;
}

.slot-state {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 28px;
  color: var(--muted);
  font-size: 13px;
}

.slot-state.active {
  color: var(--accent);
}

.slot-state.done {
  color: var(--ok);
}

.slot-state.error {
  color: var(--bad);
}

.slot-state.active svg {
  animation: spin 900ms linear infinite;
}

.slot-progress {
  height: 6px;
  overflow: hidden;
  border-radius: 999px;
  background: #dbe4ea;
}

.slot-progress div {
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #176b87, #1b7f56);
  transition: width 160ms ease;
}

input,
textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  color: var(--text);
  font: inherit;
}

input[type="file"] {
  min-height: 44px;
  padding: 10px;
}

textarea {
  min-height: 120px;
  padding: 12px;
  resize: vertical;
}

.primary,
.secondary,
.ghost-button,
.icon-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 0;
  cursor: pointer;
}

.primary {
  gap: 8px;
  min-height: 44px;
  padding: 0 16px;
  border-radius: 6px;
  background: var(--accent);
  color: #fff;
  font-weight: 700;
}

.primary:hover {
  background: var(--accent-strong);
}

.primary:disabled {
  cursor: wait;
  opacity: 0.7;
}

.secondary,
.ghost-button {
  gap: 8px;
  min-height: 38px;
  padding: 0 12px;
  border-radius: 6px;
  font-weight: 650;
}

.secondary {
  background: #ffffff;
  color: var(--accent);
  border: 1px solid rgba(23, 107, 135, 0.35);
}

.ghost-button {
  background: transparent;
  color: #7a3c2b;
  border: 1px solid rgba(122, 60, 43, 0.35);
}

.hidden {
  display: none !important;
}

.icon-button {
  width: 36px;
  height: 36px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  color: var(--text);
}

.status-pill {
  min-width: 104px;
  min-height: 32px;
  padding: 7px 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fff;
  color: var(--muted);
  text-align: center;
  font-size: 13px;
}

.status-pill.ok {
  border-color: rgba(27, 127, 86, 0.35);
  color: var(--ok);
}

.status-pill.bad {
  border-color: rgba(179, 58, 58, 0.35);
  color: var(--bad);
}

.progress-wrap {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.progress-meta {
  color: var(--muted);
  font-size: 13px;
}

.progress-track {
  height: 10px;
  overflow: hidden;
  border-radius: 999px;
  background: #dbe4ea;
}

.progress-bar {
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #176b87, #1b7f56);
  transition: width 160ms ease;
}

.steps {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
}

.step {
  display: flex;
  align-items: center;
  gap: 7px;
  min-height: 38px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  color: var(--muted);
  font-size: 13px;
}

.step.done {
  border-color: rgba(27, 127, 86, 0.35);
  color: var(--ok);
  background: #eef9f4;
}

.step.error {
  border-color: rgba(179, 58, 58, 0.35);
  color: var(--bad);
  background: #fff0f0;
}

.step.active {
  border-color: rgba(23, 107, 135, 0.35);
  color: var(--accent);
  background: #edf8fb;
}

.step.active svg {
  animation: spin 900ms linear infinite;
}

.kv {
  display: grid;
  grid-template-columns: 120px 1fr;
  gap: 9px 12px;
  margin: 14px 0 0;
  font-size: 14px;
}

.kv dt {
  color: var(--muted);
}

.kv dd {
  margin: 0;
  overflow-wrap: anywhere;
}

.summary-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 14px;
}

.summary-list div {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--line);
}

.summary-list span {
  color: var(--muted);
}

pre {
  min-height: 260px;
  max-height: 520px;
  margin: 14px 0 0;
  overflow: auto;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #101820;
  color: #e6edf3;
  font-size: 12px;
  line-height: 1.45;
}

svg {
  width: 18px;
  height: 18px;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

@media (max-width: 1050px) {
  .shell {
    grid-template-columns: 1fr;
    width: min(100% - 24px, 760px);
    margin: 16px auto;
  }

  .grid,
  .grid.three,
  .steps {
    grid-template-columns: 1fr;
  }

  .topbar {
    flex-direction: column;
    align-items: flex-start;
  }

  .resume-panel {
    flex-direction: column;
    align-items: stretch;
  }

  .resume-actions {
    justify-content: flex-start;
  }
}
