:root {
  color-scheme: light;
  --bg: #eef2f4;
  --surface: #ffffff;
  --text: #20242a;
  --muted: #69717d;
  --line: #dfe4ea;
  --accent: #177c65;
  --accent-strong: #0c5b49;
  --accent-soft: #e7f3ef;
  --ink: #263039;
  --danger: #ad2f2f;
  --shadow: 0 22px 70px rgba(31, 38, 46, 0.13);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    linear-gradient(180deg, rgba(23, 124, 101, 0.08), rgba(23, 124, 101, 0) 280px),
    var(--bg);
  color: var(--text);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

.shell {
  width: min(980px, calc(100% - 32px));
  margin: 40px auto;
}

.workspace {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
  padding: 30px;
}

.topbar {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  align-items: flex-start;
  border-bottom: 1px solid var(--line);
  padding-bottom: 22px;
  margin-bottom: 24px;
}

.eyebrow {
  color: var(--accent);
  font-weight: 700;
  letter-spacing: 0;
  margin: 0 0 6px;
}

h1 {
  margin: 0;
  font-size: clamp(30px, 4vw, 46px);
  line-height: 1.05;
  letter-spacing: 0;
}

.status-pill,
.secondary {
  border: 1px solid var(--line);
  border-radius: 6px;
  color: var(--accent-strong);
  background: var(--accent-soft);
  padding: 8px 10px;
  font-size: 14px;
  text-decoration: none;
  white-space: nowrap;
}

.app-grid {
  display: grid;
  grid-template-columns: 230px minmax(0, 1fr);
  gap: 26px;
  align-items: start;
}

.rail {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  background: #fbfcfd;
}

.rail-step {
  min-height: 58px;
  display: grid;
  grid-template-columns: 32px 1fr;
  gap: 10px;
  align-items: center;
  padding: 10px;
  border-radius: 6px;
  color: var(--muted);
}

.rail-step + .rail-step {
  margin-top: 6px;
}

.rail-step span {
  width: 32px;
  height: 32px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: #ffffff;
  font-weight: 800;
}

.rail-step strong {
  font-size: 15px;
}

.rail-step.active {
  color: var(--ink);
  background: var(--accent-soft);
}

.rail-step.active span {
  color: #ffffff;
  background: var(--accent);
  border-color: var(--accent);
}

.run-form {
  display: grid;
  gap: 19px;
}

.segmented {
  border: 0;
  padding: 0;
  margin: 0;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.segmented legend {
  grid-column: 1 / -1;
  color: var(--muted);
  font-size: 14px;
  margin-bottom: 2px;
}

.segmented label {
  position: relative;
  display: block;
}

.segmented input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.segmented span {
  display: flex;
  min-height: 50px;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--line);
  border-radius: 6px;
  font-weight: 700;
  color: var(--muted);
}

.segmented input:checked + span {
  color: #ffffff;
  border-color: var(--accent);
  background: var(--accent);
}

.field {
  display: grid;
  gap: 7px;
}

.field span,
.steps summary {
  font-weight: 700;
}

small {
  color: var(--muted);
  font-weight: 500;
}

input {
  width: 100%;
  height: 50px;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 0 13px;
  color: var(--text);
  font: inherit;
  outline: none;
}

input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(23, 124, 101, 0.16);
}

.steps {
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 13px 14px;
  background: #fbfcfd;
}

.steps ol {
  margin: 12px 0 0;
  padding-left: 20px;
  color: var(--muted);
}

.steps-intro {
  margin: 10px 0 0;
  color: var(--muted);
  line-height: 1.45;
}

.steps li {
  margin: 7px 0;
}

.phone-help {
  display: grid;
  gap: 8px;
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  line-height: 1.45;
}

.phone-help strong {
  color: var(--ink);
}

.security-line {
  color: var(--muted);
  font-size: 14px;
  line-height: 1.45;
}

.primary {
  border: 0;
  border-radius: 6px;
  min-height: 52px;
  padding: 0 16px;
  background: var(--accent);
  color: #ffffff;
  font: inherit;
  font-weight: 800;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  text-decoration: none;
}

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

.primary.disabled {
  opacity: 0.48;
  pointer-events: none;
}

.notice {
  border: 1px solid rgba(173, 47, 47, 0.25);
  background: rgba(173, 47, 47, 0.08);
  color: var(--danger);
  padding: 12px 14px;
  border-radius: 6px;
  margin-bottom: 16px;
}

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

.metric {
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 14px;
  background: #fbfcfd;
}

.metric span {
  display: block;
  color: var(--muted);
  font-size: 13px;
  margin-bottom: 6px;
}

.metric strong {
  font-size: 24px;
}

.progress {
  height: 10px;
  background: #edf0f3;
  border-radius: 999px;
  margin: 18px 0;
  overflow: hidden;
}

.bar {
  height: 100%;
  width: 8%;
  background: var(--accent);
  transition: width 220ms ease;
}

.job-actions {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 18px;
}

.message {
  color: var(--muted);
}

.activity {
  display: grid;
  gap: 9px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px;
  background: #fbfcfd;
}

.activity-row {
  display: grid;
  grid-template-columns: 28px 1fr;
  gap: 10px;
  align-items: center;
  color: var(--muted);
  min-height: 34px;
}

.activity-row span {
  width: 22px;
  height: 22px;
  border: 2px solid var(--line);
  border-radius: 999px;
  background: #ffffff;
}

.activity-row strong {
  font-size: 15px;
}

.activity-row.active {
  color: var(--ink);
}

.activity-row.active span {
  border-color: var(--accent);
  border-top-color: transparent;
  animation: spin 900ms linear infinite;
}

.activity-row.done {
  color: var(--ink);
}

.activity-row.done span {
  border-color: var(--accent);
  background: var(--accent);
  box-shadow: inset 0 0 0 4px #ffffff;
}

.activity-row.failed {
  color: var(--danger);
}

.activity-row.failed span {
  border-color: var(--danger);
}

.admin-shell {
  width: min(1280px, calc(100% - 32px));
}

.admin-login {
  max-width: 460px;
}

.admin-table-wrap {
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
}

.admin-table {
  width: 100%;
  border-collapse: collapse;
  min-width: 1540px;
  font-size: 13px;
}

.admin-table th,
.admin-table td {
  padding: 10px 12px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
}

.admin-table th {
  color: var(--muted);
  font-size: 12px;
  background: #fbfcfd;
}

.admin-table tbody tr:last-child td {
  border-bottom: 0;
}

.admin-table a {
  color: var(--accent-strong);
  font-weight: 700;
  text-decoration: none;
}

.token-cell {
  display: block;
  max-width: 440px;
  overflow-x: auto;
  white-space: nowrap;
  color: var(--ink);
  background: #f4f7f8;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 6px 8px;
}

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

@media (max-width: 760px) {
  .shell {
    width: min(100% - 20px, 980px);
    margin: 10px auto;
  }

  .workspace {
    padding: 18px;
  }

  .topbar,
  .job-actions {
    flex-direction: column;
    align-items: stretch;
  }

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

  .rail {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 6px;
  }

  .rail-step {
    grid-template-columns: 1fr;
    justify-items: center;
    text-align: center;
  }

  .segmented,
  .job-grid {
    grid-template-columns: 1fr;
  }
}
