/**
 * Manage Data hub + records chrome — matches design-playground ManageDataScreen.
 */
body.legacy-page-index {
  font-family: Kanit, system-ui, -apple-system, sans-serif;
}

body.legacy-page-index.manage-data-hub-mode,
body.legacy-page-index.manage-data-records-mode {
  padding-bottom: calc(5rem + var(--mobile-app-safe-bottom, 0px));
}

:root {
  --pg-hero-pink: linear-gradient(135deg, #ffd9e2 0%, var(--ci-pink) 55%, #ffc8d6 100%);
  --pg-surface: #ffffff;
  --pg-surface-soft: #fffafb;
  --pg-brand: #ed4f83;
  --pg-brand-pastel: #ffe8ef;
  --pg-ink-on-pink: #6b1332;
  --pg-ink-on-pink-soft: rgba(107, 19, 50, 0.82);
  --pg-ink-soft: #8a6470;
  --pg-shadow: 0 8px 24px rgba(237, 79, 131, 0.12);
  --pg-shadow-soft: 0 4px 14px rgba(61, 40, 48, 0.06);
  --pg-radius-card: 1.25rem;
  --pg-radius-lg: 1.5rem;
  --pg-radius-sm: 0.9rem;
}

body.legacy-page-index .container.data-hub,
body.legacy-page-index .container.data-records-page {
  width: min(1040px, calc(100% - 1.5rem));
  margin: 0 auto;
  padding: 0.75rem 0 1.25rem;
}

@media (min-width: 768px) {
  body.legacy-page-index .container.data-hub,
  body.legacy-page-index .container.data-records-page {
    width: min(1040px, calc(100% - 2rem));
    padding: 0.85rem 0 1.25rem;
  }
}

body.legacy-page-index.has-mobile-app-topbar .container.data-hub,
body.legacy-page-index.has-mobile-app-topbar .container.data-records-page {
  padding-top: 0.35rem;
}

/* ---------- Hero ---------- */

body.legacy-page-index .app-hero {
  position: relative;
  overflow: hidden;
  display: grid;
  gap: 1rem;
  padding: 1.15rem 1.15rem 1.25rem;
  border-radius: var(--pg-radius-lg);
  color: var(--pg-ink-on-pink);
  background: var(--pg-hero-pink);
  box-shadow: var(--pg-shadow);
}

body.legacy-page-index .app-hero::before,
body.legacy-page-index .app-hero::after {
  position: absolute;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.4);
  content: "";
  pointer-events: none;
}

body.legacy-page-index .app-hero::before {
  top: -3.5rem;
  right: -2rem;
  width: 10rem;
  height: 10rem;
}

body.legacy-page-index .app-hero::after {
  right: 3.5rem;
  bottom: -3.5rem;
  width: 6rem;
  height: 6rem;
  background: rgba(255, 255, 255, 0.24);
}

body.legacy-page-index .app-hero-top {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.85rem;
}

body.legacy-page-index .app-hero-greeting {
  display: grid;
  gap: 0.15rem;
  min-width: 0;
}

body.legacy-page-index .app-hero-greeting small {
  color: var(--pg-ink-on-pink-soft);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

body.legacy-page-index .app-hero-greeting h1 {
  margin: 0;
  font-size: clamp(1.25rem, 5.5vw, 1.6rem);
  font-weight: 700;
  line-height: 1.25;
}

body.legacy-page-index .app-hero-greeting p {
  margin: 0;
  color: var(--pg-ink-on-pink-soft);
  font-size: 0.82rem;
}

body.legacy-page-index .app-hero-avatar {
  display: grid;
  place-items: center;
  width: 2.9rem;
  height: 2.9rem;
  flex: 0 0 auto;
  border-radius: 1rem;
  background: #ffffff;
  color: var(--pg-brand-deep);
  font-size: 1.35rem;
  box-shadow: 0 4px 14px rgba(61, 40, 48, 0.14);
}

body.legacy-page-index .app-hero-stats {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.5rem;
  padding: 0.65rem;
  border-radius: var(--pg-radius-card);
  background: rgba(255, 255, 255, 0.92);
}

body.legacy-page-index .app-hero-stat {
  display: grid;
  gap: 0.1rem;
  text-align: center;
}

body.legacy-page-index .app-hero-stat + .app-hero-stat {
  border-left: 1px solid rgba(107, 19, 50, 0.12);
}

body.legacy-page-index .app-hero-stat strong {
  color: var(--pg-ink-on-pink);
  font-size: 1.15rem;
  line-height: 1.2;
}

body.legacy-page-index .app-hero-stat span {
  color: var(--pg-ink-soft);
  font-size: 0.7rem;
  font-weight: 600;
}

/* ---------- Hub layout ---------- */

body.legacy-page-index .data-hub,
body.legacy-page-index .data-records-page {
  display: grid;
  gap: 1.1rem;
}

body.legacy-page-index .legacy-section {
  display: grid;
  gap: 0.55rem;
}

body.legacy-page-index .section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
}

body.legacy-page-index .section-head h2 {
  margin: 0;
  color: var(--pg-ink-strong);
  font-size: 1.05rem;
  font-weight: 700;
}

body.legacy-page-index .muted {
  color: var(--pg-muted);
}

/* ---------- Search ---------- */

body.legacy-page-index .data-search {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  min-height: 3rem;
  padding: 0 0.9rem;
  border: 1px solid var(--pg-border-strong);
  border-radius: 999px;
  background: var(--pg-surface-soft);
}

body.legacy-page-index .data-search:focus-within {
  border-color: var(--pg-brand);
  background: var(--pg-surface);
  box-shadow: 0 0 0 0.22rem rgba(237, 79, 131, 0.16);
}

body.legacy-page-index .data-search input {
  flex: 1;
  min-width: 0;
  border: 0;
  background: transparent;
  color: var(--pg-ink);
  font-size: 0.95rem;
  font-family: inherit;
}

body.legacy-page-index .data-search input:focus {
  outline: none;
  box-shadow: none;
}

body.legacy-page-index .data-search button {
  display: grid;
  place-items: center;
  width: 1.6rem;
  height: 1.6rem;
  border: 0;
  border-radius: 999px;
  background: var(--pg-brand-pastel);
  color: var(--pg-ink-on-pink);
  font-size: 0.7rem;
  cursor: pointer;
}

/* ---------- Recent chips ---------- */

body.legacy-page-index .data-recent-row {
  display: flex;
  gap: 0.5rem;
  overflow-x: auto;
  padding-bottom: 0.2rem;
  scrollbar-width: none;
}

body.legacy-page-index .data-recent-row::-webkit-scrollbar {
  display: none;
}

body.legacy-page-index .data-recent-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  flex: 0 0 auto;
  min-height: 2.4rem;
  border: 1px solid var(--pg-border-strong);
  border-radius: 999px;
  padding: 0 0.85rem;
  background: var(--pg-surface);
  color: var(--pg-ink);
  font-family: inherit;
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
}

body.legacy-page-index .data-recent-chip i {
  font-size: 1rem;
  font-style: normal;
}

body.legacy-page-index .data-recent-chip:active {
  transform: scale(0.98);
}

/* ---------- Collection tiles ---------- */

body.legacy-page-index .data-group-hint {
  margin: 0.1rem 0 0;
  font-size: 0.78rem;
}

body.legacy-page-index .data-tiles {
  display: grid;
  gap: 0.6rem;
}

body.legacy-page-index .data-tile {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  min-height: 4.2rem;
  padding: 0.75rem 0.85rem;
  border: 1px solid var(--pg-border);
  border-radius: var(--pg-radius-card);
  background: var(--pg-surface);
  color: var(--pg-ink);
  font-family: inherit;
  text-align: left;
  box-shadow: var(--pg-shadow-soft);
  cursor: pointer;
  transition: transform 0.16s ease;
}

body.legacy-page-index .data-tile:active {
  transform: scale(0.985);
}

body.legacy-page-index .data-tile-icon {
  display: grid;
  place-items: center;
  width: 2.6rem;
  height: 2.6rem;
  flex: 0 0 auto;
  border-radius: 0.9rem;
  font-size: 1.3rem;
  background: #fff;
  border: 1.5px solid rgba(237, 79, 131, 0.2);
  box-shadow:
    0 1px 2px rgba(42, 26, 32, 0.06),
    0 4px 12px rgba(237, 79, 131, 0.14);
}

body.legacy-page-index .data-tile-icon svg,
body.legacy-page-index .data-recent-chip i svg {
  display: block;
  filter: drop-shadow(0 1px 1.5px rgba(42, 26, 32, 0.14));
}

body.legacy-page-index .data-tile.tone-pink .data-tile-icon {
  background: linear-gradient(180deg, #fff 0%, #fff6f8 100%);
  border-color: rgba(237, 79, 131, 0.3);
  box-shadow: 0 2px 10px rgba(237, 79, 131, 0.18);
}

body.legacy-page-index .data-tile.tone-yellow .data-tile-icon {
  background: linear-gradient(180deg, #fff 0%, #fffbeb 100%);
  border-color: rgba(255, 184, 24, 0.42);
  box-shadow: 0 2px 10px rgba(255, 184, 24, 0.2);
}

body.legacy-page-index .data-tile.tone-cyan .data-tile-icon {
  background: linear-gradient(180deg, #fff 0%, #eaf6fb 100%);
  border-color: rgba(82, 194, 211, 0.42);
  box-shadow: 0 2px 10px rgba(82, 194, 211, 0.2);
}

body.legacy-page-index .data-tile.tone-cream .data-tile-icon {
  background: linear-gradient(180deg, #fff 0%, #fff8e8 100%);
  border-color: rgba(253, 227, 120, 0.55);
  box-shadow: 0 2px 10px rgba(253, 227, 120, 0.24);
}

body.legacy-page-index .data-tile-body {
  display: grid;
  gap: 0.15rem;
  min-width: 0;
  flex: 1;
}

body.legacy-page-index .data-tile-body strong {
  color: var(--pg-ink-strong);
  font-size: 0.95rem;
  font-weight: 600;
}

body.legacy-page-index .data-tile-meta {
  color: var(--pg-muted);
  font-size: 0.76rem;
}

body.legacy-page-index .data-tile-badge {
  display: grid;
  place-items: center;
  min-width: 1.5rem;
  height: 1.5rem;
  flex: 0 0 auto;
  border-radius: 999px;
  padding: 0 0.4rem;
  background: var(--pg-primary-fill);
  color: #ffffff;
  font-size: 0.72rem;
  font-weight: 700;
}

body.legacy-page-index .data-tile-chevron {
  flex: 0 0 auto;
  color: var(--pg-muted);
  font-size: 1.3rem;
  line-height: 1;
}

body.legacy-page-index .empty-card.data-empty {
  padding: 1.25rem 1rem;
  border: 1px dashed var(--pg-border-strong);
  border-radius: var(--pg-radius-card);
  background: var(--pg-surface);
  color: var(--pg-muted);
  text-align: center;
}

/* ---------- Records header ---------- */

body.legacy-page-index .legacy-list-header {
  display: flex;
  align-items: flex-start;
  gap: 0.65rem;
  margin: 0;
  padding: 0.15rem 0 0.35rem;
}

body.legacy-page-index .legacy-list-title {
  min-width: 0;
  flex: 1 1 auto;
}

body.legacy-page-index .legacy-list-header h1 {
  margin: 0;
  color: var(--pg-ink-strong);
  font-size: clamp(1rem, 4.8vw, 1.25rem);
  font-weight: 700;
  line-height: 1.3;
}

body.legacy-page-index .legacy-list-header p {
  margin: 0.15rem 0 0;
  color: var(--pg-muted);
  font-size: 0.8rem;
  line-height: 1.35;
}

/* Mobile: show count only; hide column/tech noise */
body.legacy-page-index .data-records-meta-desktop {
  display: none;
}

@media (min-width: 768px) {
  body.legacy-page-index .data-records-meta-desktop {
    display: inline;
  }
}

body.legacy-page-index .round-back {
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  justify-content: center;
  width: 2.4rem;
  height: 2.4rem;
  margin: 0;
  border: 1px solid var(--pg-border-strong);
  border-radius: 999px;
  background: var(--pg-brand-tint);
  color: var(--pg-brand-deep);
  font-size: 1.45rem;
  line-height: 1;
  cursor: pointer;
}

body.legacy-page-index .round-back:active {
  background: var(--pg-brand-pastel);
}

body.legacy-page-index code.data-tech-name {
  border-radius: 0.35rem;
  padding: 0 0.3rem;
  background: var(--pg-surface-soft);
  color: var(--pg-muted);
  font-size: 0.72rem;
}

/* ---------- Records actions ---------- */

body.legacy-page-index .manage-data-action-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
}

body.legacy-page-index .manage-data-action-row .btn {
  flex: 0 0 auto;
  min-height: 2.35rem;
  border-radius: 999px !important;
  padding: 0 0.9rem !important;
  font-size: 0.82rem !important;
  font-weight: 600 !important;
  white-space: nowrap;
}

body.legacy-page-index .manage-data-action-row #refresh-btn {
  background: #f3f4f6 !important;
  border-color: #e5e7eb !important;
  color: var(--pg-ink) !important;
}

body.legacy-page-index .manage-data-action-row #add-btn {
  background: var(--pg-primary-fill) !important;
  border-color: var(--pg-primary-fill) !important;
}

body.legacy-page-index .manage-data-action-row #delete-selected {
  background: var(--pg-danger) !important;
  border-color: var(--pg-danger) !important;
}

body.legacy-page-index .manage-data-action-row #import-csv-btn {
  background: var(--ci-moderate-cyan) !important;
  border-color: var(--ci-moderate-cyan) !important;
  color: #fff !important;
}

body.legacy-page-index.manage-data-records-mode #data-table {
  min-height: 50vh;
  border-radius: var(--pg-radius-card);
  overflow: hidden;
}

body.legacy-page-index .header-icon-btn {
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  justify-content: center;
  width: 2.4rem;
  height: 2.4rem;
  border: 1px solid var(--pg-border-strong, #ecd3da);
  border-radius: 999px;
  background: #fff;
  color: var(--pg-ink-strong, #2a1a20);
  font-size: 1.2rem;
  line-height: 1;
  cursor: pointer;
}

body.legacy-page-index .manage-data-action-row-hidden {
  display: none !important;
}

body.legacy-page-index .tabulator-visually-hidden {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
}

body.legacy-page-index .data-records-list {
  display: grid;
  gap: 0.7rem;
}

body.legacy-page-index .data-record-card {
  display: flex;
  align-items: flex-start;
  gap: 0.65rem;
  width: 100%;
  min-height: 4.5rem;
  padding: 0.9rem 0.85rem;
  border: 1px solid var(--pg-border, #f4e2e7);
  border-radius: 1.15rem;
  background: #fff;
  color: inherit;
  text-align: left;
  box-shadow: var(--pg-shadow-soft);
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

body.legacy-page-index .data-record-card:active {
  transform: scale(0.995);
}

body.legacy-page-index .data-record-card.selected {
  border-color: var(--pg-brand);
  box-shadow: 0 0 0 0.18rem rgba(237, 79, 131, 0.16);
}

body.legacy-page-index .data-record-badge,
body.legacy-page-index .data-record-check {
  display: grid;
  place-items: center;
  width: 2.25rem;
  height: 2.25rem;
  flex: 0 0 auto;
  margin-top: 0.1rem;
  border-radius: 0.8rem;
  background: #fde8ef;
  color: #9c2450;
  font-size: 0.95rem;
  font-weight: 700;
}

body.legacy-page-index .data-record-check {
  border: 1.5px solid #ecd3da;
  background: #fff;
  color: var(--pg-brand);
}

body.legacy-page-index .data-record-body {
  display: grid;
  gap: 0.28rem;
  min-width: 0;
  flex: 1;
}

body.legacy-page-index .data-record-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.55rem;
}

body.legacy-page-index .data-record-title,
body.legacy-page-index .data-record-top strong {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  overflow: hidden;
  min-width: 0;
  flex: 1 1 auto;
  font-size: 0.92rem;
  font-weight: 700;
  line-height: 1.35;
  word-break: break-word;
}

body.legacy-page-index .data-record-subtitle {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 1;
  overflow: hidden;
  color: var(--pg-ink-soft);
  font-size: 0.78rem;
  line-height: 1.35;
}

body.legacy-page-index .data-record-fields {
  display: grid;
  gap: 0.28rem;
  margin-top: 0.15rem;
  padding-top: 0.45rem;
  border-top: 1px dashed #ecd3da;
}

body.legacy-page-index .data-record-field,
body.legacy-page-index .data-record-fields span {
  display: grid;
  grid-template-columns: minmax(4.5rem, 34%) minmax(0, 1fr);
  align-items: start;
  gap: 0.45rem;
  font-size: 0.74rem;
  line-height: 1.35;
}

body.legacy-page-index .data-record-field i,
body.legacy-page-index .data-record-fields i {
  color: var(--pg-ink-soft);
  font-style: normal;
  font-weight: 600;
}

body.legacy-page-index .data-record-field b,
body.legacy-page-index .data-record-fields b {
  overflow: hidden;
  text-align: right;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-weight: 650;
  color: var(--pg-ink-strong, #3d2830);
}

body.legacy-page-index .data-record-chevron {
  align-self: center;
  flex: 0 0 auto;
  color: var(--pg-ink-soft);
  font-size: 1.25rem;
  line-height: 1;
  opacity: 0.7;
}

body.legacy-page-index .data-status-pill {
  display: inline-flex;
  flex: 0 0 auto;
  max-width: 42%;
  align-items: center;
  border-radius: 999px;
  padding: 0.18rem 0.55rem;
  font-size: 0.68rem;
  font-weight: 700;
  line-height: 1.2;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  background: #f3e8ec;
  color: #6b4450;
}

body.legacy-page-index .data-status-pill.is-done {
  background: #ddf2f6;
  color: #0f6d7c;
}

body.legacy-page-index .data-status-pill.is-wait {
  background: #fff3c7;
  color: #8a6a00;
}

body.legacy-page-index .data-status-pill.is-ack {
  background: #dbeafe;
  color: #1e40af;
}

body.legacy-page-index .data-status-pill.is-cancel {
  background: #fee2e2;
  color: #991b1b;
}

body.legacy-page-index .data-status-pill.is-progress {
  background: #ede9fe;
  color: #6d28d9;
}

body.legacy-page-index .data-status-pill.is-other {
  background: #f3e8ec;
  color: #6b4450;
}

body.legacy-page-index .data-filter-tabs {
  display: flex;
  flex-wrap: nowrap;
  gap: 0.45rem;
  overflow-x: auto;
  overscroll-behavior-x: contain;
  -webkit-overflow-scrolling: touch;
  margin: 0 -0.15rem;
  padding: 0.1rem 0.15rem 0.35rem;
  scroll-padding-inline: 0.15rem;
  scrollbar-width: none;
}

body.legacy-page-index .data-filter-tabs::-webkit-scrollbar {
  display: none;
}

body.legacy-page-index .data-filter-tab {
  flex: 0 0 auto;
  min-height: 2.35rem;
  border: 1px solid #f3b8c9;
  border-radius: 999px;
  padding: 0.4rem 0.95rem;
  background: #fff;
  color: #c62f65;
  font-family: inherit;
  font-size: 0.8rem;
  font-weight: 700;
  white-space: nowrap;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

body.legacy-page-index .data-filter-tab.active {
  border-color: #c62f65;
  background: #c62f65;
  color: #fff;
  box-shadow: 0 4px 12px rgba(198, 47, 101, 0.3);
}

body.legacy-page-index .data-records-empty {
  padding: 1.5rem 1rem;
  border: 1px dashed #ecd3da;
  border-radius: 1.15rem;
  color: var(--pg-ink-soft);
  text-align: center;
}

body.legacy-page-index .data-select-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.65rem 0.8rem;
  border-radius: 0.95rem;
  background: #fff0f4;
  font-size: 0.82rem;
  font-weight: 700;
}

body.legacy-page-index .data-select-bar.hidden,
body.legacy-page-index .data-sheet.hidden {
  display: none !important;
}

body.legacy-page-index .data-select-bar > div,
body.legacy-page-index .data-select-bar div {
  display: flex;
  gap: 0.4rem;
}

body.legacy-page-index .data-select-bar button {
  min-height: 2.2rem;
  border: 1px solid #ecd3da;
  border-radius: 999px;
  background: #fff;
  padding: 0 0.8rem;
  font-family: inherit;
  font-size: 0.78rem;
  font-weight: 700;
}

body.legacy-page-index .data-select-danger {
  border-color: #f3b8c9 !important;
  background: #fdeef2 !important;
  color: #b3123c !important;
}

body.legacy-page-index .data-records-fab {
  position: sticky;
  bottom: calc(5.1rem + env(safe-area-inset-bottom, 0px));
  z-index: 15;
  display: inline-flex;
  align-items: center;
  justify-self: end;
  gap: 0.45rem;
  min-height: 3.2rem;
  margin-top: 0.75rem;
  margin-left: auto;
  border: 0;
  border-radius: 999px;
  padding: 0 1.25rem;
  background: #c62f65;
  color: #fff;
  font-size: 0.92rem;
  font-weight: 700;
  box-shadow: 0 12px 28px rgba(198, 47, 101, 0.4);
}

body.legacy-page-index.records-select-mode .data-records-fab {
  display: none;
}

body.legacy-page-index .data-sheet {
  position: fixed;
  inset: 0;
  z-index: 80;
}

body.legacy-page-index .data-sheet-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(42, 26, 32, 0.45);
}

body.legacy-page-index .data-sheet-panel {
  position: absolute;
  right: 0;
  bottom: 0;
  left: 0;
  padding: 0.7rem 1rem calc(1.1rem + env(safe-area-inset-bottom, 0px));
  border-radius: 1.35rem 1.35rem 0 0;
  background: #fff;
}

body.legacy-page-index .data-sheet-handle {
  width: 3rem;
  height: 0.3rem;
  margin: 0.15rem auto 0.75rem;
  border-radius: 999px;
  background: #ecd3da;
}

body.legacy-page-index .data-sheet-panel h2 {
  margin: 0 0 0.65rem;
  font-size: 1.05rem;
}

body.legacy-page-index .data-sheet-menu {
  display: grid;
}

body.legacy-page-index .data-sheet-menu button {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  min-height: 3rem;
  border: 0;
  border-bottom: 1px solid #f4e2e7;
  background: transparent;
  padding: 0;
  color: inherit;
  font-family: inherit;
  font-size: 0.92rem;
  font-weight: 650;
  text-align: left;
}

body.legacy-page-index .data-sheet-menu i {
  font-style: normal;
}

body.legacy-page-index .container.data-records-page {
  display: grid;
}

body.legacy-page-index .manage-data-sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* Manage-data edit/CSV modals: pin footer buttons above the bottom edge */
@media (max-width: 767.98px) {
  body.legacy-page-index .modal.show .modal-dialog {
    max-height: calc(100dvh - max(0.75rem, env(safe-area-inset-top, 0px))) !important;
  }

  body.legacy-page-index .modal.show .modal-content,
  body.legacy-page-index .modal.show .modal-content > form {
    min-height: 0 !important;
  }

  body.legacy-page-index .modal.show .modal-body {
    padding-bottom: 1.25rem !important;
  }

  body.legacy-page-index .modal.show .modal-footer {
    gap: 0.5rem;
    padding-top: 0.85rem !important;
    padding-bottom: calc(1.1rem + env(safe-area-inset-bottom, 0px)) !important;
    box-shadow: 0 -8px 24px rgba(61, 40, 48, 0.08);
  }

  body.legacy-page-index .modal.show .modal-footer .btn {
    min-height: 2.75rem;
  }
}
