/* ============================================================
   "Get the mobile app" promo — Region Experts
   .rs-appbar   brand-coloured strip (desktop)
   .rs-appmodal  center popup, mobile (80% blurred black veil)
   .rs-gp        official-style Google Play badge
   ============================================================ */

:root {
  --rs-appbar-h: 74px;
  /* Falls back to the platform theme (variables.css): merlot/coral. */
  --rs-appbar-accent: var(--color-primary, #fa4f55);
  --rs-appbar-accent2: var(--color-primary-light, #ff7e83);
}

/* ============================================================
   Bottom strip (desktop)
   ============================================================ */

.rs-appbar {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 9000;
  padding: 12px 16px calc(12px + env(safe-area-inset-bottom, 0px));
  font-family: var(--font-family, 'DM Sans', -apple-system, 'Segoe UI', Roboto, sans-serif);
  background: var(--color-white, #fff);
  color: var(--color-gray-900, #0b1c30);
  border-top: 1px solid var(--color-gray-200, #e5e7eb);
  box-shadow: 0 -10px 30px rgba(11, 28, 48, .14);
  transform: translateY(120%);
  opacity: 0;
  transition: transform .38s cubic-bezier(.22, 1, .36, 1), opacity .3s ease;
  /* Never swallow taps meant for content sitting underneath. */
  pointer-events: none;
}

/* Role-coloured hairline across the top of the white strip. */
.rs-appbar::before {
  content: '';
  position: absolute;
  top: -1px;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(135deg, var(--rs-accent, #fa4f55), var(--rs-accent2, #ff7e83));
}

.rs-appbar-in {
  transform: none;
  opacity: 1;
  pointer-events: auto;
}

.rs-appbar-inner {
  display: flex;
  align-items: center;
  gap: 14px;
  max-width: 1180px;
  margin: 0 auto;
}

.rs-appbar-ic {
  width: 52px;
  height: 52px;
  min-width: 52px;
  border-radius: var(--radius-xl, 12px);
  overflow: hidden;
  background: var(--color-gray-50, #f8f9ff);
  border: 1px solid var(--color-gray-200, #e5e7eb);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 12px rgba(11, 28, 48, .1);
}

.rs-appbar-ic img { width: 100%; height: 100%; object-fit: cover; display: block; }

.rs-appbar-txt {
  flex: 1 1 auto;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.rs-appbar-txt strong {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 15.5px;
  font-weight: 800;
  letter-spacing: -.01em;
  line-height: 1.2;
  color: var(--color-gray-900, #0b1c30);
}

/* Role-coloured dot in front of the headline. */
.rs-appbar-txt strong::before {
  content: '';
  flex-shrink: 0;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--rs-accent, #fa4f55), var(--rs-accent2, #ff7e83));
}

.rs-appbar-txt span {
  font-size: 13px;
  line-height: 1.35;
  color: var(--color-gray-600, #565e74);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  padding-left: 16px;
}

.rs-appbar-acts {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
  pointer-events: auto;
}

.rs-appbar-x {
  width: 34px;
  height: 34px;
  min-width: 34px;
  border: 0;
  border-radius: 50%;
  background: var(--color-gray-100, #eff1f9);
  color: var(--color-gray-500, #7a8194);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background .2s ease, color .2s ease;
}

.rs-appbar-x:hover { background: var(--color-gray-200, #e5e7eb); color: var(--color-gray-900, #0b1c30); }
.rs-appbar-x svg { width: 16px; height: 16px; }

/* Keep page content clear of the fixed strip while it is on screen.
   The portal shells scroll inside .main / .customer-scroll instead of the
   document, so this class goes on whichever element actually scrolls
   (chosen in app-install.js). */
.rs-appbar-on { padding-bottom: calc(var(--rs-appbar-h) + env(safe-area-inset-bottom, 0px)); }

/* ============================================================
   Google Play badge
   ============================================================ */

.rs-gp {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 7px 15px 7px 13px;
  border-radius: var(--radius-lg, 8px);
  background: #000;
  border: 1px solid rgba(255, 255, 255, .55);
  color: #fff;
  text-decoration: none;
  line-height: 1;
  transition: transform .16s ease, box-shadow .16s ease, border-color .16s ease;
}

.rs-gp:hover {
  transform: translateY(-1px);
  border-color: #fff;
  box-shadow: 0 10px 24px -10px rgba(0, 0, 0, .85);
}

.rs-play-ic { width: 22px; height: 22px; flex-shrink: 0; display: block; }

.rs-gp-txt { display: flex; flex-direction: column; line-height: 1; }

.rs-gp-txt small {
  font-size: 8.5px;
  font-weight: 600;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, .88);
}

.rs-gp-txt strong {
  font-size: 16px;
  font-weight: 600;
  letter-spacing: -.015em;
  margin-top: 3px;
  white-space: nowrap;
}

/* Large variant used inside the mobile popup. */
.rs-gp-lg {
  width: 100%;
  justify-content: center;
  gap: 12px;
  padding: 13px 22px;
  border-radius: var(--radius-xl, 12px);
  border-color: transparent;
  box-shadow: 0 16px 32px -16px rgba(0, 0, 0, .9);
}

.rs-gp-lg .rs-play-ic { width: 28px; height: 28px; }
.rs-gp-lg .rs-gp-txt small { font-size: 10px; letter-spacing: .18em; }
.rs-gp-lg .rs-gp-txt strong { font-size: 21px; margin-top: 4px; }

/* ============================================================
   Center popup (mobile) — 80% black veil + backdrop blur
   ============================================================ */

.rs-appmodal {
  position: fixed;
  inset: 0;
  z-index: 9600;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 22px;
}

.rs-appmodal[hidden] { display: none; }

.rs-appmodal-veil {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, .8);
  -webkit-backdrop-filter: blur(14px) saturate(115%);
  backdrop-filter: blur(14px) saturate(115%);
  opacity: 0;
  transition: opacity .28s ease;
}

.rs-appmodal-in .rs-appmodal-veil { opacity: 1; }

.rs-appmodal-card {
  position: relative;
  width: 100%;
  max-width: 344px;
  padding: 30px 24px 20px;
  border-radius: var(--radius-2xl, 16px);
  background: var(--color-white, #fff);
  font-family: var(--font-family, 'DM Sans', -apple-system, 'Segoe UI', Roboto, sans-serif);
  text-align: center;
  box-shadow: var(--card-shadow-hover, 0 20px 40px -18px rgba(11, 28, 48, .45));
  transform: translateY(18px) scale(.96);
  opacity: 0;
  transition: transform .32s cubic-bezier(.22, 1, .36, 1), opacity .28s ease;
}

/* Brand-coloured cap along the top of the card. */
.rs-appmodal-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 26px;
  right: 26px;
  height: 4px;
  border-radius: 0 0 6px 6px;
  background: linear-gradient(135deg, var(--rs-accent, #fa4f55), var(--rs-accent2, #ff7e83));
}

.rs-appmodal-in .rs-appmodal-card { transform: none; opacity: 1; }

.rs-appmodal-x {
  position: absolute;
  top: 14px;
  right: 14px;
  background: var(--color-gray-100, #eff1f9);
  color: var(--color-gray-500, #7a8194);
  z-index: 2;
}
.rs-appmodal-x:hover { background: var(--color-gray-200, #e5e7eb); color: var(--color-gray-900, #0b1c30); }

.rs-appmodal-ic {
  display: block;
  width: 96px;
  height: 96px;
  margin: 0 auto;
  border-radius: var(--radius-xl, 12px);
  overflow: hidden;
  background: var(--color-gray-50, #f8f9ff);
  box-shadow: 0 0 0 1px var(--color-gray-200, #e5e7eb),
              0 18px 34px -16px rgba(11, 28, 48, .45);
}

.rs-appmodal-ic img { width: 100%; height: 100%; object-fit: cover; display: block; }

.rs-appmodal-title {
  margin: 20px 0 0;
  font-family: var(--font-family-heading, inherit);
  font-size: 21px;
  line-height: 1.25;
  font-weight: 800;
  letter-spacing: -.02em;
  color: var(--color-gray-900, #0b1c30);
}

.rs-appmodal-line {
  margin: 9px 0 0;
  font-size: 14.5px;
  line-height: 1.5;
  color: var(--color-gray-600, #565e74);
}

.rs-appmodal-meta {
  margin: 10px 0 0;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .03em;
  color: var(--color-gray-500, #7a8194);
}

.rs-appmodal-acts { margin-top: 22px; }

.rs-appmodal-skip {
  appearance: none;
  background: none;
  border: 0;
  cursor: pointer;
  font-family: inherit;
  font-size: 13.5px;
  font-weight: 700;
  color: var(--color-gray-500, #7a8194);
  margin-top: 6px;
  padding: 14px 8px 0;
}
.rs-appmodal-skip:hover { color: var(--color-gray-700, #3d4a5c); }

/* The desktop experience is the bottom strip — no center popup on a
   desktop-shaped window. Phones and landscape handsets still qualify
   (short height keeps the popup eligible even past 769px).
   ?showapp=1 forces it on for verification in a desktop browser. */
@media (min-width: 769px) and (min-height: 481px) {
  .rs-appmodal { display: none !important; }
  .rs-appmodal-force .rs-appmodal { display: flex !important; }
}

/* ============================================================
   Sidebar / drawer "Get the mobile app" link
   ============================================================ */

.nav-item.nav-ext .ni { fill: currentColor; stroke: none; }

.nav-item.nav-ext::after {
  content: '';
  width: 11px;
  height: 11px;
  flex-shrink: 0;
  margin-left: auto;
  opacity: .45;
  background: currentColor;
  -webkit-mask: no-repeat center / contain url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'><path d='M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6'/><polyline points='15 3 21 3 21 9'/><line x1='10' y1='14' x2='21' y2='3'/></svg>");
  mask: no-repeat center / contain url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'><path d='M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6'/><polyline points='15 3 21 3 21 9'/><line x1='10' y1='14' x2='21' y2='3'/></svg>");
}

.layout.collapsed .nav-item.nav-ext::after { display: none; }

.topnav-mobile-link.nav-ext svg { fill: currentColor; stroke: none; flex-shrink: 0; }

/* ============================================================
   Responsive
   ============================================================ */

@media (max-width: 768px) {
  :root { --rs-appbar-h: 70px; }
  .rs-appbar-inner { gap: 11px; }
  .rs-appbar-ic { width: 42px; height: 42px; min-width: 42px; border-radius: 12px; }
  .rs-appbar-txt strong { font-size: 14.5px; }
  .rs-appbar-txt span { font-size: 12.5px; }
}

@media (max-width: 520px) {
  /* Phones: the sub-line has no room — headline + badge only. */
  .rs-appbar-txt span { display: none; }
  :root { --rs-appbar-h: 64px; }
}

@media (max-width: 400px) {
  :root { --rs-appbar-h: 60px; }
  .rs-appbar { padding-left: 10px; padding-right: 10px; }
  .rs-appbar-inner { gap: 9px; }
  .rs-appbar-ic { width: 36px; height: 36px; min-width: 36px; border-radius: 10px; }
  .rs-appbar-x { width: 30px; height: 30px; min-width: 30px; }
  .rs-gp-sm { padding: 6px 11px 6px 10px; gap: 8px; }
  .rs-gp-sm .rs-play-ic { width: 19px; height: 19px; }
  .rs-gp-sm .rs-gp-txt strong { font-size: 14px; }
  .rs-gp-sm .rs-gp-txt small { font-size: 7.5px; }
}

/* Short viewports (landscape phones): shrink the strip. */
@media (max-height: 480px) {
  :root { --rs-appbar-h: 54px; }
  .rs-appbar {
    padding-top: 6px;
    padding-bottom: calc(6px + env(safe-area-inset-bottom, 0px));
  }
  .rs-appbar-txt span { display: none; }
  .rs-appbar-ic { width: 34px; height: 34px; min-width: 34px; border-radius: var(--radius-lg, 8px); }
  .rs-appmodal { padding: 12px; }
  .rs-appmodal-card { padding: 22px 18px 14px; border-radius: var(--radius-2xl, 16px); }
  .rs-appmodal-ic { width: 68px; height: 68px; border-radius: 20px; }
  .rs-appmodal-title { font-size: 19px; margin-top: 14px; }
}

@media (min-width: 900px) {
  .rs-appbar-txt strong { font-size: 16.5px; }
  .rs-appbar-txt span { font-size: 13.5px; }
}

@media (prefers-reduced-motion: reduce) {
  .rs-appbar,
  .rs-appmodal-veil,
  .rs-appmodal-card { transition: none; }
}
