:root {
  color-scheme: light;
  font-family:
    -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
    "Microsoft YaHei", sans-serif;
  color: #182522;
  background: #e6ecea;
  font-synthesis: none;
}

* {
  box-sizing: border-box;
}

html,
body {
  min-height: 100%;
  margin: 0;
}

body {
  letter-spacing: 0;
}

button {
  font: inherit;
  letter-spacing: 0;
  cursor: pointer;
}

.app-shell {
  position: relative;
  width: min(100%, 430px);
  min-height: 100vh;
  margin: 0 auto;
  overflow: hidden;
  background: #f4f7f6;
  box-shadow: 0 0 28px rgba(29, 49, 44, 0.14);
}

.topbar {
  position: sticky;
  z-index: 50;
  top: 0;
  display: grid;
  grid-template-columns: 44px 1fr 52px;
  align-items: center;
  height: 56px;
  padding: env(safe-area-inset-top) 14px 0;
  background: rgba(244, 247, 246, 0.96);
  border-bottom: 1px solid #dde5e2;
}

.topbar h1 {
  margin: 0;
  font-size: 17px;
  text-align: center;
}

.icon-button {
  width: 36px;
  height: 36px;
  padding: 0;
  color: #17231f;
  font-size: 34px;
  line-height: 29px;
  background: transparent;
  border: 0;
}

.icon-button.hidden {
  visibility: hidden;
}

.demo-badge {
  justify-self: end;
  padding: 5px 7px;
  color: #6a5520;
  font-size: 11px;
  background: #fff0c9;
  border-radius: 5px;
}

.screen {
  display: none;
  min-height: calc(100vh - 56px);
  padding: 18px 16px 28px;
}

.screen.active {
  display: block;
}

.brand-panel {
  display: grid;
  grid-template-columns: 178px 1px 1fr;
  align-items: center;
  gap: 11px;
  min-height: 64px;
  margin-bottom: 15px;
  padding: 10px;
  background: #fff;
  border: 1px solid #dce3e1;
  border-radius: 8px;
}

.brand-panel img {
  display: block;
  width: 178px;
  height: auto;
}

.brand-panel > span {
  width: 1px;
  height: 34px;
  background: #d7dfdc;
}

.brand-panel > div {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.brand-panel strong {
  margin-bottom: 3px;
  color: #1555b6;
  font-size: 15px;
  white-space: nowrap;
}

.brand-panel small {
  color: #75807d;
  font-size: 9px;
  white-space: nowrap;
}

.device-header,
.status-row,
.task-heading,
.section-heading,
.setting-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.eyebrow,
.task-heading p {
  margin: 0 0 4px;
  color: #73807c;
  font-size: 12px;
}

.device-header h2,
.status-row h2,
.task-heading h2 {
  margin: 0;
  font-size: 23px;
}

.online {
  display: flex;
  align-items: center;
  padding: 8px 10px;
  color: #176f5f;
  font-size: 13px;
  background: #e2f4ed;
  border-radius: 6px;
}

.online i {
  width: 7px;
  height: 7px;
  margin-right: 7px;
  border-radius: 50%;
  background: #2cae78;
  box-shadow: 0 0 0 4px rgba(44, 174, 120, 0.12);
}

.metrics {
  display: grid;
  margin-top: 18px;
  padding: 14px 4px;
  background: #fff;
  border: 1px solid #dce3e1;
  border-radius: 8px;
}

.metrics.four {
  grid-template-columns: repeat(4, 1fr);
}

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

.metrics > div {
  display: flex;
  flex-direction: column;
  align-items: center;
  min-width: 0;
  border-right: 1px solid #e1e7e5;
}

.metrics > div:last-child {
  border-right: 0;
}

.metrics strong {
  margin-bottom: 5px;
  font-size: 16px;
  white-space: nowrap;
}

.metrics .safe {
  color: #187f63;
  font-size: 14px;
}

.metrics span {
  color: #7b8582;
  font-size: 10px;
  white-space: nowrap;
}

.section-heading {
  margin: 22px 0 11px;
}

.section-heading h3,
.remote-panel h3 {
  margin: 0;
  font-size: 16px;
}

.section-heading span {
  color: #6e7b78;
  font-size: 12px;
}

.map-board {
  position: relative;
  width: 100%;
  height: 390px;
  overflow: hidden;
  touch-action: none;
  background-color: #eaf0ef;
  background-image:
    linear-gradient(rgba(34, 60, 56, 0.055) 1px, transparent 1px),
    linear-gradient(90deg, rgba(34, 60, 56, 0.055) 1px, transparent 1px);
  background-size: 22px 22px;
  border: 1px solid #cbd6d3;
  border-radius: 8px;
}

.wall {
  position: absolute;
  z-index: 2;
  background: #263532;
  border-radius: 1px;
}

.robot {
  position: absolute;
  z-index: 8;
  width: 20px;
  height: 20px;
  margin: -10px 0 0 -10px;
  border: 3px solid #fff;
  border-radius: 50%;
  background: #167d70;
  box-shadow: 0 2px 7px rgba(17, 43, 38, 0.26);
}

.robot::after {
  position: absolute;
  top: 2px;
  left: 6px;
  width: 3px;
  height: 6px;
  content: "";
  border-radius: 2px;
  background: #f4bf4f;
}

.home-robot,
.plan-robot {
  top: 74%;
  left: 68%;
}

.work-area {
  position: absolute;
  z-index: 3;
  border: 2px dashed rgba(217, 155, 36, 0.75);
  background: rgba(242, 184, 75, 0.09);
}

.home-area,
.task-area {
  top: 36%;
  left: 28%;
  width: 42%;
  height: 38%;
}

.route-line {
  position: absolute;
  z-index: 5;
  height: 3px;
  transform-origin: left center;
  background: #e0a12a;
  border-radius: 2px;
}

.route-loop {
  position: absolute;
  z-index: 5;
  border: 3px solid #e0a12a;
}

.legend {
  position: absolute;
  z-index: 20;
  right: 10px;
  bottom: 10px;
  display: flex;
  gap: 10px;
  padding: 7px 9px;
  color: #52605c;
  font-size: 10px;
  background: rgba(255, 255, 255, 0.92);
  border-radius: 5px;
}

.legend.text {
  flex-direction: column;
  gap: 3px;
}

.legend i {
  display: inline-block;
  width: 7px;
  height: 7px;
  margin-right: 4px;
  border-radius: 2px;
}

.legend .black {
  background: #263532;
}

.legend .yellow {
  background: #e0a12a;
}

.legend .green {
  background: #167d70;
}

.plan-summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 14px;
  padding: 14px;
  background: #fff;
  border-left: 4px solid #efb43c;
  border-radius: 6px;
}

.plan-summary div {
  display: flex;
  flex-direction: column;
}

.plan-summary span {
  margin-bottom: 3px;
  color: #788480;
  font-size: 11px;
}

.plan-summary strong {
  font-size: 15px;
}

.plan-summary b {
  padding: 6px 8px;
  color: #805a13;
  font-size: 11px;
  background: #fff3d7;
  border-radius: 5px;
}

.action-grid,
.bottom-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-top: 14px;
}

.action-grid .full {
  grid-column: 1 / -1;
}

.primary,
.secondary,
.danger {
  min-height: 48px;
  font-weight: 650;
  border-radius: 7px;
}

.primary {
  color: #fff;
  background: #167d70;
  border: 1px solid #167d70;
}

.secondary {
  color: #182522;
  background: #fff;
  border: 1px solid #cdd7d4;
}

.danger {
  color: #b52f35;
  background: #fff7f7;
  border: 1px solid #edc3c7;
}

button:disabled {
  cursor: default;
  opacity: 0.45;
}

.status-row p {
  margin: 5px 0 0;
  color: #72807c;
  font-size: 12px;
}

.status-row > strong,
.task-heading > strong {
  color: #167d70;
  font-size: 26px;
}

.progress-track {
  height: 7px;
  margin: 14px 0;
  overflow: hidden;
  background: #d9e2df;
  border-radius: 4px;
}

.progress-fill {
  height: 100%;
  background: #167d70;
  transition: width 0.35s ease;
}

.mapping-map {
  height: 380px;
}

.mapping-robot {
  top: 66%;
  left: 35%;
  transition: top 0.3s ease, left 0.3s ease;
}

.scan-ring {
  position: absolute;
  z-index: 4;
  top: 66%;
  left: 35%;
  width: 84px;
  height: 84px;
  margin: -42px 0 0 -42px;
  border: 2px solid rgba(22, 125, 112, 0.36);
  border-radius: 50%;
  animation: scan 1.7s ease-out infinite;
}

.remote-panel {
  margin-top: 14px;
  padding: 14px;
  background: #fff;
  border: 1px solid #dce3e1;
  border-radius: 8px;
}

.remote-panel h3 {
  text-align: center;
}

.remote-panel p {
  margin: 10px 0 0;
  color: #86908d;
  font-size: 10px;
  text-align: center;
}

.direction-pad {
  display: grid;
  grid-template-columns: repeat(3, 44px);
  grid-template-rows: repeat(3, 38px);
  justify-content: center;
  gap: 6px;
  margin-top: 12px;
}

.direction-pad button {
  padding: 0;
  color: #30423e;
  background: #edf3f1;
  border: 0;
  border-radius: 6px;
}

.direction-pad button:nth-child(1) {
  grid-column: 2;
}

.direction-pad button:nth-child(2) {
  grid-column: 1;
  grid-row: 2;
}

.direction-pad button:nth-child(3) {
  grid-column: 2;
  grid-row: 2;
}

.direction-pad button:nth-child(4) {
  grid-column: 3;
  grid-row: 2;
}

.direction-pad button:nth-child(5) {
  grid-column: 2;
  grid-row: 3;
}

.direction-pad .stop {
  color: #fff;
  background: #d35b58;
}

.planning-screen {
  padding: 0 0 26px;
}

.planning-intro {
  padding: 17px 16px 14px;
}

.planning-intro h2 {
  margin: 0 0 12px;
  font-size: 15px;
}

.segment-control {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4px;
  padding: 4px;
  background: #e4ebe9;
  border-radius: 7px;
}

.segment-control button {
  height: 38px;
  color: #64716e;
  background: transparent;
  border: 0;
  border-radius: 5px;
}

.segment-control button.active {
  color: #125f55;
  font-weight: 700;
  background: #fff;
  box-shadow: 0 1px 5px rgba(34, 60, 56, 0.08);
}

.plan-map {
  width: calc(100% - 32px);
  height: 420px;
  margin: 0 16px;
}

.selected-area {
  position: absolute;
  z-index: 4;
  top: 37%;
  left: 26%;
  width: 43%;
  height: 35%;
  border: 2px dashed #d99b24;
  background: rgba(242, 184, 75, 0.12);
}

.selected-area i {
  position: absolute;
  width: 13px;
  height: 13px;
  margin: -7px;
  border: 3px solid #fff;
  border-radius: 50%;
  background: #e3a62e;
}

.selected-area i:nth-child(1) {
  top: 0;
  left: 0;
}

.selected-area i:nth-child(2) {
  top: 0;
  right: -13px;
}

.selected-area i:nth-child(3) {
  bottom: -13px;
  left: 0;
}

.selected-area i:nth-child(4) {
  right: -13px;
  bottom: -13px;
}

.map-tip {
  position: absolute;
  z-index: 15;
  top: 10px;
  left: 50%;
  padding: 6px 8px;
  color: #56635f;
  font-size: 10px;
  white-space: nowrap;
  background: rgba(255, 255, 255, 0.92);
  border-radius: 5px;
  transform: translateX(-50%);
}

.settings {
  margin-top: 14px;
  padding: 0 16px;
  background: #fff;
  border-top: 1px solid #dce3e1;
  border-bottom: 1px solid #dce3e1;
}

.setting-row {
  min-height: 74px;
  border-bottom: 1px solid #e4eae8;
}

.setting-row:last-child {
  border-bottom: 0;
}

.setting-row > div:first-child {
  display: flex;
  flex-direction: column;
}

.setting-row > div:first-child strong {
  margin-bottom: 3px;
  font-size: 14px;
}

.setting-row > div:first-child span {
  color: #808a87;
  font-size: 10px;
}

.stepper,
.direction-tabs {
  display: flex;
  height: 38px;
  overflow: hidden;
  border: 1px solid #ced8d5;
  border-radius: 6px;
}

.stepper button,
.direction-tabs button {
  width: 42px;
  padding: 0;
  color: #1d4f47;
  background: #edf3f1;
  border: 0;
}

.stepper b {
  width: 64px;
  font-size: 12px;
  line-height: 36px;
  text-align: center;
}

.direction-tabs button {
  width: 52px;
  color: #64716e;
  background: #fff;
}

.direction-tabs button.active {
  color: #fff;
  background: #167d70;
}

.safe-tag {
  padding: 7px 9px;
  color: #176f5f;
  font-size: 12px;
  background: #e5f4ef;
  border-radius: 5px;
}

.planning-actions {
  padding: 0 16px;
}

.task-map {
  height: 405px;
}

.task-robot {
  top: 41%;
  left: 32%;
  transition: top 0.65s linear, left 0.65s linear;
}

.notice {
  display: flex;
  align-items: center;
  margin-top: 12px;
  padding: 12px;
  color: #44524e;
  font-size: 12px;
  background: #fff7e4;
  border: 1px solid #efd69c;
  border-radius: 7px;
}

.notice i {
  display: flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  width: 19px;
  height: 19px;
  margin-right: 8px;
  color: #fff;
  font-style: normal;
  font-weight: 700;
  border-radius: 50%;
  background: #d3992d;
}

.toast {
  position: fixed;
  z-index: 100;
  bottom: 28px;
  left: 50%;
  visibility: hidden;
  padding: 10px 15px;
  color: #fff;
  font-size: 13px;
  background: rgba(25, 37, 34, 0.9);
  border-radius: 6px;
  opacity: 0;
  transform: translate(-50%, 8px);
  transition: opacity 0.2s ease, transform 0.2s ease;
}

.toast.show {
  visibility: visible;
  opacity: 1;
  transform: translate(-50%, 0);
}

@keyframes scan {
  from {
    opacity: 0.8;
    transform: scale(0.35);
  }
  to {
    opacity: 0;
    transform: scale(1.35);
  }
}

@media (max-width: 360px) {
  .brand-panel {
    grid-template-columns: 160px 1px 1fr;
  }

  .brand-panel img {
    width: 160px;
  }

  .map-board {
    height: 350px;
  }

  .plan-map,
  .task-map {
    height: 370px;
  }

  .metrics span {
    font-size: 9px;
  }
}
