
:root {
  --crm-safe-top: env(safe-area-inset-top, 0px);
  --crm-safe-right: env(safe-area-inset-right, 0px);
  --crm-safe-bottom: env(safe-area-inset-bottom, 0px);
  --crm-safe-left: env(safe-area-inset-left, 0px);
}

html.crm-standalone,
html.crm-standalone body {
  overscroll-behavior-y: none;
}

.crm-pwa-install-hint {
  display: none;
}

@media (display-mode: standalone) {
  html,
  body {
    min-height: 100dvh;
    background: #f4f7fb;
  }

  body {
    padding-top: var(--crm-safe-top);
    padding-right: var(--crm-safe-right);
    padding-bottom: var(--crm-safe-bottom);
    padding-left: var(--crm-safe-left);
  }

  .crm-public-shell,
  .mobile-toolbar {
    padding-top: calc(var(--crm-safe-top) + 8px);
  }

  .layout {
    min-height: calc(100dvh - var(--crm-safe-top) - var(--crm-safe-bottom));
  }
}

html.crm-standalone body.crm-device-mobile {
  background: linear-gradient(180deg, #f7f9fd 0%, #eef3fb 100%);
}

html.crm-standalone body.crm-device-mobile .wrap {
  padding-top: 8px;
}

html.crm-standalone body.crm-device-mobile .mobile-toolbar {
  position: sticky;
  top: 0;
  z-index: 120;
  backdrop-filter: saturate(1.2) blur(12px);
  background: rgba(244, 247, 252, .86);
  border-bottom: 1px solid rgba(216, 227, 242, .9);
  padding-bottom: 10px;
}

html.crm-standalone body.crm-device-mobile .mobile-toolbar-icon {
  display: none;
}

html.crm-standalone body.crm-device-mobile .mobile-toolbar-title {
  min-height: 46px;
  border-radius: 16px;
}

html.crm-standalone body.crm-device-mobile .mobile-bottom-nav,
html.crm-standalone body.crm-device-mobile .mobile-quick-nav {
  left: 0;
  right: 0;
  bottom: 0;
  width: 100%;
  margin: 0;
  padding-top: 10px;
  padding-left: 12px;
  padding-right: 12px;
  padding-bottom: max(10px, var(--crm-safe-bottom));
  border-radius: 28px 28px 0 0;
  border-left: none;
  border-right: none;
  border-bottom: none;
  background: rgba(255,255,255,.992);
  backdrop-filter: blur(22px);
  -webkit-backdrop-filter: blur(22px);
  box-shadow: 0 -12px 34px rgba(15,23,42,.11);
}

html.crm-standalone body.crm-device-mobile .mobile-quick-nav__item,
html.crm-standalone body.crm-device-mobile .mobile-bottom-nav a {
  min-height: 54px;
}

html.crm-standalone body.crm-device-mobile .card,
html.crm-standalone body.crm-device-mobile .project-card,
html.crm-standalone body.crm-device-mobile .estimate-view-shell,
html.crm-standalone body.crm-device-mobile .crm-public-box {
  border-radius: 18px;
  box-shadow: 0 10px 24px rgba(15,23,42,.05);
}

html.crm-standalone body.crm-device-mobile .sidebar,
html.crm-standalone body.crm-device-mobile .mobile-sidebar-backdrop {
  top: var(--crm-safe-top);
}

html.crm-standalone .crm-public-box,
html.crm-standalone .card,
html.crm-standalone .project-card,
html.crm-standalone .estimate-view-shell {
  -webkit-touch-callout: none;
}

body.crm-device-mobile.crm-browser-tab .crm-pwa-install-hint,
body.crm-device-mobile.crm-launch-pwa .crm-pwa-install-hint {
  display: flex;
}

body.crm-device-mobile.crm-standalone .crm-pwa-install-hint {
  display: none !important;
}

.crm-pwa-install-hint {
  align-items: flex-start;
  gap: 12px;
  margin: 0 0 12px;
  padding: 14px 14px 12px;
  border: 1px solid rgba(216, 227, 242, .95);
  border-radius: 18px;
  background: linear-gradient(180deg, rgba(255,255,255,.98) 0%, rgba(248,250,255,.98) 100%);
  box-shadow: 0 12px 28px rgba(15,23,42,.08);
}

.crm-pwa-install-hint__icon {
  width: 42px;
  height: 42px;
  border-radius: 14px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(180deg,#2f5bea 0%,#254edb 100%);
  color: #fff;
  font-size: 20px;
  font-weight: 800;
  flex: 0 0 42px;
}

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

.crm-pwa-install-hint__title {
  margin: 0 0 4px;
  font-size: 15px;
  line-height: 1.25;
  font-weight: 800;
  color: #0f172a;
}

.crm-pwa-install-hint__text {
  margin: 0;
  color: #475569;
  font-size: 13px;
  line-height: 1.45;
}

.crm-pwa-install-hint__chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 10px;
}

.crm-pwa-install-hint__chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 28px;
  padding: 0 10px;
  border-radius: 999px;
  border: 1px solid rgba(203,213,225,.95);
  background: #fff;
  color: #334155;
  font-size: 12px;
  font-weight: 700;
}

.crm-pwa-install-hint__close {
  flex: 0 0 auto;
  min-height: 36px;
  padding: 0 12px;
  border: 1px solid rgba(216,227,242,.95);
  border-radius: 12px;
  background: #fff;
  color: #334155;
  font: inherit;
  font-size: 12px;
  font-weight: 800;
}

@media (max-width: 720px) {
  .crm-pwa-install-hint {
    padding: 12px;
    gap: 10px;
    border-radius: 16px;
  }

  .crm-pwa-install-hint__close {
    padding: 0 10px;
  }
}



html.crm-standalone body.crm-device-mobile {
  padding-bottom: 0 !important;
}

html.crm-standalone body.crm-device-mobile .main {
  background: transparent;
}

html.crm-standalone body.crm-device-mobile .wrap {
  padding-top: 6px;
  padding-bottom: calc(118px + var(--crm-safe-bottom));
}

html.crm-standalone body.crm-device-mobile .app-footer {
  display: none;
}

html.crm-standalone body.crm-device-mobile .flash {
  border-radius: 16px;
  box-shadow: 0 10px 20px rgba(15,23,42,.06);
}

html.crm-standalone body.crm-device-mobile .mobile-toolbar {
  padding-top: calc(var(--crm-safe-top) + 6px);
  margin-bottom: 10px;
}

html.crm-standalone body.crm-device-mobile .mobile-toolbar-title {
  min-height: 52px;
  align-items: flex-start;
  justify-content: center;
  padding-top: 8px;
  padding-bottom: 8px;
}

html.crm-standalone body.crm-device-mobile .mobile-toolbar-title__app {
  display: block;
  font-size: 11px;
  line-height: 1.2;
  font-weight: 800;
  letter-spacing: .04em;
  text-transform: uppercase;
  color: #64748b;
  margin-bottom: 2px;
}

html.crm-standalone body.crm-device-mobile .mobile-toolbar-title__section {
  display: block;
  font-size: 18px;
  line-height: 1.2;
}

html.crm-standalone body.crm-device-mobile .card,
html.crm-standalone body.crm-device-mobile .project-card,
html.crm-standalone body.crm-device-mobile .estimate-view-shell,
html.crm-standalone body.crm-device-mobile .crm-public-box {
  border-radius: 20px;
  box-shadow: 0 14px 30px rgba(15,23,42,.06);
  border-color: rgba(216, 227, 242, .95);
}

html.crm-standalone body.crm-device-mobile .mobile-quick-nav {
  box-shadow: 0 16px 34px rgba(15,23,42,.12);
}

html.crm-standalone body.crm-device-mobile .mobile-bottom-nav a {
  min-height: 58px;
  padding-top: 8px;
  padding-bottom: 8px;
}


html.crm-standalone body.crm-device-mobile .mobile-quick-nav__item.is-active,
html.crm-standalone body.crm-device-mobile .mobile-bottom-nav a.active {
  transform: translateY(-1px);
}


html.crm-standalone body.crm-device-mobile .mobile-bottom-nav::before,
html.crm-standalone body.crm-device-mobile .mobile-quick-nav::before {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  bottom: calc(-1 * var(--crm-safe-bottom));
  height: calc(var(--crm-safe-bottom) + 2px);
  background: rgba(255,255,255,.992);
  pointer-events: none;
}

html.crm-standalone body.crm-device-mobile .mobile-bottom-nav {
  min-height: calc(82px + var(--crm-safe-bottom));
  align-items: start;
}

html.crm-standalone body.crm-device-mobile .mobile-bottom-nav a {
  min-height: 62px;
  padding-top: 10px;
  padding-bottom: 6px;
}

html.crm-standalone body.crm-device-mobile .mobile-bottom-nav a .icon {
  margin-bottom: 2px;
}

.crm-app-launch-screen {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: radial-gradient(circle at top, rgba(47,91,234,.22) 0%, rgba(15,23,42,.08) 26%, #f4f7fb 62%, #eef3fb 100%);
  opacity: 0;
  pointer-events: none;
  transition: opacity .24s ease;
}

.crm-app-launch-screen.is-visible {
  display: flex;
  opacity: 1;
}

.crm-app-launch-screen.is-hidden {
  opacity: 0;
}

.crm-app-launch-screen__card {
  width: min(100%, 320px);
  border-radius: 28px;
  padding: 26px 22px;
  text-align: center;
  background: rgba(255,255,255,.92);
  border: 1px solid rgba(216,227,242,.98);
  box-shadow: 0 24px 50px rgba(15,23,42,.16);
  backdrop-filter: blur(18px);
}

.crm-app-launch-screen__icon {
  width: 84px;
  height: 84px;
  margin: 0 auto 14px;
  border-radius: 22px;
  background: linear-gradient(180deg,#2f5bea 0%,#254edb 100%);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 28px;
  font-weight: 900;
  letter-spacing: .03em;
  box-shadow: 0 14px 30px rgba(47,91,234,.35);
}

.crm-app-launch-screen__title {
  margin: 0 0 6px;
  font-size: 19px;
  line-height: 1.2;
  font-weight: 900;
  color: #0f172a;
}

.crm-app-launch-screen__subtitle {
  margin: 0;
  font-size: 13px;
  line-height: 1.45;
  color: #64748b;
}

.crm-app-launch-screen__dots {
  display: inline-flex;
  gap: 6px;
  margin-top: 16px;
}

.crm-app-launch-screen__dots span {
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: rgba(47,91,234,.24);
  animation: crm-app-launch-dot 1.1s infinite ease-in-out;
}

.crm-app-launch-screen__dots span:nth-child(2) { animation-delay: .15s; }
.crm-app-launch-screen__dots span:nth-child(3) { animation-delay: .3s; }

@keyframes crm-app-launch-dot {
  0%, 80%, 100% { transform: scale(.72); opacity: .38; }
  40% { transform: scale(1); opacity: 1; }
}
