:root {
  color-scheme: light;
  --orange: #f58220;
  --orange-dark: #c75b08;
  --blue: #1778c8;
  --green: #087f5b;
  --ink: #17212b;
  --muted: #627080;
  --line: #d9e0e7;
  --soft: #f4f7f9;
  --white: #ffffff;
}

*, *::before, *::after {
  box-sizing: border-box;
}

html {
  min-height: 100%;
  background: var(--soft);
}

body {
  min-height: 100vh;
  margin: 0;
  background: var(--soft);
  color: var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  letter-spacing: 0;
}

button, a {
  font: inherit;
}

.topbar {
  width: 100%;
  min-height: calc(64px + env(safe-area-inset-top));
  padding-top: env(safe-area-inset-top);
  background: var(--orange);
  border-bottom: 1px solid rgba(84, 38, 0, 0.2);
}

.topbar-inner {
  width: min(100%, 760px);
  min-height: 64px;
  margin: 0 auto;
  padding: 8px 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.brand {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--white);
  font-size: 20px;
  font-weight: 800;
  text-decoration: none;
}

.brand-mark {
  width: 40px;
  height: 40px;
  border-radius: 8px;
  object-fit: cover;
}

.icon-button {
  width: 44px;
  height: 44px;
  padding: 0;
  display: grid;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, 0.72);
  border-radius: 8px;
  background: rgba(95, 38, 0, 0.14);
  color: var(--white);
  cursor: pointer;
}

.action-app {
  position: relative;
  width: 30px;
  height: 30px;
  display: block;
}

.action-app img {
  width: 30px;
  height: 30px;
  display: block;
  border-radius: 6px;
  object-fit: cover;
}

.action-app > span {
  position: absolute;
  right: -5px;
  bottom: -5px;
  width: 17px;
  height: 17px;
  display: grid;
  place-items: center;
  border: 2px solid var(--orange);
  border-radius: 50%;
  background: var(--white);
  color: var(--orange-dark);
  font-size: 14px;
  font-weight: 900;
  line-height: 1;
}

.install-shell {
  width: min(100%, 760px);
  margin: 0 auto;
  padding: 30px 20px 38px;
}

.intro {
  display: grid;
  grid-template-columns: 86px minmax(0, 1fr);
  gap: 20px;
  align-items: center;
  padding-bottom: 28px;
}

.app-icon {
  width: 86px;
  height: 86px;
  border-radius: 18px;
  object-fit: cover;
  box-shadow: 0 5px 14px rgba(23, 33, 43, 0.18);
}

.eyebrow {
  margin: 0 0 5px;
  color: var(--orange-dark);
  font-size: 13px;
  font-weight: 750;
  text-transform: uppercase;
}

h1, h2, p {
  margin-top: 0;
}

h1 {
  margin-bottom: 7px;
  font-size: clamp(25px, 7vw, 34px);
  line-height: 1.08;
}

.lead {
  max-width: 540px;
  margin-bottom: 0;
  color: var(--muted);
  font-size: 16px;
  line-height: 1.45;
}

.status-message {
  display: none;
  margin: 0 0 16px;
  padding: 11px 13px;
  border-left: 4px solid var(--blue);
  background: #eaf4fc;
  color: #174b72;
  font-size: 14px;
  line-height: 1.4;
}

.status-message.visible {
  display: block;
}

.instructions {
  padding: 24px;
  border: 1px solid #b9c4ce;
  border-radius: 8px;
  background: var(--white);
  box-shadow: 0 3px 12px rgba(23, 33, 43, 0.07);
}

.hidden {
  display: none !important;
}

.section-heading {
  display: grid;
  grid-template-columns: 58px minmax(0, 1fr);
  gap: 14px;
  align-items: center;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--line);
}

.section-heading h2,
.installed h2 {
  margin-bottom: 4px;
  font-size: 20px;
  line-height: 1.2;
}

.section-heading p,
.installed p {
  margin-bottom: 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.4;
}

.device-mark {
  width: 58px;
  height: 40px;
  display: grid;
  place-items: center;
  border-radius: 6px;
  background: #eaf4fc;
  color: #175f99;
  font-size: 12px;
  font-weight: 750;
}

.device-mark.warning {
  background: #fff0e2;
  color: #984400;
}

.steps {
  margin: 0;
  padding: 8px 0 0;
  list-style: none;
}

.steps li {
  min-height: 76px;
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr);
  gap: 14px;
  align-items: center;
  border-bottom: 1px solid var(--line);
}

.steps li:last-child {
  border-bottom: 0;
}

.step-number {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border: 1px solid #e16b0e;
  border-radius: 50%;
  color: var(--orange-dark);
  font-weight: 750;
}

.steps strong,
.steps span {
  display: block;
}

.steps strong {
  margin-bottom: 3px;
  font-size: 15px;
}

.steps div span {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.4;
}

.steps.compact {
  margin-bottom: 18px;
}

.safari-hint {
  min-height: 54px;
  margin-top: 12px;
  padding: 10px 14px;
  display: flex;
  gap: 9px;
  align-items: center;
  justify-content: center;
  border: 1px solid #aed1ec;
  border-radius: 6px;
  background: #f1f8fd;
  color: #174b72;
  font-size: 13px;
  font-weight: 650;
}

.share-symbol,
.add-symbol {
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  border: 1px solid #4488bb;
  border-radius: 5px;
  font-size: 19px;
  line-height: 1;
}

.hint-arrow {
  color: var(--muted);
  font-size: 18px;
}

.primary-button,
.secondary-button {
  width: 100%;
  min-height: 48px;
  padding: 12px 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  text-decoration: none;
  font-weight: 700;
  cursor: pointer;
}

.primary-button {
  margin-top: 20px;
  border: 1px solid #d7660c;
  background: var(--orange);
  color: var(--white);
  box-shadow: 0 3px 8px rgba(199, 91, 8, 0.22);
}

.secondary-button {
  margin-top: 12px;
  border: 1px solid #9eabb7;
  background: var(--white);
  color: var(--ink);
}

.installed {
  text-align: center;
}

.installed-mark {
  width: 54px;
  height: 54px;
  margin: 0 auto 14px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: #dff5ec;
  color: var(--green);
  font-size: 28px;
  font-weight: 800;
}

footer {
  width: min(100%, 760px);
  margin: 0 auto;
  padding: 0 20px calc(24px + env(safe-area-inset-bottom));
  display: flex;
  justify-content: space-between;
  gap: 16px;
  color: var(--muted);
  font-size: 13px;
}

.share-guide {
  padding: 0;
  border: 0;
  background: transparent;
  color: #175f99;
  text-decoration: underline;
  cursor: pointer;
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 1000;
  padding: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(16, 24, 32, 0.62);
}

.help-dialog {
  position: relative;
  width: min(100%, 420px);
  max-height: calc(100vh - 40px);
  overflow-y: auto;
  padding: 25px 22px 22px;
  border: 1px solid #aeb9c3;
  border-radius: 8px;
  background: var(--white);
  text-align: center;
  box-shadow: 0 16px 44px rgba(16, 24, 32, 0.3);
}

.help-dialog h2 {
  margin-bottom: 8px;
  font-size: 22px;
}

.help-dialog > p {
  margin-bottom: 18px;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.45;
}

.help-app-icon {
  width: 62px;
  height: 62px;
  margin: 0 auto 12px;
  border-radius: 13px;
  overflow: hidden;
  box-shadow: 0 4px 12px rgba(23, 33, 43, 0.17);
}

.help-app-icon img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.close-button {
  position: absolute;
  top: 10px;
  right: 10px;
  width: 38px;
  height: 38px;
  border: 0;
  background: transparent;
  color: var(--muted);
  font-size: 27px;
  line-height: 1;
  cursor: pointer;
}

.help-route {
  display: grid;
  grid-template-columns: 30px minmax(0, 1fr);
  gap: 9px 11px;
  align-items: center;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--soft);
  text-align: left;
}

.help-route span {
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: #fff0e2;
  color: var(--orange-dark);
  font-size: 13px;
  font-weight: 800;
}

.help-route strong {
  font-size: 14px;
}

.help-dialog .primary-button {
  margin-top: 10px;
}

body.modal-open {
  overflow: hidden;
}

button:focus-visible,
a:focus-visible {
  outline: 3px solid rgba(23, 120, 200, 0.35);
  outline-offset: 2px;
}

@media (max-width: 520px) {
  .install-shell {
    padding: 24px 14px 30px;
  }

  .intro {
    grid-template-columns: 72px minmax(0, 1fr);
    gap: 14px;
    padding: 0 4px 22px;
  }

  .app-icon {
    width: 72px;
    height: 72px;
    border-radius: 15px;
  }

  h1 {
    font-size: 25px;
  }

  .lead {
    font-size: 14px;
  }

  .instructions {
    padding: 19px 16px;
  }

  .safari-hint {
    flex-wrap: wrap;
  }

  footer {
    padding-inline: 18px;
  }
}
