:root {
  color-scheme: light dark;
  --page: #ffffff;
  --surface: #ffffff;
  --ink: #181b25;
  --muted-ink: #6d777e;
  --border: #e2e5e9;
  --soft: #f0f1f4;
  --soft-ink: #606970;
  --active: #181b25;
  --active-ink: #ffffff;
  --focus: #5c7649;
  --chuzi: #b8ec92;
  --chuzi-ink: #16171d;
  --hero: #16171d;
  --hero-ink: #f5f6f8;
  --motion-fast: 160ms;
  --ease-chuzi: cubic-bezier(0.22, 1, 0.36, 1);
}

:root.dark {
  --page: #181b25;
  --surface: #181b25;
  --ink: #ebebeb;
  --muted-ink: #858d94;
  --border: #2b303b;
  --soft: #262b36;
  --soft-ink: #9199a1;
  --active: #ffffff;
  --active-ink: #181b25;
  --focus: #b8ec92;
  --hero: #111218;
  --hero-ink: #f5f6f8;
}

* {
  box-sizing: border-box;
}

html {
  min-width: 320px;
  min-height: 100%;
  background: var(--page);
  -webkit-text-size-adjust: 100%;
}

body {
  min-height: 100%;
  margin: 0;
  overflow-x: hidden;
  background: var(--page);
  color: var(--ink);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont,
    "Segoe UI", sans-serif;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
}

button,
a,
summary {
  font: inherit;
}

button,
a {
  touch-action: manipulation;
}

a {
  color: inherit;
}

:where(button, a[href], summary):focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 3px;
}

.download-layout {
  min-height: 100dvh;
  background: var(--page);
}

.download-hero {
  display: flex;
  min-height: 208px;
  align-items: center;
  justify-content: center;
  padding: max(28px, env(safe-area-inset-top)) 24px 28px;
  border-radius: 0 0 40px 40px;
  background: var(--hero);
  color: var(--hero-ink);
}

.download-hero__inner {
  width: min(244px, 76vw);
  text-align: center;
}

.download-hero__art {
  display: block;
  width: 100%;
  aspect-ratio: 708 / 372;
  background: var(--chuzi);
  -webkit-mask: url("/brand/megachuzi.svg") center / contain no-repeat;
  mask: url("/brand/megachuzi.svg") center / contain no-repeat;
}

.download-content {
  background: var(--surface);
}

.download-content__inner {
  width: min(100%, 560px);
  margin: 0 auto;
  padding: 28px 20px max(28px, env(safe-area-inset-bottom));
}

.download-heading h1 {
  margin: 0;
  color: var(--ink);
  font-size: 30px;
  font-weight: 760;
  letter-spacing: -0.025em;
  line-height: 1.12;
  text-wrap: balance;
}

.platform-switch {
  display: flex;
  gap: 4px;
  margin-top: 24px;
  padding: 4px;
  border-radius: 14px;
  background: var(--soft);
}

.platform-switch button {
  min-width: 0;
  min-height: 48px;
  flex: 1;
  border: 0;
  border-radius: 11px;
  background: transparent;
  color: var(--soft-ink);
  cursor: pointer;
  font-size: 14px;
  font-weight: 650;
  transition:
    background-color var(--motion-fast) var(--ease-chuzi),
    color var(--motion-fast) var(--ease-chuzi),
    transform var(--motion-fast) var(--ease-chuzi);
}

.platform-switch button[aria-selected="true"] {
  background: var(--active);
  color: var(--active-ink);
}

.platform-switch button:active {
  transform: scale(0.985);
}

[data-platform-panel] {
  display: none;
}

html[data-platform="android"] [data-platform-panel="android"],
html[data-platform="ios"] [data-platform-panel="ios"] {
  display: block;
}

[data-platform-panel][hidden] {
  display: none !important;
}

.install-panel {
  padding-top: 26px;
}

.release-row {
  display: flex;
  align-items: center;
  gap: 14px;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--border);
}

.release-row img {
  width: 56px;
  height: 56px;
  flex: none;
  border-radius: 14px;
}

.release-row h2,
.install-panel__heading h2 {
  margin: 0;
  color: var(--ink);
  font-size: 20px;
  font-weight: 720;
  letter-spacing: -0.015em;
  line-height: 1.2;
  text-wrap: balance;
}

.release-row p,
.install-panel__heading p {
  margin: 5px 0 0;
  color: var(--muted-ink);
  font-size: 14px;
  line-height: 1.45;
  text-wrap: pretty;
}

.primary-action {
  display: flex;
  width: 100%;
  min-height: 56px;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin-top: 22px;
  border-radius: 16px;
  background: var(--chuzi);
  color: var(--chuzi-ink);
  font-size: 16px;
  font-weight: 720;
  line-height: 1.2;
  text-decoration: none;
  transition:
    filter var(--motion-fast) var(--ease-chuzi),
    transform var(--motion-fast) var(--ease-chuzi);
}

.primary-action svg {
  width: 20px;
  height: 20px;
  flex: none;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2;
}

.primary-action small {
  color: rgb(22 23 29 / 66%);
  font-size: 12px;
  font-weight: 650;
}

.primary-action:active {
  transform: scale(0.988);
}

.action-note {
  margin: 12px 0 0;
  color: var(--muted-ink);
  font-size: 13px;
  line-height: 1.5;
  text-align: center;
  text-wrap: pretty;
}

.install-help {
  margin-top: 22px;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}

.install-help summary {
  display: flex;
  min-height: 52px;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  color: var(--ink);
  cursor: pointer;
  font-size: 14px;
  font-weight: 620;
  list-style: none;
}

.install-help summary::-webkit-details-marker {
  display: none;
}

.install-help summary::after {
  width: 8px;
  height: 8px;
  flex: none;
  border-right: 1.5px solid currentColor;
  border-bottom: 1.5px solid currentColor;
  content: "";
  transform: rotate(45deg) translateY(-2px);
  transition: transform var(--motion-fast) var(--ease-chuzi);
}

.install-help[open] summary::after {
  transform: rotate(225deg) translate(-2px, -2px);
}

.install-help p {
  max-width: 68ch;
  margin: -2px 0 16px;
  color: var(--muted-ink);
  font-size: 13px;
  line-height: 1.55;
  text-wrap: pretty;
}

.install-panel__heading {
  padding-bottom: 20px;
  border-bottom: 1px solid var(--border);
}

.install-steps {
  display: grid;
  gap: 18px;
  margin: 22px 0 0;
  padding: 0;
  list-style: none;
}

.install-steps li {
  display: grid;
  grid-template-columns: 36px minmax(0, 1fr);
  align-items: start;
  gap: 12px;
}

.install-steps li > span {
  display: flex;
  width: 36px;
  height: 36px;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: var(--chuzi);
  color: var(--chuzi-ink);
  font-size: 13px;
  font-weight: 750;
}

.install-steps p {
  margin: 6px 0 0;
  color: var(--ink);
  font-size: 15px;
  line-height: 1.5;
  text-wrap: pretty;
}

.browser-note {
  margin: 18px 0 0;
  padding: 14px 15px;
  border-radius: 12px;
  background: var(--soft);
  color: var(--soft-ink);
  font-size: 13px;
  line-height: 1.55;
  text-wrap: pretty;
}

.browser-note strong {
  color: var(--ink);
  font-weight: 650;
}

.download-footer {
  margin-top: 30px;
  padding-top: 18px;
  border-top: 1px solid var(--border);
  color: var(--muted-ink);
  font-size: 12px;
  line-height: 1.4;
  text-align: center;
}

@media (hover: hover) {
  .platform-switch button:not([aria-selected="true"]):hover {
    color: var(--ink);
  }

  .primary-action:hover {
    filter: brightness(0.96);
  }
}

@media (min-width: 760px) {
  .download-layout {
    display: grid;
    grid-template-columns: minmax(300px, 42%) minmax(460px, 1fr);
  }

  .download-hero {
    position: sticky;
    top: 0;
    min-height: 100dvh;
    align-self: start;
    border-radius: 0;
    padding: 48px;
  }

  .download-hero__inner {
    width: min(300px, 78%);
  }

  .download-content {
    display: flex;
    min-height: 100dvh;
    align-items: center;
  }

  .download-content__inner {
    padding: 52px 44px;
  }

  .download-heading h1 {
    font-size: 34px;
  }
}

@media (max-width: 359px) {
  .download-content__inner {
    padding-right: 16px;
    padding-left: 16px;
  }

  .download-heading h1 {
    font-size: 28px;
  }

  .platform-switch button {
    font-size: 13px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
  }
}

@media (forced-colors: active) {
  .download-hero__art {
    background: LinkText;
  }

  .platform-switch button[aria-selected="true"],
  .primary-action,
  .install-steps li > span {
    border: 1px solid ButtonText;
    background: Highlight;
    color: HighlightText;
  }
}
