/* PWA chrome — loaded on all platform pages; active only in standalone */

html.is-pwa-standalone .header__menu,
html.is-pwa-standalone .burger,
html.is-pwa-standalone .header__btn,
html.is-pwa-standalone .user_profile,
html.is-pwa-standalone .site-chat-widget,
html.is-pwa-standalone .holding-compare-bar,
html.is-pwa-standalone .credit-compare-bar,
html.is-pwa-standalone .cross-link--crypto,
html.is-pwa-standalone .exchange-offices-mobile-search,
html.is-pwa-standalone .city-bar {
  display: none !important;
}

/* Browser: hide PWA-only office search (crypto block stays) */
.pwa-office-search {
  display: none;
  margin: 0 0 14px;
}

html.is-pwa-standalone .pwa-office-search {
  display: block;
}

html.is-pwa-standalone .pwa-office-search .rates-table__office-search {
  display: flex;
  width: 100%;
  max-width: none;
  min-height: 52px;
  padding: 6px 8px 6px 14px;
  border-radius: 14px;
  border: 1px solid var(--border, #e6e6e6);
  background: var(--surface, #fff);
  box-shadow: 0 2px 10px rgba(15, 23, 42, 0.06);
}

html.is-pwa-standalone .pwa-office-search .rates-table__office-search-input {
  flex: 1 1 auto;
  width: 100%;
  max-width: none;
  min-height: 40px;
  font-size: 1.05rem;
  border: 0;
  background: transparent;
}

html.is-pwa-standalone .pwa-office-search .rates-table__office-search-btn {
  width: 44px;
  height: 44px;
  border-radius: 12px;
}

/* PWA city page: hide title/lead, keep green “updated” line */
html.is-pwa-standalone .page-hero--exchange-city h1,
html.is-pwa-standalone .page-hero--exchange-city .page-hero__lead {
  display: none !important;
}

html.is-pwa-standalone .page-hero--exchange-city {
  margin: 0 0 12px;
  padding: 0;
}

html.is-pwa-standalone .page-hero--exchange-city .page-hero__updated {
  margin: 0;
  font-size: 1.2rem;
  font-weight: 800;
  line-height: 1.3;
  color: #16a34a;
}

.page-hero__updated {
  margin: 8px 0 0;
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text-muted, #666);
}

/* Larger back control in PWA navigation */
html.is-pwa-standalone .entity-back {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: 48px;
  margin: 0 0 16px;
  padding: 10px 14px 10px 10px;
  border-radius: 14px;
  background: #fff7ed;
  border: 1px solid #fdba74;
  font-size: 1.1rem;
  font-weight: 700;
  line-height: 1.25;
  color: #9a3412;
  text-decoration: none;
}

html.is-pwa-standalone .entity-back:hover {
  background: #ffedd5;
  color: #7c2d12;
}

html.is-pwa-standalone .entity-back__icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  flex: 0 0 auto;
}

html.is-pwa-standalone .entity-back__icon svg {
  width: 22px;
  height: 22px;
}

html.is-pwa-standalone .header__inner {
  gap: 0.75rem;
}

/* City switcher — large & readable in PWA */
html.is-pwa-standalone .city-switcher__btn {
  height: 44px;
  padding: 0 14px;
  gap: 8px;
  border-radius: 22px;
  font-size: 1.1rem !important;
  font-weight: 800 !important;
  line-height: 1.1 !important;
}

html.is-pwa-standalone .city-switcher__icon {
  width: 20px;
  height: 20px;
}

html.is-pwa-standalone .city-switcher__name {
  max-width: 160px !important;
  font-size: 1.1rem !important;
  font-weight: 800 !important;
}

html.is-pwa-standalone .city-switcher__chevron {
  width: 12px;
  height: 8px;
}

html.is-pwa-standalone .city-switcher__list {
  min-width: 220px;
  max-height: 360px;
  border-radius: 14px;
  padding: 8px;
}

html.is-pwa-standalone .city-switcher__option {
  padding: 12px 14px;
  font-size: 1.05rem !important;
  font-weight: 700 !important;
  border-radius: 10px;
}

@media (display-mode: standalone) {
  .city-switcher__btn {
    height: 44px;
    font-size: 1.1rem !important;
    font-weight: 800 !important;
  }

  .city-switcher__name {
    max-width: 160px !important;
    font-size: 1.1rem !important;
  }

  .city-switcher__option {
    padding: 12px 14px;
    font-size: 1.05rem !important;
  }
}

html.is-pwa-standalone .site-footer__grid > .site-footer__col:not(.site-footer__col--cities) {
  display: none;
}

html.is-pwa-standalone .site-footer__full-site {
  display: flex;
}

.site-footer__full-site {
  display: none;
  margin-top: 1rem;
}

.site-footer__full-site-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  max-width: 22rem;
  padding: 0.7rem 1rem;
  border-radius: 10px;
  background: #ea580c;
  color: #fff !important;
  font-weight: 600;
  text-decoration: none;
}

.site-footer__full-site-link:hover {
  background: #c2410c;
  color: #fff !important;
}

.pwa-offline-banner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem 0.75rem;
  margin: 0 0 1rem;
  padding: 0.65rem 0.9rem;
  border-radius: 10px;
  background: #fff7ed;
  border: 1px solid #fdba74;
  color: #9a3412;
  font-size: 0.92rem;
}

.pwa-offline-banner[hidden] {
  display: none !important;
}

.pwa-stale-hint {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem 0.75rem;
  margin: 0 0 1rem;
  padding: 0.55rem 0.85rem;
  border-radius: 10px;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  color: #334155;
  font-size: 0.9rem;
}

.pwa-stale-hint[hidden] {
  display: none !important;
}

.pwa-stale-hint__btn {
  appearance: none;
  border: 0;
  border-radius: 8px;
  padding: 0.35rem 0.7rem;
  background: #ea580c;
  color: #fff;
  font: inherit;
  font-weight: 600;
  cursor: pointer;
}

.pwa-stale-hint__btn:hover {
  background: #c2410c;
}

@media (display-mode: standalone) {
  .header__menu,
  .burger,
  .header__btn,
  .user_profile,
  .site-chat-widget,
  .cross-link--crypto,
  .exchange-offices-mobile-search,
  .city-bar {
    display: none !important;
  }

  .site-footer__full-site {
    display: flex;
  }

  .pwa-office-search {
    display: block;
  }

  .page-hero--exchange-city h1,
  .page-hero--exchange-city .page-hero__lead {
    display: none !important;
  }

  .page-hero--exchange-city .page-hero__updated {
    margin: 0;
    font-size: 1.2rem;
    font-weight: 800;
    color: #16a34a;
  }

  .entity-back {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    min-height: 48px;
    padding: 10px 14px 10px 10px;
    border-radius: 14px;
    background: #fff7ed;
    border: 1px solid #fdba74;
    font-size: 1.1rem;
    font-weight: 700;
    color: #9a3412;
  }

  .entity-back__icon svg {
    width: 22px;
    height: 22px;
  }
}

/* Larger rate cards: mobile site + PWA standalone */
@media (max-width: 640px) {
  .home-ticker,
  .city-highlights .home-ticker {
    flex-direction: column;
    gap: 14px;
  }

  .home-ticker-card,
  .city-highlights .home-ticker-card {
    flex: 1 1 100% !important;
    min-width: 0 !important;
    padding: 22px 20px !important;
    gap: 16px !important;
    border-radius: 18px !important;
  }

  .home-ticker-card__flag,
  .city-highlights .home-ticker-card__flag {
    width: 60px !important;
    height: 60px !important;
  }

  .home-ticker-card__pair,
  .city-highlights .home-ticker-card__pair {
    font-size: 1rem !important;
  }

  .home-ticker-card__row strong,
  .city-highlights .home-ticker-card__row strong {
    font-size: 1.85rem !important;
    letter-spacing: -0.02em;
  }

  .home-ticker-card__dir,
  .city-highlights .home-ticker-card__dir,
  .home-ticker-card .rate-flow {
    font-size: 1rem !important;
  }

  .home-ticker-card__rates {
    gap: 8px;
  }

  .home-ticker-card__row {
    gap: 10px;
  }
}

html.is-pwa-standalone .home-ticker,
html.is-pwa-standalone .city-highlights .home-ticker {
  flex-direction: column;
  gap: 14px;
}

html.is-pwa-standalone .home-ticker-card,
html.is-pwa-standalone .city-highlights .home-ticker-card {
  flex: 1 1 100% !important;
  min-width: 0 !important;
  padding: 22px 20px !important;
  gap: 16px !important;
  border-radius: 18px !important;
}

html.is-pwa-standalone .home-ticker-card__flag,
html.is-pwa-standalone .city-highlights .home-ticker-card__flag {
  width: 60px !important;
  height: 60px !important;
}

html.is-pwa-standalone .home-ticker-card__row strong,
html.is-pwa-standalone .city-highlights .home-ticker-card__row strong {
  font-size: 1.85rem !important;
}

html.is-pwa-standalone .home-ticker-card__dir,
html.is-pwa-standalone .city-highlights .home-ticker-card__dir {
  font-size: 1rem !important;
}

/* Install-to-home prompt — above AI chat FAB (~56px + 20px inset) */
.pwa-install-banner {
  position: fixed;
  left: 10px;
  right: 10px;
  bottom: calc(96px + env(safe-area-inset-bottom, 0px));
  z-index: 1210;
  display: flex;
  align-items: flex-start;
  gap: 14px;
  padding: 18px 16px;
  border-radius: 18px;
  background: #fff;
  border: 1px solid #fdba74;
  box-shadow: 0 14px 44px rgba(15, 23, 42, 0.22);
  color: #1a1a1a;
}

.pwa-install-banner[hidden] {
  display: none !important;
}

.pwa-install-banner__icon {
  flex: 0 0 auto;
  width: 56px;
  height: 56px;
  border-radius: 14px;
  object-fit: cover;
  background: #fff7ed;
}

.pwa-install-banner__body {
  flex: 1 1 auto;
  min-width: 0;
}

.pwa-install-banner__title {
  margin: 0 0 6px;
  font-size: 1.2rem;
  font-weight: 800;
  line-height: 1.25;
}

.pwa-install-banner__text {
  margin: 0;
  font-size: 1.05rem;
  line-height: 1.4;
  color: #44403c;
}

.pwa-install-banner__actions {
  display: flex;
  flex-direction: column;
  gap: 8px;
  flex: 0 0 auto;
  align-items: stretch;
}

.pwa-install-banner__cta {
  appearance: none;
  border: 0;
  border-radius: 12px;
  padding: 0.7rem 1rem;
  background: #ea580c;
  color: #fff;
  font: inherit;
  font-size: 1rem;
  font-weight: 800;
  cursor: pointer;
  white-space: nowrap;
}

.pwa-install-banner__cta:hover {
  background: #c2410c;
}

.pwa-install-banner__dismiss {
  appearance: none;
  border: 0;
  background: transparent;
  color: #78716c;
  font: inherit;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  padding: 0.3rem;
}

.pwa-install-banner__dismiss:hover {
  color: #1c1917;
}

@media (min-width: 769px) {
  .pwa-install-banner {
    display: none !important;
  }
}

html.is-pwa-standalone .pwa-install-banner {
  display: none !important;
}

/* Favorites (PWA) + search hit scroll */
.office-fav-btn {
  display: none;
  appearance: none;
  border: 0;
  outline: none;
  background: transparent;
  box-shadow: none;
  color: #a8a29e;
  width: 44px;
  height: 44px;
  border-radius: 0;
  cursor: pointer;
  align-items: center;
  justify-content: center;
  padding: 0;
  z-index: 2;
}

.office-fav-btn:focus,
.office-fav-btn:focus-visible {
  outline: none;
  box-shadow: none;
}

.office-fav-btn__icon {
  font-size: 1.45rem;
  line-height: 1;
}

.office-fav-btn.is-active {
  color: #ea580c;
  background: transparent;
}

.office-fav-btn--inline {
  width: 36px;
  height: 36px;
  box-shadow: none;
  background: transparent;
}

.product-list-card--exchange {
  position: relative;
}

.product-list-card--exchange .office-fav-btn {
  position: absolute;
  top: 10px;
  right: 10px;
}

.office-name__top {
  display: flex;
  align-items: flex-start;
  gap: 8px;
}

.office-name__top > a {
  flex: 1 1 auto;
}

[data-office-id] {
  scroll-margin-top: 88px;
}

[data-office-id].is-search-hit {
  outline: 2px solid #ea580c;
  outline-offset: 3px;
  box-shadow: 0 0 0 6px rgba(234, 88, 12, 0.15);
  border-radius: 16px;
}

.pwa-favorites {
  display: none;
  margin: 0 0 16px;
  padding: 14px 14px 10px;
  border-radius: 16px;
  background: #fff7ed;
  border: 1px solid #fdba74;
}

.pwa-favorites[hidden] {
  display: none !important;
}

.pwa-favorites__title {
  margin: 0 0 10px;
  font-size: 1.05rem;
  font-weight: 800;
  color: #9a3412;
}

.pwa-favorites__list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.pwa-favorites__item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
  border-radius: 12px;
  background: #fff;
  border: 1px solid #fed7aa;
}

.pwa-favorites__link {
  flex: 1 1 auto;
  min-width: 0;
  font-weight: 700;
  font-size: 1rem;
  color: #1a1a1a;
  text-decoration: none;
}

.pwa-favorites__link:hover {
  color: #ea580c;
}

.pwa-favorites__remove {
  appearance: none;
  border: 0;
  background: transparent;
  color: #a8a29e;
  font-size: 1.4rem;
  line-height: 1;
  cursor: pointer;
  padding: 0 4px;
}

html.is-pwa-standalone .office-fav-btn,
html.is-pwa-favorites .office-fav-btn {
  display: inline-flex;
}

html.is-pwa-standalone .pwa-favorites:not([hidden]) {
  display: block;
}

@media (display-mode: standalone) {
  .office-fav-btn {
    display: inline-flex;
  }

  .pwa-favorites:not([hidden]) {
    display: block;
  }
}

/* PWA listing cards — moderate size (layout-safe) */
html.is-pwa-standalone .exchange-offices-mobile .product-list-card--exchange {
  padding: 20px 18px;
}

html.is-pwa-standalone .exchange-offices-mobile .product-list-card__org-title {
  font-size: 1.2rem !important;
  line-height: 1.35 !important;
  font-weight: 800;
}

html.is-pwa-standalone .exchange-offices-mobile .product-list-card__address {
  font-size: 0.95rem !important;
  line-height: 1.45 !important;
}

html.is-pwa-standalone .exchange-offices-mobile .exchange-rate-tiles__currency {
  grid-template-columns: 84px 1fr !important;
  padding: 12px 14px !important;
}

html.is-pwa-standalone .exchange-offices-mobile .exchange-rate-tiles__code {
  font-size: 0.95rem !important;
}

html.is-pwa-standalone .exchange-offices-mobile .exchange-rate-tiles__value small,
html.is-pwa-standalone .exchange-offices-mobile .exchange-rate-tiles__value small.rate-flow {
  font-size: 0.9rem !important;
}

html.is-pwa-standalone .exchange-offices-mobile .exchange-rate-tiles__value strong {
  font-size: 1.45rem !important;
  line-height: 1.1 !important;
  font-weight: 800;
}

/* PWA office detail page — larger content */
html.is-pwa-standalone .entity-profile--exchange .exchange-hero__title h1 {
  font-size: 1.75rem !important;
  line-height: 1.2 !important;
  font-weight: 800;
}

html.is-pwa-standalone .entity-profile--exchange .entity-hero__eyebrow {
  font-size: 0.95rem !important;
}

html.is-pwa-standalone .entity-profile--exchange .exchange-hero__badge {
  font-size: 0.85rem !important;
  padding: 6px 12px;
}

html.is-pwa-standalone .entity-profile--exchange .exchange-hero__spotlight {
  min-width: 0;
  width: 100%;
  padding: 16px 18px;
  gap: 12px;
}

html.is-pwa-standalone .entity-profile--exchange .exchange-hero__spotlight-code {
  font-size: 1rem !important;
}

html.is-pwa-standalone .entity-profile--exchange .exchange-hero__spotlight-label {
  font-size: 0.9rem !important;
}

html.is-pwa-standalone .entity-profile--exchange .exchange-hero__spotlight-rate {
  padding: 12px 14px;
  gap: 4px;
}

html.is-pwa-standalone .entity-profile--exchange .exchange-hero__spotlight-rate strong {
  font-size: 1.7rem !important;
  line-height: 1.1 !important;
}

html.is-pwa-standalone .entity-profile--exchange .exchange-spotlights {
  grid-template-columns: 1fr !important;
  gap: 14px;
}

html.is-pwa-standalone .entity-profile--exchange .exchange-spotlights--panel .exchange-hero__spotlight {
  padding: 18px 18px;
}

html.is-pwa-standalone .entity-profile--exchange .exchange-hero__chip {
  font-size: 1.1rem !important;
  line-height: 1.4;
  padding: 14px 16px;
  min-height: 52px;
}

html.is-pwa-standalone .entity-profile--exchange .exchange-hero__chip-route {
  font-size: 1rem !important;
}

html.is-pwa-standalone .entity-profile--exchange .exchange-hero__chip-icon svg {
  width: 20px;
  height: 20px;
}

html.is-pwa-standalone .entity-profile--exchange .entity-panel__title,
html.is-pwa-standalone .entity-profile--exchange .entity-panel-head__title {
  font-size: 1.35rem !important;
}

html.is-pwa-standalone .entity-profile--exchange .entity-facts dt {
  font-size: 1rem !important;
}

html.is-pwa-standalone .entity-profile--exchange .entity-facts dd {
  font-size: 1.15rem !important;
}

@media (display-mode: standalone) {
  .exchange-offices-mobile .product-list-card__org-title {
    font-size: 1.2rem !important;
  }

  .exchange-offices-mobile .exchange-rate-tiles__value strong {
    font-size: 1.45rem !important;
  }

  .entity-profile--exchange .exchange-hero__title h1 {
    font-size: 1.75rem !important;
  }

  .entity-profile--exchange .exchange-hero__spotlight-rate strong {
    font-size: 1.7rem !important;
  }

  .entity-profile--exchange .exchange-hero__chip {
    font-size: 1.1rem !important;
  }

  .entity-profile--exchange .exchange-spotlights {
    grid-template-columns: 1fr !important;
  }
}

/* PWA: larger modal text (best offices + rates) */
html.is-pwa-standalone .best-offices-modal__dialog {
  max-width: 100%;
  max-height: 88vh;
  border-radius: 18px;
}

html.is-pwa-standalone .best-offices-modal__header {
  padding: 18px 20px;
}

html.is-pwa-standalone .best-offices-modal__title {
  font-size: 1.35rem !important;
  line-height: 1.25;
}

html.is-pwa-standalone .best-offices-modal__close {
  font-size: 2rem !important;
  padding: 6px 10px;
}

html.is-pwa-standalone .best-offices-modal__body {
  padding: 16px 18px 22px;
}

html.is-pwa-standalone .best-offices-modal__subtitle {
  font-size: 1.1rem !important;
  padding: 12px 14px;
  line-height: 1.4;
}

html.is-pwa-standalone .best-offices-modal__item {
  padding: 16px 18px;
  border-radius: 14px;
}

html.is-pwa-standalone .best-offices-modal__name {
  font-size: 1.2rem !important;
  font-weight: 800;
  line-height: 1.3;
}

html.is-pwa-standalone .best-offices-modal__best {
  font-size: 0.85rem !important;
  padding: 4px 10px;
}

html.is-pwa-standalone .best-offices-modal__rate {
  font-size: 1.2rem !important;
}

html.is-pwa-standalone .best-offices-modal__rate strong {
  font-size: 1.55rem !important;
}

html.is-pwa-standalone .best-offices-modal__calc {
  font-size: 1.1rem !important;
}

html.is-pwa-standalone .best-offices-modal__calc strong {
  font-size: 1.25rem !important;
}

html.is-pwa-standalone .best-offices-modal__addr {
  font-size: 1.05rem !important;
  line-height: 1.4;
  margin-top: 6px;
}

html.is-pwa-standalone .best-offices-modal__empty,
html.is-pwa-standalone .best-offices-modal__loading {
  font-size: 1.15rem !important;
}

html.is-pwa-standalone .rates-modal__title {
  font-size: 1.35rem !important;
}

html.is-pwa-standalone .rates-modal__panel {
  font-size: 1.1rem;
}

@media (display-mode: standalone) {
  .best-offices-modal__title {
    font-size: 1.35rem !important;
  }

  .best-offices-modal__name {
    font-size: 1.2rem !important;
  }

  .best-offices-modal__rate strong {
    font-size: 1.55rem !important;
  }

  .best-offices-modal__addr {
    font-size: 1.05rem !important;
  }

  .best-offices-modal__subtitle {
    font-size: 1.1rem !important;
  }
}
