:root {
  color-scheme: light;
  font-family: "Inter", "Segoe UI", system-ui, sans-serif;
  background: #f6f6f9;
  color: #1a1b1e;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  padding: 32px;
}

header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 24px;
  margin-bottom: 32px;
}

header h1 {
  margin: 0 0 8px;
}

.actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

button {
  border: 1px solid #d0d3dc;
  background: #fff;
  border-radius: 10px;
  padding: 10px 16px;
  cursor: pointer;
  font-weight: 600;
}

button.primary {
  background: #1f6feb;
  color: #fff;
  border-color: #1f6feb;
}

main {
  display: grid;
  gap: 24px;
}

.panel {
  background: #fff;
  border-radius: 16px;
  padding: 20px 24px;
  box-shadow: 0 10px 24px rgba(15, 23, 42, 0.08);
}

.panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.helper {
  margin-top: 0;
  color: #5b6472;
}

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 12px;
  margin-top: 12px;
}

label {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 0.9rem;
  color: #444;
}

input,
select {
  border: 1px solid #d0d3dc;
  border-radius: 8px;
  padding: 8px 10px;
  font-size: 0.95rem;
}

.meter {
  display: flex;
  align-items: center;
  gap: 6px;
}

.block-row,
.lead-row {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  border: 1px solid #e2e5ed;
  padding: 16px;
  border-radius: 12px;
  margin-bottom: 12px;
  background: #fbfbfd;
}

.block-info {
  flex: 1;
}

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

.block-actions button {
  white-space: nowrap;
}

.block-name {
  font-weight: 600;
  font-size: 1rem;
  padding: 6px 10px;
}

.grouping {
  margin-top: 12px;
  display: grid;
  gap: 8px;
}

.grouping-header {
  display: flex;
  justify-content: space-between;
  font-size: 0.9rem;
  color: #5b6472;
}

.grouping-status.invalid {
  color: #c92a2a;
}

.grouping-inputs {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.block-grouping-input {
  flex: 1 1 200px;
}

.block-grouping-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.group-chip {
  background: #eef2ff;
  border: 1px solid #c7d2fe;
  color: #1f2a44;
  border-radius: 999px;
  padding: 4px 10px;
  font-size: 0.85rem;
  font-weight: 600;
}

.timeline-wrap {
  position: relative;
}

.timeline-progress {
  position: absolute;
  left: 0;
  top: 4px;
  height: 6px;
  background: linear-gradient(90deg, #1f6feb, #00b894);
  border-radius: 999px;
  width: 0%;
  pointer-events: none;
  transition: width 0.2s ease;
}

.timeline {
  display: flex;
  gap: 8px;
  align-items: stretch;
  min-height: 80px;
  overflow-x: auto;
  padding-bottom: 8px;
  padding-top: 16px;
}

.timeline-block {
  flex: 0 0 auto;
  border-radius: 12px;
  padding: 12px;
  color: #fff;
  cursor: pointer;
  min-width: 120px;
  border: 2px solid transparent;
  transition: transform 0.2s ease, border-color 0.2s ease;
}

.timeline-block.active {
  border-color: #0f172a;
  transform: translateY(-2px);
}

.timeline-block small {
  opacity: 0.9;
}

.timeline-meta {
  display: flex;
  justify-content: space-between;
  margin-top: 12px;
  color: #555;
}

footer {
  margin-top: 24px;
  color: #5b6472;
}
