:root {
  color: #101828;
  font-family: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: #f6f7fb;
}

* { box-sizing: border-box; }
body { margin: 0; }

.topbar {
  align-items: center;
  background: #0f172a;
  color: #fff;
  display: flex;
  justify-content: space-between;
  gap: 24px;
  padding: 22px 32px;
}

h1, h2, h3, p { margin: 0; }
h1 { font-size: 24px; }
h2 { font-size: 18px; }
h3 { font-size: 15px; }
p { color: #cbd5e1; margin-top: 6px; }
.hint { color: #667085; margin: 0 0 12px; }

button, select, input, textarea {
  border: 1px solid #d0d5dd;
  border-radius: 6px;
  font: inherit;
}

button {
  background: #0f766e;
  color: #fff;
  cursor: pointer;
  min-height: 38px;
  padding: 0 14px;
}

button.secondary { background: #eef4ff; color: #175cd3; }
button.warning { background: #b54708; }
button.danger { background: #fee4e2; color: #b42318; }
button:disabled { cursor: wait; opacity: .65; }

select, input, textarea {
  background: #fff;
  color: #101828;
  min-height: 38px;
  padding: 8px 10px;
  width: 100%;
}

.actions, .split-actions, .task-builder {
  display: flex;
  gap: 10px;
}

.layout {
  display: grid;
  gap: 18px;
  grid-template-columns: minmax(360px, 1fr) minmax(480px, 1.35fr);
  padding: 22px;
}

.panel {
  background: #fff;
  border: 1px solid #eaecf0;
  border-radius: 8px;
  padding: 18px;
}

.wizard-panel {
  grid-column: span 2;
}

.wizard-list {
  display: grid;
  gap: 10px;
  grid-template-columns: repeat(5, 1fr);
}

.robot-config {
  align-items: end;
  background: #f8fafc;
  border: 1px solid #eaecf0;
  border-radius: 6px;
  display: grid;
  gap: 12px;
  grid-template-columns: minmax(220px, 320px) 1fr auto auto;
  margin-bottom: 14px;
  padding: 12px;
}

.robot-config label {
  color: #344054;
  font-size: 13px;
}

.robot-config input {
  margin-top: 6px;
}

.config-meta {
  color: #344054;
  display: grid;
  gap: 4px;
  line-height: 1.35;
  padding-bottom: 2px;
}

.config-meta small {
  color: #667085;
}

.wizard-step {
  background: #f8fafc;
  border: 1px solid #eaecf0;
  border-radius: 6px;
  padding: 12px;
}

.wizard-step.ok {
  border-color: #0f766e;
}

.wizard-step strong {
  display: block;
  font-size: 14px;
  margin-bottom: 5px;
}

.wizard-step small {
  color: #667085;
  display: block;
  line-height: 1.35;
}

.notice {
  background: #fffaeb;
  border: 1px solid #fedf89;
  border-radius: 6px;
  color: #93370d;
  margin: 14px 0;
  padding: 10px 12px;
}

.notice.compact {
  margin: 0 0 12px;
}

.map-switcher {
  align-items: center;
  display: grid;
  gap: 10px;
  grid-template-columns: minmax(180px, 260px) auto;
}

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

.badge {
  border-radius: 999px;
  color: #fff;
  font-size: 13px;
  padding: 5px 10px;
}
.badge.ok { background: #0f766e; }
.badge.bad { background: #b42318; }

.status-grid {
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(3, 1fr);
}

.status-grid.compact {
  grid-template-columns: repeat(3, 1fr);
}

.status-grid div {
  background: #f8fafc;
  border: 1px solid #eef2f6;
  border-radius: 6px;
  padding: 12px;
}

.status-grid span {
  color: #667085;
  display: block;
  font-size: 12px;
  margin-bottom: 5px;
}

.log {
  color: #b42318;
  margin: 12px 0 0;
  white-space: pre-wrap;
}

.log.neutral {
  color: #344054;
}

.point-grid {
  display: grid;
  gap: 10px;
  grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
}

.map-panel, .editor-panel { grid-column: span 2; }

.map-workspace {
  display: grid;
  gap: 18px;
  grid-template-columns: minmax(420px, 1fr) 360px;
}

.map-frame {
  align-items: center;
  background: #f2f4f7;
  border: 1px solid #eaecf0;
  border-radius: 6px;
  display: flex;
  justify-content: center;
  min-height: 420px;
  overflow: auto;
  padding: 10px;
}

.map-frame canvas {
  cursor: crosshair;
  display: block;
  max-width: 100%;
}

.list {
  border: 1px solid #eaecf0;
  border-radius: 6px;
  max-height: 460px;
  overflow: auto;
}

.item {
  align-items: center;
  border-top: 1px solid #eaecf0;
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 11px 12px;
}
.item:first-child { border-top: 0; }
.item small { color: #667085; display: block; margin-top: 3px; }

.form {
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(3, 1fr);
}

.auto-reloc-form {
  background: #f8fafc;
  border: 1px solid #eaecf0;
  border-radius: 6px;
  grid-template-columns: minmax(180px, 1.5fr) repeat(3, minmax(120px, 1fr));
  margin: 12px 0;
  padding: 12px;
}

.form.single { display: block; margin-bottom: 12px; }
.form label { color: #344054; font-size: 13px; }
.form input, .form textarea { margin-top: 6px; }
.wide { grid-column: span 3; }
.checkbox { align-items: center; display: flex; gap: 8px; }
.checkbox input { min-height: auto; width: auto; }

.toast {
  background: rgba(15, 23, 42, .92);
  border-radius: 6px;
  bottom: 24px;
  color: #fff;
  left: 50%;
  opacity: 0;
  padding: 10px 14px;
  position: fixed;
  transform: translateX(-50%);
  transition: opacity .16s ease;
}
.toast.show { opacity: 1; }

@media (max-width: 980px) {
  .topbar, .layout, .map-workspace { display: block; }
  .actions, .split-actions { margin-top: 14px; }
  .panel { margin: 14px; }
  .robot-config { grid-template-columns: 1fr; }
  .map-switcher { grid-template-columns: 1fr; margin-top: 12px; }
  .map-panel, .editor-panel { grid-column: auto; }
  .form, .status-grid { grid-template-columns: 1fr; }
  .auto-reloc-form { grid-template-columns: 1fr; }
  .wide { grid-column: auto; }
}
