:root { --admin-bottom-gap: env(safe-area-inset-bottom, 0px); }
body { min-height: 100vh; min-height: 100dvh; background: #f4f6f9; }
.admin-container { max-width: 1500px; margin-inline: auto; }
main.admin-container { padding-bottom: calc(2rem + var(--admin-bottom-gap)); }
.card, .modal-content { --bs-card-border-color: #dee2e6; --bs-card-border-radius: .85rem; }
.card-header, .card-footer { background: var(--bs-white); }
.btn:not(.btn-close), .nav-link, .page-link { min-height: 44px; display: inline-flex; align-items: center; justify-content: center; }
.form-control, .form-select { min-height: 44px; }
.form-label { font-weight: 600; }
summary { min-height: 44px; padding-block: .5rem; cursor: pointer; }
.form-check { min-height: 44px; display: flex; gap: .65rem; align-items: center; }
.form-check-input { flex-shrink: 0; width: 1.25em; height: 1.25em; }
.form-check-label { cursor: pointer; }
.form-actions { display: flex; gap: .5rem; flex-wrap: wrap; }
.min-width-0 { min-width: 0; }
.text-key, .small-mono, .json-editor { font-family: ui-monospace, SFMono-Regular, Consolas, monospace; overflow-wrap: anywhere; }
.text-key { font-size: .875rem; }
.user-table { table-layout: fixed; }
.user-table th:nth-child(1) { width: 23%; }
.user-table th:nth-child(2) { width: 24%; }
.user-table th:nth-child(3) { width: 27%; }
.user-table th:nth-child(4) { width: 26%; }
.user-table td { padding: 1rem; vertical-align: top; overflow-wrap: anywhere; }
.user-table th { padding: 1rem; }
.user-table details summary { cursor: pointer; min-height: 44px; }
.user-table .btn { white-space: normal; }
.badge { white-space: normal; overflow-wrap: anywhere; line-height: 1.4; }
.user-status { white-space: normal; text-align: left; line-height: 1.5; }
.login-shell { min-height: 100dvh; display: grid; place-items: center; padding: max(1.25rem, env(safe-area-inset-top)) 1rem max(1.25rem, var(--admin-bottom-gap)); }
.login-card { width: 100%; max-width: 440px; }
.app-card { overflow: hidden; }
.app-icon { width: 52px; height: 52px; flex-shrink: 0; object-fit: cover; border-radius: .7rem; background: #eef1f5; }
.app-placeholder { display: grid; place-items: center; font-size: .75rem; color: #6c757d; }
.app-description { color: #5c6670; font-size: .9rem; overflow-wrap: anywhere; white-space: pre-line; }
.app-summary { display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.app-fields { background: #fbfcfe; }
.extra-json { min-height: 220px; }
.category-row { display: flex; gap: .5rem; align-items: center; }
.category-row .form-control { min-width: 0; }
.editor-savebar { position: sticky; bottom: 0; z-index: 1020; padding-bottom: calc(.75rem + var(--admin-bottom-gap)); background: #fff; border-top: 1px solid #dee2e6; box-shadow: 0 -4px 16px #00000008; }
.modal-footer { padding-bottom: calc(.75rem + var(--admin-bottom-gap)); }
.admin-toast { z-index: 1090; padding-bottom: calc(1rem + var(--admin-bottom-gap)) !important; }
.scroll-anchor, [id^="app-"] { scroll-margin-top: 1rem; }
pre { white-space: pre-wrap; overflow-wrap: anywhere; }
[aria-busy="true"] { cursor: progress; }
form[data-submitting="true"] button[type="submit"] { pointer-events: none; opacity: .65; }
@media (max-width: 767.98px) {
  .admin-nav { width: 100%; }
  .admin-nav .nav-item { flex: 1; }
  .admin-nav .nav-link { width: 100%; padding-inline: .5rem; font-size: .9rem; }
  .form-control, .form-select { font-size: 16px; } /* Prevent keyboard zoom on iOS. */
  .form-actions { width: 100%; }
  .form-actions > .btn, .form-actions > form { flex: 1 1 100%; }
  .form-actions > form > .btn { width: 100%; }
  .user-table, .user-table tbody, .user-table tr, .user-table td { display: block; width: 100%; }
  .user-table { margin: 0; }
  .user-table thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
  .user-table tbody { display: grid; gap: 1rem; padding: .75rem; }
  .user-table tr { border: 1px solid #dee2e6; border-radius: .75rem; background: white; overflow: hidden; }
  .user-table td { border: 0; padding: .75rem 1rem; box-shadow: none !important; }
  .user-table td + td { border-top: 1px solid #f0f1f3; }
  .user-table td[data-label]::before { content: attr(data-label); display: block; color: #6c757d; font-size: .75rem; font-weight: 600; margin-bottom: .35rem; }
  .user-table .user-actions { display: flex; gap: .5rem; }
  .user-table .user-actions > * { flex: 1; }
  .user-table .user-actions form .btn { width: 100%; }
  .app-icon { width: 44px; height: 44px; }
  .appstore-input { display: grid; gap: .5rem; }
  .appstore-input > .form-control, .appstore-input > .btn { width: 100%; border-radius: var(--bs-border-radius) !important; }
  .editor-savebar .btn { flex: 1; }
  .pagination { gap: .25rem; }
  .page-link { min-width: 44px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; }
}
