:root {
  color-scheme: light;
  --page: #f4f6f8;
  --surface: #ffffff;
  --text: #18212b;
  --muted: #657181;
  --line: #d8dee6;
  --brand: #156b52;
  --brand-hover: #0f543f;
  --soft-brand: #e7f2ee;
  --danger: #b42318;
  --danger-soft: #fef3f2;
  --success: #087443;
  font-family: Inter, "Segoe UI", "Microsoft YaHei", sans-serif;
  font-size: 15px;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; min-width: 320px; min-height: 100vh; background: var(--page); color: var(--text); }
button, textarea { font: inherit; letter-spacing: 0; }
.connect-shell { min-height: 100vh; display: grid; place-items: center; padding: 20px; }
.start-view { width: min(420px, 100%); text-align: center; }
.wordmark { color: var(--brand); font-size: 15px; font-weight: 800; }
.wordmark.small { font-size: 12px; margin-bottom: 4px; }
h1 { margin: 8px 0 28px; font-size: 28px; line-height: 1.25; }
button, .secondary-command {
  min-height: 44px; border: 1px solid var(--line); border-radius: 6px; padding: 10px 16px;
  background: var(--surface); color: var(--text); cursor: pointer; text-decoration: none;
  display: inline-flex; align-items: center; justify-content: center;
}
button:disabled { opacity: .6; cursor: wait; }
.primary-command {
  width: 100%; min-height: 48px; border: 1px solid var(--brand); border-radius: 6px;
  background: var(--brand); color: #fff; font-weight: 700; cursor: pointer; text-decoration: none;
  display: inline-flex; align-items: center; justify-content: center; padding: 10px 16px;
}
.primary-command:hover { background: var(--brand-hover); border-color: var(--brand-hover); }
.secondary-command:hover { border-color: #98a2b3; background: #f8fafb; }
.start-view .primary-command { width: min(280px, 100%); }
.task-view {
  width: min(640px, 100%); background: var(--surface); border: 1px solid var(--line);
  border-radius: 7px; padding: 24px;
}
.task-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; padding-bottom: 18px; border-bottom: 1px solid var(--line); }
.task-header h1 { margin: 0; font-size: 22px; }
.status { flex: 0 0 auto; padding: 5px 9px; border-radius: 999px; background: var(--soft-brand); color: var(--brand); font-size: 12px; font-weight: 700; }
.status.failed, .status.expired { background: var(--danger-soft); color: var(--danger); }
.status.succeeded { background: #ecfdf3; color: var(--success); }
.steps { list-style: none; margin: 0; padding: 22px 0; display: grid; gap: 16px; }
.steps li { display: grid; grid-template-columns: 28px minmax(0, 1fr); gap: 12px; }
.steps li > span { width: 28px; height: 28px; display: grid; place-items: center; border-radius: 50%; background: var(--soft-brand); color: var(--brand); font-weight: 700; }
.steps strong { display: block; line-height: 1.5; }
.steps p { margin: 3px 0 0; color: var(--muted); line-height: 1.6; }
.task-meta { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 12px 14px; background: #f8fafb; border: 1px solid var(--line); border-radius: 6px; color: var(--muted); }
.task-meta strong { color: var(--text); font-variant-numeric: tabular-nums; }
label { display: block; margin-bottom: 8px; font-weight: 700; }
textarea { width: 100%; min-height: 118px; resize: vertical; padding: 11px 12px; border: 1px solid var(--line); border-radius: 6px; color: var(--text); outline: none; }
textarea:focus { border-color: var(--brand); box-shadow: 0 0 0 3px rgba(21,107,82,.12); }
#submit-button { margin-top: 12px; }
.message { min-height: 24px; margin: 14px 0 0; line-height: 1.55; color: var(--muted); }
.message.error { color: var(--danger); }
.message.success { color: var(--success); }
@media (max-width: 560px) {
  .connect-shell { padding: 0; place-items: stretch; }
  .start-view { align-self: center; justify-self: center; padding: 24px; }
  .task-view { min-height: 100vh; border: 0; border-radius: 0; padding: 20px 16px; }
  .task-header { align-items: center; }
  .steps { padding: 20px 0; }
}
