.tarvi-pwa-notices {
  position: fixed;
  z-index: 80;
  left: max(12px, env(safe-area-inset-left, 0px));
  right: max(12px, env(safe-area-inset-right, 0px));
  bottom: calc(78px + env(safe-area-inset-bottom, 0px));
  display: grid;
  gap: 8px;
  pointer-events: none;
}

.tarvi-pwa-banner {
  pointer-events: auto;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  padding: 12px 14px;
  border: 1px solid rgba(145, 167, 214, 0.3);
  border-radius: 16px;
  background: rgba(8, 16, 31, 0.96);
  color: #f5f6f8;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.35);
}

.tarvi-pwa-banner[hidden] {
  display: none;
}

.tarvi-pwa-banner p {
  margin: 0;
  flex: 1 1 180px;
  font-size: 13px;
  line-height: 1.35;
}

.tarvi-pwa-banner button {
  min-height: 44px;
  min-width: 44px;
  padding: 0 14px;
  border-radius: 12px;
  border: 1px solid rgba(145, 167, 214, 0.3);
  background: #101a2d;
  color: #f5f6f8;
  font-size: 13px;
}

.tarvi-pwa-banner button.tarvi-pwa-primary {
  border-color: transparent;
  background: linear-gradient(135deg, #00d4b4 0%, #2962ff 52%, #9c4dff 100%);
  color: #fff;
}

.tarvi-pwa-file-proxy {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

#tarvi-pwa-keyboard-probe {
  position: absolute;
  width: 0;
  height: 0;
  overflow: hidden;
  pointer-events: none;
  --tarvi-keyboard-inset: env(keyboard-inset-bottom, 0px);
}

@media (min-width: 721px) {
  .tarvi-pwa-notices {
    left: auto;
    width: min(420px, calc(100vw - 24px));
    bottom: max(18px, env(safe-area-inset-bottom, 0px));
  }
}

@media (max-width: 720px) {
  body .app-shell {
    height: 100dvh;
    padding-bottom: calc(63px + env(safe-area-inset-bottom, 0px));
  }

  body .workspace {
    bottom: calc(63px + env(safe-area-inset-bottom, 0px));
  }

  body .mobile-nav {
    height: calc(63px + env(safe-area-inset-bottom, 0px));
    padding-bottom: env(safe-area-inset-bottom, 0px);
  }

  body .composer {
    padding-bottom: max(12px, env(safe-area-inset-bottom, 0px));
  }

  body .composer-tool,
  body .send-button {
    width: 44px;
    height: 44px;
    min-width: 44px;
    min-height: 44px;
  }

  body .composer-input-wrap textarea {
    font-size: 16px;
  }

  body.tarvi-pwa-keyboard .mobile-nav {
    display: none;
  }

  body.tarvi-pwa-keyboard .app-shell {
    padding-bottom: env(keyboard-inset-bottom, 0px);
  }

  body.tarvi-pwa-keyboard .workspace {
    bottom: env(keyboard-inset-bottom, 0px);
  }

  body.tarvi-pwa-keyboard .composer {
    padding-bottom: max(12px, env(keyboard-inset-bottom, 0px));
  }

  body.tarvi-pwa-keyboard .tarvi-pwa-notices {
    bottom: calc(12px + env(keyboard-inset-bottom, 0px));
  }
}

@media (min-width: 768px) and (max-width: 1024px) {
  body .app-shell {
    height: 100dvh;
    grid-template-columns: 76px minmax(240px, 320px) minmax(0, 1fr);
    padding-bottom: env(safe-area-inset-bottom, 0px);
  }

  body .nav-rail {
    display: flex;
  }

  body .mobile-nav {
    display: none;
  }

  body .composer-tool,
  body .send-button {
    width: 44px;
    height: 44px;
    min-width: 44px;
    min-height: 44px;
  }
}

html.tarvi-pwa-standalone .prototype-banner {
  display: none;
}

html.tarvi-pwa-standalone body .app-shell {
  height: 100dvh;
}
