@media (display-mode: standalone) {
  html {
    touch-action: manipulation;
  }
  body {
    padding-top: env(safe-area-inset-top);
    padding-right: env(safe-area-inset-right);
    padding-bottom: env(safe-area-inset-bottom);
    padding-left: env(safe-area-inset-left);
    overscroll-behavior-y: none;
  }
  button,
  a,
  .sf-nav,
  .sf-chip,
  img {
    -webkit-tap-highlight-color: transparent;
  }
  button,
  .sf-nav,
  .sf-chip {
    -webkit-touch-callout: none;
    user-select: none;
  }
  input,
  textarea,
  select {
    font-size: 16px !important;
  }
}

/* In-page splash = the iOS startup image composition: store background, logo fitted to 78% x 45%
   of the screen centred at 47% height, "powered by Link Mahal" above the bottom edge. */
.lm-app-splash {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 4000;
  background: var(--lm-app-splash, #fff);
  color: var(--lm-app-splash-ink, #111827);
  opacity: 1;
  transition: opacity 0.24s ease;
}
/* Only the first page of a cold launch. The head script adds lm-splash-on; store-app.js fades it out. */
html.lm-splash-on .lm-app-splash { display: block; }
.lm-app-splash.is-out { opacity: 0; pointer-events: none; }
@media (prefers-reduced-motion: reduce) {
  .lm-app-splash { transition: none; }
}
.lm-app-splash__logo {
  position: absolute;
  left: 50%;
  top: 47%;
  width: min(78vw, calc(45vh * var(--lm-splash-r, 1)));
  aspect-ratio: var(--lm-splash-r, 1);
  transform: translate(-50%, -50%);
  background: var(--lm-splash-logo) center / contain no-repeat;
}
.lm-app-splash__name {
  position: absolute;
  left: 50%;
  top: 47%;
  width: 78vw;
  margin: 0;
  transform: translate(-50%, -50%);
  text-align: center;
  font-size: 1.8rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}
.lm-app-splash__brand {
  position: absolute;
  left: 50%;
  bottom: 5.5vh;
  width: 30vw;
  aspect-ratio: 452 / 57;
  transform: translateX(-50%);
  background: var(--lm-splash-caption) center / contain no-repeat;
}
.lm-app-offline {
  min-height: 70vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}
.lm-app-offline__card {
  width: min(100%, 420px);
  text-align: center;
}
.lm-app-offline__logo {
  width: 72px;
  height: 72px;
  border-radius: 16px;
  object-fit: cover;
}
.lm-install-invite {
  position: fixed;
  z-index: 1600;
  top: 0;
  left: 0;
  right: 0;
  bottom: auto;
  box-sizing: border-box;
  width: auto;
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0;
  min-height: 0;
  padding: 8px 12px;
  padding-top: calc(8px + env(safe-area-inset-top, 0px));
  padding-inline-start: 4px;
  border: 0;
  border-radius: 0;
  border-bottom: 0.5px solid rgba(60, 60, 67, 0.29);
  background: #f2f2f7;
  box-shadow: none;
  color: #000;
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", system-ui, sans-serif;
}
html.lm-banner-on { overflow-x: hidden; }
html.lm-banner-on body.storefront-body { padding-top: var(--lm-banner-h, 0px); }
html.lm-banner-on .sf-top-bar { top: var(--lm-banner-h, 0px); }
.lm-install-invite[hidden] { display: none !important; }
/* The icon is the logo itself, centre-cropped to a square, edge to edge; only the corners are rounded here. */
.lm-install-invite__icon,
.lm-install-head__icon {
  display: block;
  aspect-ratio: 1;
  border-radius: 22.5%;
  object-fit: cover;
  flex: none;
  box-shadow: 0 0 0 0.5px rgba(0, 0, 0, 0.12);
}
.lm-install-invite__icon { width: 48px; height: 48px; border-radius: 11px; }
.lm-install-head__icon { width: 58px; height: 58px; }
.lm-install-invite__icon--mark,
.lm-install-head__icon--mark {
  font-size: 24px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--lm-install, #0f766e);
  color: #fff;
  font-weight: 700;
}
.lm-install-invite__copy {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.lm-install-invite__copy strong {
  display: block;
  font-size: 15px;
  font-weight: 600;
  letter-spacing: -0.24px;
  line-height: 1.2;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  color: #000;
}
.lm-install-invite__copy span {
  display: block;
  font-size: 12px;
  font-weight: 400;
  line-height: 1.2;
  color: #8e8e93;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.lm-install-invite__btn,
.lm-install-primary {
  border: 0;
  background: var(--lm-install, #0f766e);
  color: var(--lm-install-ink, #fff);
  font-weight: 700;
  cursor: pointer;
  text-decoration: none;
  text-align: center;
}
.lm-install-invite__close {
  /* First item of the banner: the leading edge (left in English, right in Arabic). */
  flex: none;
  position: relative;
  width: 20px;
  height: 20px;
  margin: 0;
  padding: 0;
  border: 0;
  background: transparent;
  color: #9ca3af;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.lm-install-invite__close:active { color: #6b7280; }
/* 44px tap target without taking layout width. */
.lm-install-invite__close::after { content: ""; position: absolute; inset: -12px; }
.lm-install-invite__close svg { display: block; }
.lm-install-invite {
  transform: none;
  touch-action: pan-y;
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", system-ui, sans-serif;
}
[dir="rtl"] .lm-install-invite { font-family: -apple-system, "SF Arabic", "IBM Plex Sans Arabic", system-ui, sans-serif; }
.lm-install-invite.is-drag { transition: none; }
.lm-install-sheet.sf-promo-popup { z-index: 1600; }
.lm-install-hint {
  margin: 8px 0 0;
  font-size: 13.5px;
  font-weight: 600;
  color: #111827;
}
.lm-install-hint::before {
  content: "↓ ";
}
.lm-install-sheet.is-ipad-hint .lm-install-hint::before {
  content: "↗ ";
}
.lm-install-invite__btn {
  position: relative;
  height: 28px;
  min-height: 28px;
  padding: 0 14px;
  border-radius: 14px;
  background: #007aff;
  color: #fff;
  font-family: inherit;
  font-size: 15px;
  font-weight: 600;
  white-space: nowrap;
  flex: none;
}
/* 44px tap target around the 40px pill. */
.lm-install-invite__btn::after { content: ""; position: absolute; inset: -2px -4px; }
.lm-install-sheet.sf-promo-popup {
  align-items: flex-end;
  padding: 8px;
  padding-bottom: calc(8px + env(safe-area-inset-bottom));
}
.lm-install-sheet .lm-install-dialog {
  width: min(100%, 28rem);
  border-radius: 30px;
  box-shadow: 0 -10px 40px rgba(0, 0, 0, 0.18);
  padding: 28px 18px 8px;
}
.lm-install-grabber {
  position: absolute;
  top: 8px;
  left: 50%;
  width: 38px;
  height: 5px;
  margin-left: -19px;
  border-radius: 3px;
  background: #d1d5db;
}
.lm-install-close {
  position: absolute;
  top: 18px;
  inset-inline-end: 16px;
  width: 30px;
  height: 30px;
  border: 0;
  border-radius: 50%;
  background: #f3f4f6;
  color: #6b7280;
  font-size: 16px;
  line-height: 1;
  cursor: pointer;
}
.lm-install-head {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
}
.lm-install-head__copy { flex: 1; min-width: 0; padding-inline-end: 30px; }
.lm-install-head__title {
  margin: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  font-size: 18.5px;
  font-weight: 700;
  letter-spacing: -0.35px;
  color: #111827;
  line-height: 1.2;
}
.lm-install-head__sub {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  overflow: hidden;
  line-height: 1.3;
}
.lm-install-head__sub,
.lm-install-lead {
  margin: 2px 0 0;
  font-size: 13.5px;
  color: #6b7280;
}
.lm-install-kicker {
  margin: 0 0 6px;
  font-size: 13.5px;
  font-weight: 700;
  color: var(--lm-install, #0f766e);
}
.lm-install-steps {
  list-style: none;
  margin: 0;
  padding: 0;
}
.lm-install-steps li {
  display: flex;
  align-items: center;
  gap: 9px;
  min-height: 34px;
  font-size: 14.5px;
  color: #111827;
}
.lm-install-steps li > span:first-child {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--lm-install, #0f766e);
  color: #fff;
  font-size: 12.5px;
  font-weight: 700;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 24px;
}
.lm-install-key {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  height: 24px;
  padding: 0 7px;
  border-radius: 6px;
  background: #f3f4f6;
  border: 1px solid #e5e7eb;
  font-size: 12.5px;
  font-weight: 600;
  color: #111827;
  vertical-align: middle;
}
.lm-install-step {
  display: flex;
  flex: 1 1 auto;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  min-width: 0;
  position: static;
  width: auto;
  height: auto;
  background: transparent;
  color: #111827;
  font-size: 14.5px;
  font-weight: 400;
}
.lm-install-glyph {
  width: 14px;
  height: 14px;
  display: block;
}
.lm-install-primary {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 50px;
  margin-top: 12px;
  border-radius: 14px;
  font-size: 16.5px;
}
.lm-install-later {
  display: block;
  width: 100%;
  margin: 8px 0 6px;
  padding: 8px;
  border: 0;
  background: transparent;
  color: #6b7280;
  font-size: 14.5px;
  font-weight: 500;
  cursor: pointer;
}
.lm-install-sheet .sf-promo-popup__dialog {
  padding: 1.25rem 1.15rem 1.15rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}
.lm-install-sheet .btn {
  width: 100%;
  min-height: 48px;
  margin-top: 8px;
}
.lm-install-point {
  position: fixed;
  z-index: 3600;
  bottom: calc(12px + env(safe-area-inset-bottom));
  inset-inline-start: 16px;
  padding: 8px 12px;
  background: #0f766e;
  color: #fff;
  border-radius: 999px;
  font-weight: 700;
}
.lm-app-settings label {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-weight: 650;
}
.lm-app-settings input[type="text"],
.lm-app-settings input[type="color"] {
  min-height: 48px;
  font-size: 16px;
}
.lm-app-settings__previews {
  display: flex;
  gap: 16px;
}
.lm-app-settings__previews img {
  border-radius: 16px;
}
.lm-install-chip {
  position: fixed;
  z-index: 40;
  bottom: 1.25rem;
  inset-inline-end: 1.25rem;
  min-height: 44px;
  padding: 0.55rem 0.9rem;
  border: 0;
  border-radius: 999px;
  background: #0f766e;
  color: #fff;
  font: inherit;
  font-weight: 700;
  box-shadow: 0 8px 24px rgba(15, 118, 110, 0.28);
}
@media (max-width: 1023px) {
  [data-lm-install-chip] { display: none !important; }
}
/* Footer: "Powered by Link Mahal" with the app controls beside it, one tidy centred row. */
.sf-powered-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 0 0.5rem;
  margin: 0;
  font-size: 0.78rem;
  line-height: 1.35;
}
.sf-powered-row .sf-powered-credit { margin: 0; }
.sf-footer-bottom { padding-bottom: env(safe-area-inset-bottom, 0px); }
.lm-foot-tools { display: inline-flex; align-items: center; gap: 0.25rem; }
.lm-foot-tools > [hidden] { display: none !important; }
.lm-foot-bell,
.lm-foot-install {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 44px;
  min-height: 44px;
  margin-block: -0.75rem;
  padding: 0;
  border: 0;
  background: none;
  color: var(--sf-muted, var(--store-muted, #64748b));
  font: inherit;
  font-size: 0.78rem;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition: transform var(--sf-dur-press, 120ms) var(--sf-ease-spring, ease), color var(--sf-dur-ui, 200ms) ease;
}
.lm-foot-install { padding-inline: 0.35rem; text-decoration: underline; text-underline-offset: 0.15em; }
.lm-foot-bell:active,
.lm-foot-install:active { transform: scale(0.94); }
.lm-foot-bell:focus-visible,
.lm-foot-install:focus-visible { outline: 2px solid var(--sf-accent, var(--store-primary, #0f766e)); outline-offset: -4px; border-radius: 12px; }
.lm-foot-bell__dot {
  position: absolute;
  inset-block-start: 11px;
  inset-inline-end: 11px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #16a34a;
  box-shadow: 0 0 0 2px var(--store-card, var(--sf-card, #fff));
}
.lm-foot-bell__dot[hidden] { display: none; }
.lm-app-notify__row {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  min-height: 44px;
  font-weight: 650;
}
.lm-app-offline__brand {
  margin-top: 24px;
  font-size: 0.85rem;
}

.lm-app-back {
  position: fixed;
  z-index: 60;
  top: calc(10px + env(safe-area-inset-top));
  inset-inline-start: 12px;
  width: 44px;
  height: 44px;
  border: 0.5px solid rgba(0, 0, 0, 0.08);
  border-radius: 50%;
  background: rgba(250, 250, 252, 0.82);
  backdrop-filter: blur(14px) saturate(1.6);
  -webkit-backdrop-filter: blur(14px) saturate(1.6);
  box-shadow: 0 6px 22px rgba(0, 0, 0, 0.14), inset 0 0 0 0.5px rgba(255, 255, 255, 0.9);
  color: #111;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}
[dir="rtl"] .lm-app-back svg { transform: scaleX(-1); }
.lm-app-notify__hint {
  margin: 4px 0 10px;
  font-size: 0.9rem;
  line-height: 1.45;
  color: #6b7280;
}

/* Notifications: one slim, quiet row. The permission prompt itself is the browser's. */
.lm-notify-row {
  max-height: 0;
  overflow: hidden;
  opacity: 0;
  transition: max-height 0.28s ease, opacity 0.2s ease;
  background: color-mix(in srgb, var(--store-primary-readable, var(--store-primary, #0f766e)) 8%, #fff);
  border-bottom: 1px solid rgba(0, 0, 0, 0.05);
  font-family: inherit;
}
.lm-notify-row[hidden] { display: none; }
.lm-notify-row.is-open { max-height: 140px; opacity: 1; }
@media (prefers-reduced-motion: reduce) {
  .lm-notify-row { transition: none; }
}
.lm-notify-row__bar { display: flex; align-items: center; min-height: 44px; }
.lm-notify-row__btn {
  flex: 1;
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  padding: 0 4px 0 14px;
  padding-inline: 14px 4px;
  border: 0;
  background: transparent;
  color: #1f2937;
  font: inherit;
  font-size: 13.5px;
  text-align: start;
  cursor: pointer;
}
.lm-notify-row__bell { flex: none; color: var(--store-primary-readable, var(--store-primary, #0f766e)); }
.lm-notify-row__text { flex: 1; min-width: 0; overflow-wrap: anywhere; line-height: 1.25; }
.lm-notify-row__cta { flex: none; font-weight: 700; color: var(--store-primary-readable, var(--store-primary, #0f766e)); }
.lm-notify-row__btn:disabled { opacity: 0.6; }
.lm-notify-row__x {
  flex: none;
  width: 44px;
  height: 44px;
  border: 0;
  background: transparent;
  color: #9ca3af;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}
.lm-notify-row__hint {
  margin: 0;
  padding: 0 14px 10px;
  font-size: 12.5px;
  line-height: 1.4;
  color: #6b7280;
}

/* Install reward: only ever visible in the installed app (store-app.js un-hides it). */
html:not(.lm-standalone) .lm-reward { display: none !important; }
.lm-reward[hidden] { display: none; }
.lm-reward {
  position: fixed;
  inset: 0;
  z-index: 1700;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding: 16px max(16px, env(safe-area-inset-right)) max(16px, env(safe-area-inset-bottom)) max(16px, env(safe-area-inset-left));
}
.lm-reward__backdrop { position: absolute; inset: 0; background: rgba(12, 18, 34, 0.5); }
.lm-reward__card {
  position: relative;
  width: min(100%, 380px);
  max-height: calc(100dvh - 32px - env(safe-area-inset-top) - env(safe-area-inset-bottom));
  overflow-y: auto;
  box-sizing: border-box;
  padding: 28px 22px 20px;
  border-radius: 20px;
  background: var(--store-card, #fff);
  color: var(--store-text, #111827);
  text-align: center;
  box-shadow: 0 18px 50px rgba(12, 18, 34, 0.28);
  outline: none;
  animation: lm-reward-in 0.26s cubic-bezier(0.23, 1, 0.32, 1);
}
@keyframes lm-reward-in { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { .lm-reward__card { animation: none; } }
.lm-reward__x {
  position: absolute;
  inset-block-start: 4px;
  inset-inline-end: 4px;
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  border: 0;
  background: none;
  color: inherit;
  opacity: 0.6;
}
.lm-reward__gift { color: var(--lm-install, var(--store-primary, #0f766e)); }
.lm-reward__title { margin: 8px 0 6px; font-size: 19px; line-height: 1.3; font-weight: 700; }
.lm-reward__sub, .lm-reward__use, .lm-reward__error { margin: 0 0 14px; font-size: 14px; line-height: 1.5; opacity: 0.8; overflow-wrap: anywhere; }
.lm-reward__error { color: #b91c1c; opacity: 1; }
.lm-reward__codebox { margin: 4px 0 14px; padding: 14px 12px; border: 1.5px dashed currentColor; border-radius: 14px; display: grid; gap: 6px; }
.lm-reward__label { font-size: 12px; opacity: 0.7; }
.lm-reward__scratch { position: relative; min-height: 64px; display: grid; place-items: center; border-radius: 12px; overflow: hidden; }
.lm-reward__code { font-size: 24px; letter-spacing: 0.12em; font-weight: 700; user-select: all; -webkit-user-select: all; overflow-wrap: anywhere; z-index: 0; }
.lm-reward__code.is-revealed { animation: lm-reward-pop 0.35s cubic-bezier(0.2, 0.9, 0.3, 1.2); }
@keyframes lm-reward-pop { from { transform: scale(0.92); opacity: 0.4; } to { transform: none; opacity: 1; } }
.lm-reward__cover { position: absolute; inset: 0; width: 100%; height: 100%; touch-action: none; cursor: crosshair; z-index: 1; border-radius: 12px; }
.lm-reward__cover.is-gone { opacity: 0; transition: opacity 0.35s ease; pointer-events: none; }
.lm-reward__reveal { position: absolute; inset: 0; z-index: 2; border: 0; background: #d5d8de; color: #4b5160; font: inherit; font-weight: 650; }
@media (prefers-reduced-motion: reduce) {
  .lm-reward__code.is-revealed { animation: none; }
  .lm-reward__cover.is-gone { transition: none; }
}
.lm-reward__use { margin: 0; font-size: 12.5px; }
.lm-reward__btn {
  display: block;
  width: 100%;
  min-height: 48px;
  margin-top: 8px;
  border: 0;
  border-radius: 14px;
  background: var(--lm-install, var(--store-primary, #0f766e));
  color: var(--lm-install-ink, #fff);
  font: inherit;
  font-weight: 600;
  font-size: 15px;
}
.lm-reward__btn[hidden], .lm-reward__link[hidden] { display: none; }
.lm-reward__btn:disabled { opacity: 0.6; }
.lm-reward__link { display: block; width: 100%; min-height: 44px; margin-top: 4px; border: 0; background: none; color: inherit; font: inherit; opacity: 0.75; }
