.hosted-admin-section[data-user-management-integrated="true"] .hosted-admin-section-toolbar > .hosted-admin-action-primary,
.hosted-admin-section[data-user-management-integrated="true"] details.hosted-admin-secondary-disclosure {
  display: none !important;
}

.hosted-user-management-primary-action {
  display: flex;
  justify-content: flex-start;
  margin-top: 12px;
}

.hosted-admin-onboarding-panel .hosted-admin-person-section-head {
  align-items: flex-start;
}

.hosted-admin-onboarding-panel .hosted-admin-badge {
  display: inline-flex;
  width: auto;
  max-width: max-content;
  flex: 0 0 auto;
  align-self: flex-start;
}

.hosted-admin-one-time-secret {
  gap: 10px;
}

.hosted-admin-one-time-secret-value {
  min-height: 0;
  height: 42px;
  padding-block: 8px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
}

.hosted-administration-dashboard-card[data-section-id="clinic-users"] .hosted-administration-dashboard-card-icon > *,
.hosted-administration-dashboard-card[data-section-id="clinic-summary-admins"] .hosted-administration-dashboard-card-icon > *,
.hosted-administration-dashboard-card[data-section-id="clinic-recovery-provisioning"] .hosted-administration-dashboard-card-icon > *,
.hosted-administration-dashboard-card[data-section-id="clinic-offboarding"] .hosted-administration-dashboard-card-icon > *,
.hosted-administration-dashboard-card[data-section-id="clinic-audit"] .hosted-administration-dashboard-card-icon > *,
.hosted-administration-dashboard-card[data-section-id="platform-clinics"] .hosted-administration-dashboard-card-icon > *,
.hosted-administration-dashboard-card[data-section-id="platform-endpoints"] .hosted-administration-dashboard-card-icon > * {
  display: none !important;
}

.hosted-administration-dashboard-card[data-section-id="clinic-users"] .hosted-administration-dashboard-card-icon,
.hosted-administration-dashboard-card[data-section-id="clinic-summary-admins"] .hosted-administration-dashboard-card-icon,
.hosted-administration-dashboard-card[data-section-id="clinic-recovery-provisioning"] .hosted-administration-dashboard-card-icon,
.hosted-administration-dashboard-card[data-section-id="clinic-offboarding"] .hosted-administration-dashboard-card-icon,
.hosted-administration-dashboard-card[data-section-id="clinic-audit"] .hosted-administration-dashboard-card-icon,
.hosted-administration-dashboard-card[data-section-id="platform-clinics"] .hosted-administration-dashboard-card-icon,
.hosted-administration-dashboard-card[data-section-id="platform-endpoints"] .hosted-administration-dashboard-card-icon {
  background-color: currentColor;
  -webkit-mask-position: center;
  -webkit-mask-repeat: no-repeat;
  -webkit-mask-size: contain;
  mask-position: center;
  mask-repeat: no-repeat;
  mask-size: contain;
}

.hosted-administration-dashboard-card[data-section-id="clinic-users"] .hosted-administration-dashboard-card-icon {
  -webkit-mask-image: url("data:image/svg+xml,%3Csvg%20xmlns%3D'http://www.w3.org/2000/svg'%20viewBox%3D'0%200%2024%2024'%20fill%3D'none'%20stroke%3D'black'%20stroke-width%3D'2'%20stroke-linecap%3D'round'%20stroke-linejoin%3D'round'%3E%3Cpath%20d%3D'M18%2021a8%208%200%200%200-16%200'/%3E%3Ccircle%20cx%3D'10'%20cy%3D'8'%20r%3D'5'/%3E%3Cpath%20d%3D'M22%2020c0-3.37-2-6.5-4-8a5%205%200%200%200-.45-8.3'/%3E%3C/svg%3E");
  mask-image: url("data:image/svg+xml,%3Csvg%20xmlns%3D'http://www.w3.org/2000/svg'%20viewBox%3D'0%200%2024%2024'%20fill%3D'none'%20stroke%3D'black'%20stroke-width%3D'2'%20stroke-linecap%3D'round'%20stroke-linejoin%3D'round'%3E%3Cpath%20d%3D'M18%2021a8%208%200%200%200-16%200'/%3E%3Ccircle%20cx%3D'10'%20cy%3D'8'%20r%3D'5'/%3E%3Cpath%20d%3D'M22%2020c0-3.37-2-6.5-4-8a5%205%200%200%200-.45-8.3'/%3E%3C/svg%3E");
}

.hosted-administration-dashboard-card[data-section-id="clinic-summary-admins"] .hosted-administration-dashboard-card-icon,
.hosted-administration-dashboard-card[data-section-id="platform-clinics"] .hosted-administration-dashboard-card-icon {
  -webkit-mask-image: url("data:image/svg+xml,%3Csvg%20xmlns%3D'http://www.w3.org/2000/svg'%20viewBox%3D'0%200%2024%2024'%20fill%3D'none'%20stroke%3D'black'%20stroke-width%3D'2'%20stroke-linecap%3D'round'%20stroke-linejoin%3D'round'%3E%3Cpath%20d%3D'M10%2012h4'/%3E%3Cpath%20d%3D'M10%208h4'/%3E%3Cpath%20d%3D'M14%2021v-3a2%202%200%200%200-4%200v3'/%3E%3Cpath%20d%3D'M6%2010H4a2%202%200%200%200-2%202v7a2%202%200%200%200%202%202h16a2%202%200%200%200%202-2V9a2%202%200%200%200-2-2h-2'/%3E%3Cpath%20d%3D'M6%2021V5a2%202%200%200%201%202-2h8a2%202%200%200%201%202%202v16'/%3E%3C/svg%3E");
  mask-image: url("data:image/svg+xml,%3Csvg%20xmlns%3D'http://www.w3.org/2000/svg'%20viewBox%3D'0%200%2024%2024'%20fill%3D'none'%20stroke%3D'black'%20stroke-width%3D'2'%20stroke-linecap%3D'round'%20stroke-linejoin%3D'round'%3E%3Cpath%20d%3D'M10%2012h4'/%3E%3Cpath%20d%3D'M10%208h4'/%3E%3Cpath%20d%3D'M14%2021v-3a2%202%200%200%200-4%200v3'/%3E%3Cpath%20d%3D'M6%2010H4a2%202%200%200%200-2%202v7a2%202%200%200%200%202%202h16a2%202%200%200%200%202-2V9a2%202%200%200%200-2-2h-2'/%3E%3Cpath%20d%3D'M6%2021V5a2%202%200%200%201%202-2h8a2%202%200%200%201%202%202v16'/%3E%3C/svg%3E");
}

.hosted-administration-dashboard-card[data-section-id="clinic-recovery-provisioning"] .hosted-administration-dashboard-card-icon {
  -webkit-mask-image: url("data:image/svg+xml,%3Csvg%20xmlns%3D'http://www.w3.org/2000/svg'%20viewBox%3D'0%200%2024%2024'%20fill%3D'none'%20stroke%3D'black'%20stroke-width%3D'2'%20stroke-linecap%3D'round'%20stroke-linejoin%3D'round'%3E%3Cpath%20d%3D'M20%2013c0%205-3.5%207.5-7.66%208.95a1%201%200%200%201-.67-.01C7.5%2020.5%204%2018%204%2013V6a1%201%200%200%201%201-1c2%200%204.5-1.2%206.24-2.72a1.17%201.17%200%200%201%201.52%200C14.51%203.81%2017%205%2019%205a1%201%200%200%201%201%201z'/%3E%3Cpath%20d%3D'm9%2012%202%202%204-4'/%3E%3C/svg%3E");
  mask-image: url("data:image/svg+xml,%3Csvg%20xmlns%3D'http://www.w3.org/2000/svg'%20viewBox%3D'0%200%2024%2024'%20fill%3D'none'%20stroke%3D'black'%20stroke-width%3D'2'%20stroke-linecap%3D'round'%20stroke-linejoin%3D'round'%3E%3Cpath%20d%3D'M20%2013c0%205-3.5%207.5-7.66%208.95a1%201%200%200%201-.67-.01C7.5%2020.5%204%2018%204%2013V6a1%201%200%200%201%201-1c2%200%204.5-1.2%206.24-2.72a1.17%201.17%200%200%201%201.52%200C14.51%203.81%2017%205%2019%205a1%201%200%200%201%201%201z'/%3E%3Cpath%20d%3D'm9%2012%202%202%204-4'/%3E%3C/svg%3E");
}

.hosted-administration-dashboard-card[data-section-id="clinic-offboarding"] .hosted-administration-dashboard-card-icon {
  -webkit-mask-image: url("data:image/svg+xml,%3Csvg%20xmlns%3D'http://www.w3.org/2000/svg'%20viewBox%3D'0%200%2024%2024'%20fill%3D'none'%20stroke%3D'black'%20stroke-width%3D'2'%20stroke-linecap%3D'round'%20stroke-linejoin%3D'round'%3E%3Cpath%20d%3D'm16%203%204%204-4%204'/%3E%3Cpath%20d%3D'M20%207H4'/%3E%3Cpath%20d%3D'm8%2021-4-4%204-4'/%3E%3Cpath%20d%3D'M4%2017h16'/%3E%3C/svg%3E");
  mask-image: url("data:image/svg+xml,%3Csvg%20xmlns%3D'http://www.w3.org/2000/svg'%20viewBox%3D'0%200%2024%2024'%20fill%3D'none'%20stroke%3D'black'%20stroke-width%3D'2'%20stroke-linecap%3D'round'%20stroke-linejoin%3D'round'%3E%3Cpath%20d%3D'm16%203%204%204-4%204'/%3E%3Cpath%20d%3D'M20%207H4'/%3E%3Cpath%20d%3D'm8%2021-4-4%204-4'/%3E%3Cpath%20d%3D'M4%2017h16'/%3E%3C/svg%3E");
}

.hosted-administration-dashboard-card[data-section-id="clinic-audit"] .hosted-administration-dashboard-card-icon {
  -webkit-mask-image: url("data:image/svg+xml,%3Csvg%20xmlns%3D'http://www.w3.org/2000/svg'%20viewBox%3D'0%200%2024%2024'%20fill%3D'none'%20stroke%3D'black'%20stroke-width%3D'2'%20stroke-linecap%3D'round'%20stroke-linejoin%3D'round'%3E%3Crect%20width%3D'8'%20height%3D'4'%20x%3D'8'%20y%3D'2'%20rx%3D'1'%20ry%3D'1'/%3E%3Cpath%20d%3D'M16%204h2a2%202%200%200%201%202%202v14a2%202%200%200%201-2%202H6a2%202%200%200%201-2-2V6a2%202%200%200%201%202-2h2'/%3E%3Cpath%20d%3D'm9%2014%202%202%204-4'/%3E%3C/svg%3E");
  mask-image: url("data:image/svg+xml,%3Csvg%20xmlns%3D'http://www.w3.org/2000/svg'%20viewBox%3D'0%200%2024%2024'%20fill%3D'none'%20stroke%3D'black'%20stroke-width%3D'2'%20stroke-linecap%3D'round'%20stroke-linejoin%3D'round'%3E%3Crect%20width%3D'8'%20height%3D'4'%20x%3D'8'%20y%3D'2'%20rx%3D'1'%20ry%3D'1'/%3E%3Cpath%20d%3D'M16%204h2a2%202%200%200%201%202%202v14a2%202%200%200%201-2%202H6a2%202%200%200%201-2-2V6a2%202%200%200%201%202-2h2'/%3E%3Cpath%20d%3D'm9%2014%202%202%204-4'/%3E%3C/svg%3E");
}

.hosted-administration-dashboard-card[data-section-id="platform-endpoints"] .hosted-administration-dashboard-card-icon {
  -webkit-mask-image: url("data:image/svg+xml,%3Csvg%20xmlns%3D'http://www.w3.org/2000/svg'%20viewBox%3D'0%200%2024%2024'%20fill%3D'none'%20stroke%3D'black'%20stroke-width%3D'2'%20stroke-linecap%3D'round'%20stroke-linejoin%3D'round'%3E%3Crect%20width%3D'20'%20height%3D'8'%20x%3D'2'%20y%3D'2'%20rx%3D'2'%20ry%3D'2'/%3E%3Crect%20width%3D'20'%20height%3D'8'%20x%3D'2'%20y%3D'14'%20rx%3D'2'%20ry%3D'2'/%3E%3Cline%20x1%3D'6'%20x2%3D'6.01'%20y1%3D'6'%20y2%3D'6'/%3E%3Cline%20x1%3D'6'%20x2%3D'6.01'%20y1%3D'18'%20y2%3D'18'/%3E%3C/svg%3E");
  mask-image: url("data:image/svg+xml,%3Csvg%20xmlns%3D'http://www.w3.org/2000/svg'%20viewBox%3D'0%200%2024%2024'%20fill%3D'none'%20stroke%3D'black'%20stroke-width%3D'2'%20stroke-linecap%3D'round'%20stroke-linejoin%3D'round'%3E%3Crect%20width%3D'20'%20height%3D'8'%20x%3D'2'%20y%3D'2'%20rx%3D'2'%20ry%3D'2'/%3E%3Crect%20width%3D'20'%20height%3D'8'%20x%3D'2'%20y%3D'14'%20rx%3D'2'%20ry%3D'2'/%3E%3Cline%20x1%3D'6'%20x2%3D'6.01'%20y1%3D'6'%20y2%3D'6'/%3E%3Cline%20x1%3D'6'%20x2%3D'6.01'%20y1%3D'18'%20y2%3D'18'/%3E%3C/svg%3E");
}

/* Readiness uses explicit state words; an open circle can be mistaken for success. */
.hosted-platform-readiness-mark {
  width: auto;
  min-width: 4.75em;
  height: auto;
  border: 0;
  border-radius: 0;
  background: transparent;
  font-size: 0;
  line-height: 1.25;
  text-align: left;
}
.hosted-platform-readiness li.is-done .hosted-platform-readiness-mark::after {
  content: "✓ 完了";
  font-size: 12px;
  font-weight: 700;
}
.hosted-platform-readiness li:not(.is-done) .hosted-platform-readiness-mark::after {
  content: "未設定";
  font-size: 12px;
  font-weight: 600;
}

/* User detail actions keep permission selectors together before lifecycle operations. */
.hosted-admin-person-section-actions > .hosted-admin-field {
  order: 0;
}
.hosted-admin-person-section-actions > .hosted-admin-action,
.hosted-admin-person-section-actions > .hosted-admin-action-note {
  order: 1;
}

/* Keep the detail action in the same row as the user summary at regular widths. */
.hosted-admin-person-row {
  grid-template-columns: minmax(0, 1.45fr) minmax(185px, .9fr) minmax(130px, .75fr) minmax(150px, .9fr) 84px;
}

.hosted-admin-person-status {
  flex-wrap: nowrap;
  white-space: nowrap;
}

.hosted-admin-person-actions {
  align-self: center;
}

.hosted-admin-person-actions .hosted-admin-action {
  flex: 0 0 auto;
  width: auto;
  min-width: 72px;
}

/* User detail summary should remain compact even on phones. */
.hosted-admin-person-section .hosted-admin-fact-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 6px;
}

.hosted-admin-person-section .hosted-admin-fact {
  min-width: 0;
  padding: 8px 9px;
  gap: 2px;
}

.hosted-admin-person-section .hosted-admin-fact dt {
  font-size: 10px;
  white-space: nowrap;
}

.hosted-admin-person-section .hosted-admin-fact dd {
  font-size: 13px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

@media (max-width: 760px) {
  .hosted-admin-person-row {
    grid-template-columns: minmax(0, 1fr) auto auto;
    grid-template-areas:
      "main main actions"
      "status meta endpoints";
    column-gap: 7px;
    row-gap: 5px;
    min-height: 0;
    padding: 9px 10px;
  }

  .hosted-admin-person-main {
    grid-area: main;
    gap: 1px;
    min-width: 0;
  }

  .hosted-admin-person-status {
    grid-area: status;
    display: flex;
    align-items: center;
    justify-content: flex-start;
    justify-self: start;
    flex-wrap: nowrap;
    gap: 3px;
    min-width: 0;
    margin: 0;
    white-space: nowrap;
  }

  .hosted-admin-person-status .hosted-admin-badge {
    flex: 0 0 auto;
    padding: 3px 6px;
    font-size: 10px;
    line-height: 1.2;
  }

  .hosted-admin-person-meta,
  .hosted-admin-person-endpoints {
    align-self: center;
    min-width: 0;
    margin: 0;
    color: var(--color-text-muted);
    font-size: 10px;
    line-height: 1.25;
    white-space: nowrap;
  }

  .hosted-admin-person-meta {
    grid-area: meta;
    justify-self: start;
    text-align: left;
  }

  .hosted-admin-person-endpoints {
    grid-area: endpoints;
    justify-self: end;
    text-align: right;
  }

  .hosted-admin-person-actions {
    grid-area: actions;
    justify-content: flex-end;
    align-self: start;
  }

  .hosted-admin-person-actions .hosted-admin-action {
    flex: 0 0 auto;
    width: auto;
    min-width: 72px;
  }

  .hosted-admin-person-section {
    gap: 8px;
  }

  .hosted-admin-person-section-body {
    gap: 8px;
  }
}

@media (max-width: 640px) {
  .hosted-user-management-primary-action .hosted-admin-action {
    width: 100%;
    justify-content: center;
  }

  .hosted-admin-onboarding-panel .hosted-admin-badge {
    width: fit-content;
    max-width: 100%;
  }
}
