:root {
  --bg: #f5f7fb;
  --card: #ffffff;
  --text: #1f2937;
  --muted: #6b7280;
  --line: #d7dde7;
  --green: #06c755;
  --green-soft: #e8f8ef;
  --orange: #f59e0b;
  --orange-soft: #fff4db;
  --border: #e5e7eb;
  --shadow: 0 10px 28px rgba(15, 23, 42, 0.06);
  --radius: 18px;
  --danger: #dc2626;
  --danger-soft: #fef2f2;
  --primary: #2563eb;
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

body {
  margin: 0;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: var(--bg);
  color: var(--text);
  padding: 24px 16px 40px;
}

button,
input {
  font: inherit;
}

.page {
  max-width: 720px;
  margin: 0 auto;
  display: grid;
  gap: 16px;
}

.panel {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 24px;
  box-shadow: var(--shadow);
  padding: 18px;
}

.eyebrow {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .04em;
  color: var(--muted);
}

h1,
h2 {
  margin: 0;
  line-height: 1.25;
}

h1 {
  font-size: 24px;
}

h2 {
  font-size: 18px;
}

.sub {
  color: var(--muted);
  font-size: 14px;
  line-height: 1.6;
}

.top-status {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 32px;
  padding: 0 12px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 700;
  white-space: nowrap;
  width: fit-content;
  margin-top: 6px;
}

.top-status.waiting {
  background: var(--orange-soft);
  color: #b45309;
}

.top-status.ready {
  background: var(--green-soft);
  color: #0f8f50;
}

.top-status.error {
  background: var(--danger-soft);
  color: var(--danger);
}

.action-grid {
  display: grid;
  gap: 12px;
}

.field {
  display: grid;
  gap: 6px;
}

.label-text {
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.input {
  width: 100%;
  min-height: 44px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: #fff;
  padding: 0 14px;
  outline: none;
}

.input:focus {
  border-color: #93c5fd;
  box-shadow: 0 0 0 4px rgba(147, 197, 253, 0.2);
}

.button-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.btn {
  appearance: none;
  border: 0;
  border-radius: 14px;
  min-height: 44px;
  padding: 0 16px;
  font-weight: 700;
  cursor: pointer;
  transition: transform .08s ease, opacity .15s ease;
}

.btn:active {
  transform: translateY(1px);
}

.btn:disabled {
  cursor: not-allowed;
  opacity: .55;
  transform: none;
}

.btn-primary {
  background: var(--primary);
  color: #fff;
}

.btn-success {
  background: var(--green);
  color: #fff;
}

.btn-warn {
  background: var(--orange);
  color: #fff;
}

.btn-secondary {
  background: #eef2f7;
  color: #334155;
}

.status-message {
  min-height: 20px;
  font-size: 14px;
  color: var(--muted);
  font-weight: 600;
}

.status-message.error {
  color: var(--danger);
}

.icon-btn {
  appearance: none;
  border: 1px solid var(--border);
  background: #fff;
  color: #64748b;
  width: 40px;
  height: 40px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 4px 10px rgba(15, 23, 42, 0.04);
  transition: transform .08s ease, opacity .15s ease;
  margin-top: 2px;
}

.icon-btn:active {
  transform: translateY(1px);
}

.icon-btn:disabled {
  opacity: .55;
  cursor: not-allowed;
  transform: none;
}

.icon-btn svg {
  width: 18px;
  height: 18px;
  display: block;
}

.kv-row {
  display: grid;
  grid-template-columns: 84px 1fr;
  gap: 8px;
  align-items: center;
}

.label {
  color: #94a3b8;
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
}

.value {
  font-size: 14px;
  font-weight: 600;
  word-break: break-word;
  min-height: 20px;
}

.timeline-panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}

.timeline-title {
  margin: 0;
  font-size: 18px;
}

.timeline {
  position: relative;
  display: grid;
  gap: 14px;
}

.timeline-item {
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr);
  column-gap: 12px;
  align-items: stretch;
}

.rail {
  position: relative;
}

.rail::before {
  content: "";
  position: absolute;
  left: 13px;
  top: 0;
  bottom: -14px;
  width: 2px;
  background: var(--line);
}

.timeline-item:last-child .rail::before {
  bottom: 18px;
}

.dot {
  position: absolute;
  left: 7px;
  top: 14px;
  width: 14px;
  height: 14px;
  border-radius: 999px;
  background: #cbd5e1;
  border: 2px solid #fff;
  box-shadow: 0 0 0 1px rgba(148, 163, 184, 0.24);
  z-index: 1;
}

.dot.active {
  background: var(--orange);
  box-shadow: 0 0 0 1px rgba(245, 158, 11, 0.28);
}

.dot.done {
  background: var(--green);
  box-shadow: 0 0 0 1px rgba(6, 199, 85, 0.24);
}

.step-card,
.stop-card,
.process-card {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: linear-gradient(180deg, #ffffff 0%, #fbfcfe 100%);
  min-width: 0;
}

.step-card {
  padding: 8px 12px;
}

.step-title {
  font-size: 15px;
  font-weight: 800;
  margin-bottom: 4px;
  line-height: 1.4;
  word-break: break-word;
}

@media (max-width: 560px) {
  body {
    padding: 16px 12px 28px;
  }

  .panel {
    border-radius: 20px;
    padding: 14px;
  }

  .timeline-item {
    grid-template-columns: 24px minmax(0, 1fr);
    column-gap: 10px;
  }

  .rail::before {
    left: 11px;
  }

  .dot {
    left: 5px;
  }

  .kv-row {
    grid-template-columns: 72px 1fr;
  }
}