/* Poyacity shared platform enhancement layer — web, PWA and native shells. */
:root {
  --poya-title-page: clamp(1.55rem, 2.1vw + .45rem, 2.35rem);
  --poya-title-section: clamp(1.22rem, 1.25vw + .55rem, 1.72rem);
  --poya-title-card: clamp(1rem, .65vw + .72rem, 1.28rem);
  --poya-title-compact: clamp(.92rem, .42vw + .76rem, 1.12rem);
  --poya-leading-title: 1.28;
}

:where(h1, .hero h1, .content-hero h1, .page-title, .dashboard-title, .form-title, .app-heading h1, .native-screen-header h2) {
  max-inline-size: 100%;
  font-size: var(--poya-title-page) !important;
  line-height: var(--poya-leading-title) !important;
  letter-spacing: -.015em;
  text-wrap: balance;
  overflow-wrap: anywhere;
}

:where(h2, .section-title, .card-heading h2, .app-greeting h2, .app-section-title h3) {
  font-size: var(--poya-title-section) !important;
  line-height: 1.38 !important;
  text-wrap: balance;
  overflow-wrap: anywhere;
}

:where(h3, .card h3, .admin-capability-card h2, .dashboard-card h3, .chart-card h3, .map-card h3) {
  font-size: var(--poya-title-card) !important;
  line-height: 1.42 !important;
  text-wrap: pretty;
  overflow-wrap: anywhere;
}

:where(.app-topbar .app-heading h1, .content-topbar .content-brand span, .form-header-title, .compact h3) {
  font-size: var(--poya-title-compact) !important;
}

.hero h1 {
  margin-block: .35rem .45rem;
}

.content-hero,
.dashboard-header,
.form-header-content,
.native-screen-header {
  min-inline-size: 0;
}

/* The public store hydrates a large workspace asynchronously. Reserve the
   viewport slot before hydration so the footer never jumps through the
   visible viewport. This selector is Web-page scoped and does not match the
   frozen native app shell. */
body.data-store-page [data-urban-data-store-page] {
  min-block-size: clamp(620px, 72vh, 860px);
}

.poya-network-state {
  position: fixed;
  z-index: 8400;
  inset-inline-end: max(12px, env(safe-area-inset-right));
  inset-block-end: max(12px, calc(env(safe-area-inset-bottom) + 12px));
  max-inline-size: min(340px, calc(100vw - 24px));
  padding: 8px 12px;
  border: 1px solid rgba(255,255,255,.38);
  border-radius: 999px;
  background: rgba(20,32,51,.9);
  color: #fff;
  box-shadow: 0 10px 30px rgba(8,47,73,.2);
  font-size: .82rem;
  backdrop-filter: blur(12px);
}

.poya-network-state[data-online="true"] { display: none; }

.admin-module-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 260px), 1fr));
  gap: 14px;
}

.admin-module {
  min-inline-size: 0;
  padding: 16px;
  border: 1px solid var(--poya-border, #dce6ef);
  border-radius: 18px;
  background: #fff;
  box-shadow: var(--poya-shadow-sm, 0 4px 16px rgba(20,46,72,.06));
}

.admin-module[data-available="false"] { opacity: .76; }
.admin-module h3 { margin-block: 0 8px; }
.admin-module-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-block-start: 12px; }
.admin-module-output { max-block-size: 360px; overflow: auto; white-space: pre-wrap; }

@media (max-width: 680px) {
  :root {
    --poya-title-page: clamp(1.38rem, 6vw, 1.82rem);
    --poya-title-section: clamp(1.12rem, 4.8vw, 1.45rem);
    --poya-title-card: clamp(.98rem, 4vw, 1.18rem);
  }

  .hero h1 { margin-block: .2rem .35rem; }
}

@media (prefers-reduced-motion: reduce) {
}
