:root {
  color-scheme: light;
  --ink: #151a18;
  --muted: #69746f;
  --soft: #eef3ef;
  --panel: #ffffff;
  --line: #dde5df;
  --accent: #3c6df0;
  --green: #8fbf26;
  --amber: #f0a528;
  --red: #e35b4f;
  --forefoot: #12a594;
  --heel: #3c6df0;
  --ankle: #f0a528;
  --shadow: 0 24px 70px rgba(26, 38, 35, 0.18);
  font-family:
    Inter, "HarmonyOS Sans SC", "Microsoft YaHei", "PingFang SC", system-ui,
    -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  min-height: 100vh;
  margin: 0;
  color: var(--ink);
  background:
    linear-gradient(120deg, rgba(18, 165, 148, 0.12), transparent 36%),
    linear-gradient(230deg, rgba(240, 165, 40, 0.14), transparent 42%),
    #f5f7f3;
}

button,
input {
  font: inherit;
}

button {
  cursor: pointer;
}

.icon-sprite {
  position: absolute;
  width: 0;
  height: 0;
  overflow: hidden;
}

.icon {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.9;
}

.stage {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 28px;
}

.phone-frame {
  width: min(430px, 100%);
  padding: 12px;
  border-radius: 36px;
  background: #1b211f;
  box-shadow: var(--shadow);
}

.phone {
  height: min(900px, calc(100vh - 56px));
  min-height: 760px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 28px;
  background: var(--soft);
  display: grid;
  grid-template-rows: auto 1fr auto;
}

.status-bar {
  height: 38px;
  padding: 10px 22px 4px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 12px;
  font-weight: 800;
  color: #26302c;
}

.status-icons {
  display: flex;
  align-items: center;
  gap: 8px;
}

.status-icons .icon {
  width: 22px;
  height: 22px;
}

.app-screen {
  overflow-y: auto;
  padding: 8px 18px 18px;
  scrollbar-width: none;
}

.app-screen::-webkit-scrollbar {
  display: none;
}

.screen {
  display: none;
}

.screen.is-active {
  display: block;
}

.top-panel,
.device-header,
.section-bar,
.zone-summary,
.manual-controls,
.safety-panel {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

.top-panel {
  margin-bottom: 12px;
}

.page-pill {
  min-width: 76px;
  padding: 8px 10px;
  border-radius: 8px;
  color: var(--accent);
  background: rgba(255, 255, 255, 0.9);
  border: 1px solid var(--line);
  font-size: 12px;
  font-weight: 900;
  text-align: center;
}

.eyebrow {
  display: flex;
  align-items: center;
  gap: 7px;
  margin: 0 0 4px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0;
}

.live-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 0 4px rgba(143, 191, 38, 0.16);
}

h1,
h2,
p {
  margin: 0;
}

h1 {
  font-size: 27px;
  line-height: 1.1;
  letter-spacing: 0;
}

h2 {
  font-size: 16px;
  line-height: 1.2;
  letter-spacing: 0;
}

.icon-button,
.round-control {
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  width: 44px;
  height: 44px;
  border: 1px solid var(--line);
  border-radius: 50%;
  color: #27302d;
  background: var(--panel);
}

.device-panel,
.tension-panel,
.mode-panel,
.manual-panel,
.feedback-panel,
.safety-panel,
.mode-hero-panel,
.strategy-panel,
.data-panel,
.settings-device,
.settings-panel,
.calibration-panel {
  margin-top: 12px;
  padding: 14px;
  border: 1px solid rgba(151, 169, 160, 0.34);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.88);
}

.device-panel {
  padding-bottom: 10px;
}

.device-header h2 {
  margin-bottom: 3px;
}

.device-header p {
  color: var(--muted);
  font-size: 12px;
  font-weight: 650;
}

.connection-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  min-width: 84px;
  justify-content: center;
  padding: 7px 9px;
  border-radius: 8px;
  color: #0c756b;
  background: rgba(18, 165, 148, 0.12);
  font-size: 12px;
  font-weight: 850;
}

.connection-pill .icon {
  width: 16px;
  height: 16px;
}

.shoe-visual {
  position: relative;
  height: 190px;
  margin-top: 8px;
  overflow: hidden;
  border-radius: 8px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0) 0%, rgba(238, 243, 239, 0.9) 100%),
    #f8faf7;
}

.shoe-render {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: contain;
  padding: 8px;
  filter: saturate(1.04) contrast(1.02);
}

.shoe-map {
  width: 100%;
  height: 100%;
  display: none;
}

.shoe-shadow {
  fill: rgba(44, 52, 49, 0.15);
}

.shoe-sole {
  fill: #f5aa72;
  stroke: #7e8781;
  stroke-width: 3;
}

.shoe-body {
  fill: #eef1ee;
  stroke: #7e8781;
  stroke-width: 3;
}

.shoe-collar {
  fill: #545d58;
  stroke: #3c4541;
  stroke-width: 3;
}

.shoe-tongue {
  fill: #cfd5d1;
  stroke: #7e8781;
  stroke-width: 3;
}

.zone {
  opacity: 0.46;
  stroke: rgba(47, 56, 52, 0.16);
  stroke-width: 2;
  transition: opacity 220ms ease, filter 220ms ease;
}

.zone-forefoot {
  fill: var(--forefoot);
}

.zone-heel {
  fill: var(--heel);
}

.zone-ankle {
  fill: var(--ankle);
}

.lace {
  fill: none;
  stroke: rgba(94, 105, 99, 0.5);
  stroke-linecap: round;
  stroke-width: 4;
}

.rotary-node {
  fill: #d7ddd9;
  stroke: #3d4642;
  stroke-width: 3;
  transition: fill 220ms ease, stroke 220ms ease, filter 220ms ease;
}

.rotary-node path {
  fill: none;
  stroke: currentColor;
  color: rgba(255, 255, 255, 0.9);
  stroke-width: 3;
}

.shoe-label line {
  stroke: #4b5651;
  stroke-width: 2;
}

.shoe-label rect {
  fill: rgba(255, 255, 255, 0.88);
  stroke: rgba(126, 135, 129, 0.42);
}

.shoe-label text {
  fill: #202725;
  font-size: 15px;
  font-weight: 900;
  text-anchor: middle;
}

.shoe-visual[data-active-zone="forefoot"] [data-zone-shape="forefoot"],
.shoe-visual[data-active-zone="heel"] [data-zone-shape="heel"],
.shoe-visual[data-active-zone="ankle"] [data-zone-shape="ankle"] {
  opacity: 0.74;
  filter: drop-shadow(0 8px 9px rgba(25, 34, 31, 0.14));
}

.shoe-visual[data-active-zone="forefoot"] [data-zone-node="forefoot"],
.shoe-visual[data-active-zone="heel"] [data-zone-node="heel"],
.shoe-visual[data-active-zone="ankle"] [data-zone-node="ankle"] {
  fill: var(--accent);
  stroke: #202725;
  filter: drop-shadow(0 6px 8px rgba(25, 34, 31, 0.22));
}

.zone-hotspots {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.zone-hotspot {
  position: absolute;
  width: 13px;
  height: 13px;
  border: 2px solid #fff;
  border-radius: 50%;
  background: rgba(32, 39, 37, 0.72);
  box-shadow: 0 4px 10px rgba(25, 34, 31, 0.24);
  transform: translate(-50%, -50%);
  transition:
    background 180ms ease,
    box-shadow 180ms ease,
    transform 180ms ease;
}

.zone-hotspot b {
  position: absolute;
  left: 50%;
  bottom: calc(100% + 6px);
  min-width: 42px;
  padding: 4px 6px;
  border-radius: 8px;
  color: #202725;
  background: rgba(255, 255, 255, 0.88);
  font-size: 11px;
  font-weight: 900;
  text-align: center;
  transform: translateX(-50%);
  opacity: 0;
  transition: opacity 180ms ease;
}

.zone-hotspot-forefoot {
  left: 34%;
  top: 67%;
}

.zone-hotspot-heel {
  left: 54%;
  top: 63%;
}

.zone-hotspot-ankle {
  left: 73%;
  top: 39%;
}

.shoe-visual[data-active-zone="forefoot"] [data-zone-hotspot="forefoot"],
.shoe-visual[data-active-zone="heel"] [data-zone-hotspot="heel"],
.shoe-visual[data-active-zone="ankle"] [data-zone-hotspot="ankle"] {
  background: var(--accent);
  box-shadow:
    0 0 0 6px color-mix(in srgb, var(--accent) 22%, transparent),
    0 8px 18px rgba(25, 34, 31, 0.3);
  transform: translate(-50%, -50%) scale(1.35);
}

.shoe-visual[data-active-zone="forefoot"] [data-zone-hotspot="forefoot"] b,
.shoe-visual[data-active-zone="heel"] [data-zone-hotspot="heel"] b,
.shoe-visual[data-active-zone="ankle"] [data-zone-hotspot="ankle"] b {
  opacity: 1;
}

.motor-badge {
  position: absolute;
  right: 12px;
  bottom: 12px;
  min-width: 108px;
  padding: 9px 10px;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.9);
  background: rgba(255, 255, 255, 0.9);
  box-shadow: 0 10px 26px rgba(26, 38, 35, 0.11);
}

.motor-badge span {
  display: block;
  color: var(--muted);
  font-size: 10px;
  font-weight: 850;
}

.motor-badge strong {
  display: block;
  margin-top: 2px;
  color: var(--accent);
  font-size: 14px;
}

.metrics-strip {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-top: 10px;
}

.metrics-strip div {
  min-height: 58px;
  padding: 10px;
  border-radius: 8px;
  background: #202725;
  color: #fff;
}

.metrics-strip span,
.toggle-row small {
  display: block;
  color: rgba(255, 255, 255, 0.66);
  font-size: 11px;
  font-weight: 750;
}

.metrics-strip strong {
  display: block;
  margin-top: 4px;
  font-size: 19px;
}

.section-bar {
  align-items: flex-start;
}

.section-bar > strong,
.section-bar > span {
  max-width: 138px;
  text-align: right;
  color: var(--accent);
  font-size: 12px;
  font-weight: 850;
  line-height: 1.35;
}

.zone-summary {
  align-items: stretch;
  margin-top: 14px;
}

.average-dial {
  --progress: 61;
  width: 118px;
  height: 118px;
  flex: 0 0 118px;
  display: grid;
  place-items: center;
  align-self: center;
  border-radius: 50%;
  background:
    radial-gradient(circle at center, #fff 0 53%, transparent 54%),
    conic-gradient(var(--accent) calc(var(--progress) * 1%), #dfe8e2 0);
  box-shadow: inset 0 0 0 11px rgba(255, 255, 255, 0.92);
}

.dial-core {
  width: 78px;
  height: 78px;
  display: grid;
  place-content: center;
  border-radius: 50%;
  background: #202725;
  color: #fff;
  text-align: center;
}

.dial-core span {
  font-size: 30px;
  font-weight: 900;
  line-height: 0.95;
}

.dial-core small {
  color: rgba(255, 255, 255, 0.7);
  font-size: 11px;
  font-weight: 800;
}

.zone-readings {
  flex: 1;
  display: grid;
  gap: 8px;
}

.zone-card {
  display: grid;
  grid-template-columns: 42px 62px 42px;
  align-items: center;
  gap: 8px;
  min-height: 50px;
  padding: 9px;
  border: 1px solid transparent;
  border-radius: 8px;
  color: #fff;
  text-align: left;
  background: #26302c;
}

.zone-card span,
.zone-card small {
  color: rgba(255, 255, 255, 0.66);
  font-size: 11px;
  font-weight: 750;
}

.zone-card strong {
  display: block;
  font-size: 20px;
  line-height: 1;
}

.zone-card b {
  font-weight: 900;
}

.zone-card i {
  grid-column: 1 / -1;
  display: block;
  height: 7px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.16);
}

.zone-card em {
  display: block;
  width: 60%;
  height: 100%;
  border-radius: inherit;
  background: var(--green);
  transition: width 260ms ease;
}

.zone-card.is-active {
  border-color: var(--accent);
  box-shadow: inset 4px 0 0 var(--accent);
}

.mode-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin-top: 12px;
}

.mode-card {
  min-height: 72px;
  display: grid;
  place-items: center;
  gap: 6px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: #3d4844;
  background: #f8faf8;
  font-size: 12px;
  font-weight: 850;
  transition:
    transform 180ms ease,
    border-color 180ms ease,
    background 180ms ease,
    color 180ms ease;
}

.mode-card .icon {
  width: 22px;
  height: 22px;
}

.mode-card.is-active {
  color: #fff;
  border-color: transparent;
  background: var(--active-color, var(--accent));
  transform: translateY(-1px);
}

.mode-grid-wide {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.mode-hero-panel {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 132px;
  align-items: stretch;
  gap: 12px;
  background: #202725;
  color: #fff;
}

.mode-hero-copy h2 {
  margin-bottom: 8px;
  font-size: 24px;
}

.mode-hero-copy p:last-child {
  color: rgba(255, 255, 255, 0.68);
  font-size: 13px;
  font-weight: 750;
  line-height: 1.45;
}

.mode-mini-bars {
  display: grid;
  gap: 8px;
}

.mode-mini-bars span {
  position: relative;
  min-height: 38px;
  overflow: hidden;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.1);
}

.mode-mini-bars span::before {
  content: "";
  position: absolute;
  inset: auto 0 0;
  width: calc(var(--bar) * 1%);
  height: 5px;
  border-radius: 999px;
  background: var(--green);
}

.mode-mini-bars b,
.mode-mini-bars i {
  position: relative;
  z-index: 1;
  display: block;
  padding-inline: 9px;
  font-style: normal;
  font-size: 11px;
  font-weight: 850;
}

.mode-mini-bars b {
  padding-top: 7px;
  color: rgba(255, 255, 255, 0.62);
}

.mode-mini-bars i {
  padding-top: 1px;
  color: #fff;
}

.strategy-list,
.analysis-list,
.event-list {
  display: grid;
  gap: 8px;
  margin-top: 12px;
}

.strategy-list article,
.analysis-list article,
.event-list article {
  border-radius: 8px;
  background: #f7faf7;
  border: 1px solid var(--line);
}

.strategy-list article {
  padding: 12px;
}

.strategy-list span,
.analysis-list span,
.event-list time {
  color: var(--muted);
  font-size: 11px;
  font-weight: 850;
}

.strategy-list strong {
  display: block;
  margin-top: 4px;
  font-size: 15px;
}

.strategy-list p {
  margin-top: 5px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 650;
  line-height: 1.45;
}

.zone-tabs {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-top: 12px;
}

.zone-tabs button {
  min-height: 38px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: #4e5a55;
  background: #f8faf8;
  font-size: 13px;
  font-weight: 850;
}

.zone-tabs button.is-active {
  color: #fff;
  border-color: transparent;
  background: var(--accent);
}

.manual-controls {
  margin-top: 14px;
}

.manual-controls input[type="range"] {
  width: 100%;
  accent-color: var(--accent);
}

.feedback-panel {
  padding-bottom: 15px;
}

.chart {
  height: 104px;
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  align-items: end;
  gap: 6px;
  margin-top: 14px;
}

.chart span {
  height: calc(var(--h) * 1%);
  min-height: 14px;
  border-radius: 6px 6px 2px 2px;
  background: linear-gradient(180deg, var(--accent), #9bc53d);
  transition: height 300ms ease;
}

.data-summary-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin-top: 12px;
}

.data-summary-grid div {
  min-height: 74px;
  padding: 12px;
  border-radius: 8px;
  color: #fff;
  background: #202725;
}

.data-summary-grid span {
  display: block;
  color: rgba(255, 255, 255, 0.62);
  font-size: 11px;
  font-weight: 850;
}

.data-summary-grid strong {
  display: block;
  margin-top: 8px;
  font-size: 22px;
}

.history-chart {
  height: 154px;
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  align-items: end;
  gap: 8px;
  margin-top: 14px;
  padding-top: 12px;
}

.history-chart span {
  position: relative;
  height: calc(var(--h) * 1%);
  min-height: 34px;
  border-radius: 8px 8px 4px 4px;
  background: linear-gradient(180deg, var(--accent), #9bc53d);
}

.history-chart b {
  position: absolute;
  left: 50%;
  bottom: -21px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 850;
  transform: translateX(-50%);
}

.analysis-list article {
  display: grid;
  grid-template-columns: 52px 82px 1fr;
  align-items: center;
  gap: 10px;
  padding: 11px;
}

.analysis-list strong {
  font-size: 13px;
}

.analysis-list i {
  height: 7px;
  overflow: hidden;
  border-radius: 999px;
  background: #dce5df;
}

.analysis-list em {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: var(--accent);
}

.event-list article {
  display: grid;
  grid-template-columns: 48px 1fr;
  align-items: center;
  gap: 10px;
  padding: 11px;
}

.event-list span {
  color: #303a36;
  font-size: 12px;
  font-weight: 700;
  line-height: 1.4;
}

.settings-device {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  color: #fff;
  background: #202725;
}

.settings-device h2 {
  margin-bottom: 5px;
}

.settings-device span {
  color: rgba(255, 255, 255, 0.62);
  font-size: 12px;
  font-weight: 750;
}

.settings-device > strong {
  font-size: 28px;
}

.settings-panel {
  display: grid;
  gap: 8px;
}

.settings-panel .toggle-row {
  flex: none;
  width: 100%;
  min-height: 62px;
}

.settings-panel.compact {
  gap: 0;
  padding: 0;
  overflow: hidden;
}

.calibration-actions {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-top: 12px;
}

.calibration-actions button,
.utility-row {
  min-height: 44px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: #303a36;
  background: #f8faf8;
  font-size: 12px;
  font-weight: 850;
}

.calibration-actions button.is-done {
  color: #fff;
  border-color: transparent;
  background: var(--accent);
}

.utility-row {
  width: 100%;
  min-height: 54px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 14px;
  border: 0;
  border-bottom: 1px solid var(--line);
  border-radius: 0;
  text-align: left;
}

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

.utility-row span {
  font-weight: 850;
}

.utility-row strong {
  color: var(--muted);
  font-size: 12px;
}

.utility-row.danger span,
.utility-row.danger strong {
  color: var(--red);
}

.safety-panel {
  flex-wrap: wrap;
  align-items: stretch;
}

.toggle-row {
  position: relative;
  min-height: 58px;
  flex: 1 1 146px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 11px;
  border-radius: 8px;
  background: #f7faf7;
  border: 1px solid var(--line);
}

.toggle-row strong {
  display: block;
  font-size: 13px;
}

.toggle-row small {
  margin-top: 3px;
  color: var(--muted);
}

.toggle-row input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.toggle-row i {
  position: relative;
  width: 42px;
  height: 24px;
  flex: 0 0 auto;
  border-radius: 999px;
  background: #cbd7d0;
  transition: background 180ms ease;
}

.toggle-row i::after {
  content: "";
  position: absolute;
  top: 3px;
  left: 3px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 2px 5px rgba(20, 28, 25, 0.18);
  transition: transform 180ms ease;
}

.toggle-row input:checked + i {
  background: var(--accent);
}

.toggle-row input:checked + i::after {
  transform: translateX(18px);
}

.release-button {
  min-height: 58px;
  flex: 1 1 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 0;
  border-radius: 8px;
  color: #1d281f;
  background: #dceebb;
  font-weight: 900;
}

.bottom-nav {
  height: 72px;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 4px;
  padding: 8px 14px 12px;
  border-top: 1px solid rgba(151, 169, 160, 0.3);
  background: rgba(255, 255, 255, 0.88);
}

.bottom-nav button {
  display: grid;
  place-items: center;
  gap: 2px;
  border: 0;
  color: var(--muted);
  background: transparent;
  font-size: 11px;
  font-weight: 850;
}

.bottom-nav button.is-active {
  color: var(--accent);
}

.bottom-nav .icon {
  width: 21px;
  height: 21px;
}

@media (max-width: 520px) {
  .stage {
    padding: 0;
    background: var(--soft);
  }

  .phone-frame {
    width: 100%;
    min-height: 100vh;
    padding: 0;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
  }

  .phone {
    height: 100vh;
    min-height: 100vh;
    border: 0;
    border-radius: 0;
  }
}

@media (max-width: 370px) {
  .app-screen {
    padding-inline: 12px;
  }

  .shoe-visual {
    height: 178px;
  }

  .zone-summary {
    align-items: stretch;
    flex-direction: column;
  }

  .average-dial {
    margin-inline: auto;
  }

  .mode-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
