/* Shared NFC page shell. The footer stays in normal flow, never over content. */
body.nfc-manager-page {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  min-height: 100dvh;
}

.nfc-manager-page > header {
  flex: 0 0 auto;
  flex-wrap: wrap;
  padding: 18px max(24px, calc((100% - 1160px) / 2));
  row-gap: 16px;
}

.nfc-manager-page > main {
  flex: 1 0 auto;
  width: min(calc(100% - 64px), 1160px);
  min-width: 0;
  margin: 0 auto;
  padding: 56px 0 72px;
}

.nfc-manager-page > main > h1 {
  margin-bottom: 24px;
  font-size: clamp(29px, 3.4vw, 42px);
  line-height: 1.35;
}

.nfc-manager-page > footer {
  flex: 0 0 auto;
  margin-top: auto;
  padding: 22px 24px max(24px, env(safe-area-inset-bottom));
  line-height: 1.6;
}

.nfc-manager-page .lead {
  line-height: 1.8;
  margin-bottom: 30px;
}

.nfc-manager-page .cards {
  gap: 24px;
}

.nfc-manager-page .panel.form {
  max-width: 620px;
  padding: 32px;
  gap: 24px;
}

.nfc-manager-page .admin-create {
  max-width: 940px;
  padding: 32px;
  gap: 24px;
}

/* Align short form pages with their content, not the full list-page width. */
.nfc-manager-page main:has(> .panel.form) > h1,
.nfc-manager-page main:has(> .panel.form) > .notice,
.nfc-manager-page main:has(> .panel.form) > .lead {
  max-width: 620px;
  margin-left: auto;
  margin-right: auto;
}

.nfc-manager-page .activation-intro,
.nfc-manager-page .activation-product,
.nfc-manager-page .login-divider {
  max-width: 620px;
}

.nfc-manager-page .form > label,
.nfc-manager-page .admin-create label,
.nfc-manager-page .product-filters label {
  min-width: 0;
  gap: 10px;
  line-height: 1.6;
}

.nfc-manager-page .form > p {
  margin: 0;
  line-height: 1.75;
}

.nfc-manager-page .form input:not([type=hidden]):not([type=radio]):not([type=checkbox]),
.nfc-manager-page .admin-create input:not([type=hidden]),
.nfc-manager-page .settings-form input[type=url] {
  min-height: 52px;
  min-width: 0;
}

.nfc-manager-page .readonly,
.nfc-manager-page .device-top > div,
.nfc-manager-page .member-meta-grid > div {
  min-width: 0;
}

.nfc-manager-page .readonly code,
.nfc-manager-page .member-device h2,
.nfc-manager-page .member-device-name,
.nfc-manager-page .member-meta-grid dd {
  overflow-wrap: anywhere;
}

/* Member cards need space for both a product name and its destination. */
.nfc-manager-page .cards:has(> .member-device) {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  align-items: start;
}

.nfc-manager-page .member-device {
  padding: 28px;
}

.nfc-manager-page .member-meta-grid {
  gap: 16px;
  margin: 22px 0;
}

.nfc-manager-page .account-grid,
.nfc-manager-page .admin-overview {
  gap: 28px;
}

.nfc-manager-page .account-grid .panel.form {
  max-width: none;
  margin: 0;
}

.nfc-manager-page .form-heading h2,
.nfc-manager-page .overview-card h2,
.nfc-manager-page .settings-card h2 {
  font-size: 24px;
  line-height: 1.5;
}

.nfc-manager-page .admin-toolbar {
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 28px;
}

.nfc-manager-page .admin-toolbar a,
.nfc-manager-page .device-toggle,
.nfc-manager-page .copy-link button {
  min-height: 44px;
  align-items: center;
}

.nfc-manager-page .product-filters {
  gap: 20px;
  padding: 28px;
  margin: 28px 0;
}

.nfc-manager-page .settings-card {
  max-width: 760px;
  padding: 32px;
}

.nfc-manager-page main:has(> .settings-card) > h1 {
  max-width: 760px;
  margin-left: auto;
  margin-right: auto;
}

.nfc-manager-page .settings-form {
  gap: 24px;
}

.nfc-manager-page .settings-form small {
  line-height: 1.7;
}

.nfc-manager-page .sync-option {
  align-items: flex-start;
  gap: 12px;
  line-height: 1.7;
}

.nfc-manager-page .sync-option input {
  flex: 0 0 20px;
  margin-top: 4px;
}

.nfc-manager-page .sync-option span {
  min-width: 0;
}

.nfc-manager-page .admin-cards .device-summary,
.nfc-manager-page .admin-cards dl {
  gap: 16px;
}

.nfc-manager-page .admin-cards .summary-item,
.nfc-manager-page .admin-cards dl > div {
  padding: 16px;
}

.nfc-manager-page .admin-cards dd {
  line-height: 1.65;
}

.nfc-manager-page .admin-cards .summary-item:first-child dd {
  white-space: normal;
}

/* Use card width, including in split-screen, for the expanded admin details. */
@container nfc-admin-list (max-width: 1000px) {
  .nfc-manager-page .admin-cards .device-summary {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .nfc-manager-page .admin-cards dl {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  }

  .nfc-manager-page .admin-cards dl > div {
    grid-column: auto !important;
  }

  .nfc-manager-page .admin-cards dl > div:nth-last-child(-n + 2) {
    grid-column: 1 / -1 !important;
  }
}

@container nfc-admin-list (max-width: 640px) {
  .nfc-manager-page .admin-cards .device-summary,
  .nfc-manager-page .admin-cards dl {
    grid-template-columns: minmax(0, 1fr) !important;
  }

  .nfc-manager-page .admin-cards dl > div {
    grid-column: 1 / -1 !important;
  }
}

@media (max-width: 1100px) {
  .nfc-manager-page .product-filters {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .nfc-manager-page .product-filters .secondary,
  .nfc-manager-page .product-filters .filter-reset {
    width: 100%;
    min-height: 44px;
    justify-self: stretch;
  }
}

@media (max-width: 1023px) {
  .nfc-manager-page .account-grid,
  .nfc-manager-page .cards:has(> .member-device),
  .nfc-manager-page .admin-overview {
    grid-template-columns: minmax(0, 1fr);
  }

  .nfc-manager-page .account-grid {
    max-width: 620px;
    margin: 0 auto;
  }

  .nfc-manager-page main:has(> .account-grid) > h1 {
    max-width: 620px;
    margin-left: auto;
    margin-right: auto;
  }

  .nfc-manager-page main:has(> .account-grid) > .notice {
    max-width: 620px;
    margin-left: auto;
    margin-right: auto;
  }

  .nfc-manager-page .product-selects {
    grid-template-columns: minmax(0, 1fr);
    gap: 24px;
  }
}

@media (max-width: 800px) {
  .nfc-manager-page .product-filters {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .nfc-manager-page .product-filters label {
    grid-column: 1 / -1;
  }
}

@media (max-width: 680px) {
  .nfc-manager-page .member-device,
  .nfc-manager-page .settings-card,
  .nfc-manager-page .product-filters {
    padding: 24px;
  }

  .nfc-manager-page .status-options,
  .nfc-manager-page .member-meta-grid {
    grid-template-columns: minmax(0, 1fr);
    gap: 16px;
  }

  .nfc-manager-page .admin-cards.collapsible-cards > .device {
    padding: 24px;
  }
}

@media (max-width: 380px) {
  .nfc-manager-page .product-filters {
    grid-template-columns: minmax(0, 1fr);
  }
}

/* Give the three entry choices room without enlarging the typography. */
.nfc-manager-page main:has(> .entry-grid) > h1 {
  text-align: center;
  margin-bottom: 16px;
}

.nfc-manager-page .onboarding-lead {
  max-width: 620px;
  margin: 0 auto 38px;
  text-align: center;
}

.nfc-manager-page .entry-grid {
  gap: 28px;
}

.nfc-manager-page .entry-card {
  min-height: 300px;
  padding: 32px;
  box-shadow: 0 12px 30px #56442c0c;
}

.nfc-manager-page .entry-card h2 {
  margin: 20px 0 14px;
  line-height: 1.45;
}

.nfc-manager-page .entry-card p {
  margin-bottom: 32px;
  line-height: 1.85;
}

.nfc-manager-page .entry-card .primary,
.nfc-manager-page .entry-card .secondary {
  min-height: 48px;
}

@media (max-width: 1023px) {
  .nfc-manager-page .entry-grid {
    grid-template-columns: minmax(0, 1fr);
    max-width: 720px;
    margin: 0 auto;
    gap: 24px;
  }

  .nfc-manager-page .entry-card {
    min-height: 0;
  }
}

@media (max-width: 900px) {
  .nfc-manager-page > header {
    justify-content: center;
  }

  .nfc-manager-page > header nav {
    width: 100%;
    justify-content: center;
    flex-wrap: wrap;
    gap: 10px;
  }
}

@media (max-width: 680px) {
  .nfc-manager-page > header {
    padding: 16px 20px;
  }

  .nfc-manager-page > main {
    width: calc(100% - 40px);
    padding: 36px 0 48px;
  }

  .nfc-manager-page .onboarding-lead {
    margin-bottom: 28px;
  }

  .nfc-manager-page .entry-grid {
    gap: 20px;
  }

  .nfc-manager-page .entry-card,
  .nfc-manager-page .panel.form,
  .nfc-manager-page .admin-create {
    padding: 24px;
  }

  .nfc-manager-page > footer {
    padding-left: 20px;
    padding-right: 20px;
  }
}
