:root {
  color-scheme: dark;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: #f6f7fa;
  background: #0d1114;
  font-synthesis: none;
  -webkit-text-size-adjust: 100%;
  --accent: #6a94ff;
  --secondary: #aab3c2;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-width: 280px;
  min-height: 100vh;
  min-height: 100svh;
  padding: 36px 22px 28px;
  padding-bottom: max(28px, env(safe-area-inset-bottom));
}

.in-app-only { display: none; }
[data-browser="in-app"] .in-app-only { display: block; }
[data-browser="in-app"] .browser-only { display: none; }

.download-page {
  width: 100%;
  max-width: 420px;
  margin: 0 auto;
  text-align: center;
}

.brand .app-icon {
  display: block;
  width: 120px;
  height: 120px;
  margin: 0 auto 15px;
  border: 1px solid #354452;
  border-radius: 26px;
}

h1 {
  margin: 0;
  font-size: 26px;
  font-weight: 800;
  line-height: 1.2;
}

.intro { margin: 28px 0; }

h2 {
  margin: 0;
  font-size: 34px;
  line-height: 1.15;
  font-weight: 750;
  overflow-wrap: break-word;
}

h2 span { color: var(--accent); }

.intro p {
  margin: 14px 0 0;
  color: var(--secondary);
  font-size: 16px;
  line-height: 1.5;
  text-wrap: balance;
}

.steps {
  list-style: none;
  padding: 0;
  margin: 24px 0;
  text-align: left;
}

.steps li {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 15px 16px;
  min-height: 70px;
  background: #141a20;
  border: 1px solid #2b3541;
  border-radius: 8px;
}

.steps li + li { margin-top: 10px; }

.step-number {
  flex: 0 0 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: #5084fa;
  color: #fff;
  font-size: 20px;
  font-weight: 750;
}

.steps p {
  margin: 0;
  min-width: 0;
  font-size: 16px;
  line-height: 1.4;
  font-weight: 500;
  overflow-wrap: break-word;
}

.steps strong { font-weight: 700; }
.small-break { display: none; }
.dots { white-space: nowrap; }

.download-action { margin-top: 28px; }

.app-store-link {
  display: inline-flex;
  max-width: 100%;
  border-radius: 14px;
  transition: opacity 150ms ease;
}

.app-store-link img {
  display: block;
  width: 240px;
  max-width: 100%;
  height: auto;
}

.app-store-link:hover { opacity: .85; }
.app-store-link:focus-visible, summary:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 6px;
}

.fallback {
  margin: 18px 0 0;
  font-size: 14px;
  line-height: 1.6;
  color: var(--secondary);
}

.fallback strong { color: #d9dfe9; font-weight: 600; }

.menu-hint {
  position: relative;
  width: min(420px, 100%);
  height: 78px;
  margin: -26px auto 10px;
  text-align: right;
  padding: 40px 48px 0 0;
}

.menu-hint > span {
  display: inline-block;
  position: relative;
  z-index: 1;
  padding: 9px 14px;
  border-radius: 24px;
  background: #5084fa;
  color: #fff;
  font-size: 16px;
  line-height: 1.2;
  font-weight: 700;
}

.menu-hint svg {
  position: absolute;
  right: -7px;
  top: 0;
  width: 86px;
  height: 64px;
  fill: none;
  stroke: #5084fa;
  stroke-width: 11px;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.browser-help {
  max-width: 360px;
  margin: 26px auto 0;
  color: var(--secondary);
  font-size: 14px;
  line-height: 1.6;
}

.browser-help summary {
  cursor: pointer;
  padding: 10px 0;
  text-underline-offset: 4px;
}

.browser-help p { text-align: left; }
.browser-help strong { color: #e8ebf1; }

html:not([data-browser="in-app"]) body {
  display: flex;
  align-items: center;
}

@media (max-width: 360px) {
  body { padding-right: 16px; padding-left: 16px; }
  h2 { font-size: 30px; }
  .steps li { gap: 11px; padding: 13px 12px; }
  .steps p { font-size: 15px; }
  .small-break { display: block; }
}

@media (max-height: 750px) {
  .brand .app-icon { width: 96px; height: 96px; border-radius: 22px; }
  .intro { margin: 20px 0; }
  .steps { margin: 20px 0; }
  .download-action { margin-top: 20px; }
  .menu-hint { margin-bottom: 6px; }
}

@media (min-width: 700px) {
  body { padding-top: 64px; padding-bottom: 64px; }
  .brand .app-icon { width: 144px; height: 144px; border-radius: 32px; }
  h1 { font-size: 30px; }
  h2 { font-size: 40px; }
  .menu-hint { margin-top: -40px; margin-bottom: 28px; }
}

@media (prefers-reduced-motion: reduce) {
  .app-store-link { transition: none; }
}
