/* Shared responsive polish for the public site and logged-in app. */
:root {
  --app-surface-radius: 14px;
  --app-safe-bottom: env(safe-area-inset-bottom, 0px);
}

html {
  min-height: 100%;
  -webkit-text-size-adjust: 100%;
  scroll-padding-top: calc(var(--topbar-height, 0px) + 1rem);
}

body:not(.hr) {
  min-height: 100vh;
  min-height: 100dvh;
}

body.hr {
  min-height: 100vh;
  min-height: 100dvh;
  padding-bottom: var(--app-safe-bottom);
}

button,
a,
input,
select,
textarea {
  -webkit-tap-highlight-color: transparent;
}

:focus-visible {
  outline: 3px solid rgba(212, 175, 55, 0.9);
  outline-offset: 2px;
}

.card {
  border-radius: var(--app-surface-radius);
}

.card-header:first-child {
  border-radius: var(--app-surface-radius) var(--app-surface-radius) 0 0;
}

.pwa-install-help {
  display: block;
  max-width: 22rem;
  margin-top: 0.35rem;
  color: var(--text-muted, #64748b);
  font-size: 0.75rem;
  line-height: 1.4;
}

[data-pwa-install][hidden] {
  display: none !important;
}

@media (max-width: 992px) {
  body:not(.hr) > footer {
    margin-left: 0 !important;
    padding-bottom: calc(1rem + var(--app-safe-bottom));
  }
}

@media (max-width: 768px) {
  #main-content {
    padding: 1rem 0.75rem;
  }

  .page-header {
    align-items: flex-start;
    margin-bottom: 1rem;
  }

  .page-title {
    font-size: 1.15rem;
  }

  .card-body {
    padding: 1rem;
  }

  .table-responsive {
    -webkit-overflow-scrolling: touch;
  }

}

@media (max-width: 575.98px) {
  #topbar {
    padding-inline: 0.65rem;
  }

  .topbar-left {
    min-width: 0;
    gap: 0.4rem;
  }

  .topbar-left > a {
    margin-right: 0 !important;
  }

  .topbar-right {
    gap: 0.2rem;
  }

  .topbar-right .pwa-install-help {
    position: fixed;
    right: 0.75rem;
    top: calc(var(--topbar-height) + 0.5rem);
    z-index: 1090;
    max-width: calc(100vw - 1.5rem);
    padding: 0.65rem 0.8rem;
    border: 1px solid var(--border-color);
    border-radius: 0.6rem;
    background: #fff;
    box-shadow: var(--shadow-md);
  }

  #main-content {
    padding: 0.85rem 0.65rem;
  }

  body:not(.hr) .form-control,
  body:not(.hr) .form-select {
    font-size: 16px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
