.microsoft-page [hidden] {
  display: none !important;
}
.ms-generator {
  grid-template-columns: repeat(4, minmax(0, 1fr)) auto;
  margin: 16px 0 8px;
}
.microsoft-page .directory-card .hint {
  margin: 0 0 8px;
}
.microsoft-page .review-actions .ms-confirm {
  margin: 0;
}
.ms-confirm {
  display: flex;
  gap: 12px;
  align-items: center;
  margin: 24px 0;
}
.ms-confirm input {
  width: auto;
  margin: 0;
}
.microsoft-page dialog {
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 28px;
  width: min(460px, calc(100% - 32px));
}
.microsoft-page dialog::backdrop {
  background: #0005;
}
.microsoft-page .table-wrap {
  overflow-x: auto;
  margin: 16px 0;
}
.microsoft-page #alert {
  overflow-wrap: anywhere;
}
@media (max-width: 860px) {
  .ms-generator {
    grid-template-columns: 1fr;
  }
}

.ms-row-select {
  width: auto;
  margin: 0;
}
#policy-summary {
  overflow-wrap: anywhere;
}
#preview-status {
  white-space: pre-line;
}

/* Microsoft 365 branding and table polish. */
.microsoft-page .gw-avatar {
  background: transparent;
  width: 26px;
  height: 26px;
  margin-left: 4px;
}
.gw-session.ms-connected {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px;
  border: 1px solid var(--border);
  border-radius: 999px;
  color: var(--text);
  font-size: 12px;
}
.gw-session.ms-connected::before {
  content: '';
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #80cc28;
  flex-shrink: 0;
}
.ms-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 500;
  white-space: nowrap;
  background: var(--surface-2, #f1efea);
  color: var(--muted);
}
.ms-pill.on {
  background: #eaf6dd;
  color: #3d6b12;
}
.ms-pill.off {
  background: #fdeae4;
  color: #a5300c;
}
.ms-pill.on::before,
.ms-pill.off::before {
  content: '';
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
}
.microsoft-page .ms-name {
  font-weight: 500;
}
.microsoft-page .directory-toolbar {
  align-items: end;
}
.microsoft-page #search {
  min-width: 320px;
}
.microsoft-page #users-summary {
  font-size: 12px;
}
.microsoft-page tbody tr:hover {
  background: rgb(0 0 0 / 2%);
}
@media (max-width: 860px) {
  .microsoft-page #search {
    min-width: 0;
  }
}

/* Warm-up management: licenses, filters and bulk actions. */
.ms-licenses-heading {
  display: flex;
  align-items: baseline;
  gap: 12px;
  margin: 4px 0 10px;
}
.ms-licenses-heading h3 {
  margin: 0;
  font-size: 14px;
}
.ms-licenses {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 10px;
  margin-bottom: 24px;
}
.ms-license {
  display: grid;
  gap: 6px;
  justify-items: start;
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: 10px;
}
.ms-license strong {
  font-size: 13px;
}
.ms-license span:not(.ms-pill) {
  color: var(--muted);
  font-size: 12px;
}
.ms-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  align-items: end;
}
.ms-toolbar #users-summary {
  margin-left: auto;
}
.ms-bulk {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 16px;
  margin: 14px 0;
  padding: 10px 14px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--surface-2);
  position: sticky;
  top: 72px;
  z-index: 5;
}
.ms-bulk-group {
  display: flex;
  align-items: center;
  gap: 6px;
}
.ms-bulk select {
  width: auto;
  padding: 5px 8px;
  font-size: 12px;
}
.ms-inline-check {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  white-space: nowrap;
}
.ms-inline-check input {
  width: auto;
  margin: 0;
}
.ms-banner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.ms-pill + .ms-pill {
  margin-left: 4px;
}
.ms-pill.warm {
  background: #fff1d6;
  color: #8a5300;
}
.ms-pill.info {
  background: #e3f1fb;
  color: #075985;
}
.ms-detail {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 11px;
}
.microsoft-page .table-actions {
  white-space: nowrap;
}
.microsoft-page .table-actions .small-button + .small-button {
  margin-left: 4px;
}

/* Account creator: three numbered steps. */
.ms-step,
#creator-panel #preview-card,
#creator-panel #results-card {
  padding: 24px 26px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  margin: 0 0 18px;
}
#creator-panel {
  padding-top: 8px;
}
.ms-step-head {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  margin-bottom: 18px;
}
.ms-step-head h2 {
  margin: 0;
  padding: 0;
  font-size: 20px;
}
.unified-app .ms-step-head h2,
.unified-app #creator-panel .section-heading h2 {
  border-bottom: 0;
}
.ms-step-head p {
  margin: 2px 0 0;
  font-size: 13px;
}
.ms-step-num {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  flex-shrink: 0;
  border-radius: 50%;
  background: var(--brand);
  color: #fff;
  font: 600 14px var(--font-sans);
}
.ms-methods {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 20px;
}
.unified-app button.secondary.ms-method {
  display: grid;
  gap: 3px;
  justify-items: start;
  padding: 12px 16px;
  border: 1.5px solid var(--border);
  border-radius: 12px;
  background: var(--surface);
  color: var(--text);
  font-weight: 600;
  text-align: left;
}
.ms-method small {
  color: var(--muted);
  font-weight: 400;
  font-size: 12px;
}
.unified-app button.secondary.ms-method.active {
  border-color: var(--brand);
  background: var(--brand-soft);
  color: var(--brand-ink);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--brand) 12%, transparent);
}
.ms-form-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 14px;
  align-items: end;
}
.ms-form-row > button {
  white-space: nowrap;
}
.ms-settings {
  grid-template-columns: 2fr 1fr 1fr;
  align-items: start;
}
.ms-settings small {
  font-size: 11.5px;
  font-weight: 400;
}
.ms-csv {
  display: grid;
  gap: 12px;
  justify-items: start;
}
.ms-csv textarea {
  width: 100%;
}
.ms-more {
  margin: 16px 0 6px;
  padding: 12px 16px;
  border: 1px solid var(--border-soft);
  border-radius: 10px;
}
.ms-more summary {
  cursor: pointer;
  font-weight: 600;
  color: var(--brand-ink);
}
.ms-more[open] summary {
  margin-bottom: 14px;
}
.ms-more .ms-inline-check {
  margin-bottom: 14px;
  white-space: normal;
}
#preview-status:empty {
  display: none;
}
@media (max-width: 860px) {
  .ms-methods,
  .ms-settings {
    grid-template-columns: 1fr;
  }
}
