.mi-schema-validator {
  color: #132238;
  display: grid;
  gap: 1.5rem;
  font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
}

.mi-schema-validator__hero,
.mi-schema-validator__form,
.mi-schema-validator__card,
.mi-schema-validator__section,
.mi-schema-validator__details {
  background: linear-gradient(180deg, #ffffff 0%, #f6f8fc 100%);
  border: 1px solid #d9e1ef;
  border-radius: 18px;
  box-shadow: 0 10px 30px rgba(19, 34, 56, 0.06);
}

.mi-schema-validator__hero,
.mi-schema-validator__form,
.mi-schema-validator__section {
  padding: 1.25rem;
}

.mi-schema-validator__hero h2,
.mi-schema-validator__section h3,
.mi-schema-validator__section h4 {
  margin: 0 0 0.75rem;
}

.mi-schema-validator__hero {
  background: radial-gradient(circle at top left, #eaf4ff 0%, #ffffff 42%, #f7f3ea 100%);
}

.mi-schema-validator__form-row {
  display: grid;
  gap: 0.75rem;
  grid-template-columns: minmax(0, 1fr) auto;
  margin-top: 0.5rem;
}

.mi-schema-validator input[type="url"] {
  border: 1px solid #c8d4e7;
  border-radius: 12px;
  font-size: 1rem;
  min-width: 0;
  padding: 0.9rem 1rem;
}

.mi-schema-validator button {
  background: #163a63;
  border: 0;
  border-radius: 12px;
  color: #fff;
  cursor: pointer;
  font-size: 0.95rem;
  font-weight: 600;
  padding: 0.9rem 1.2rem;
}

.mi-schema-validator button:hover {
  background: #0f2d4e;
}

.mi-schema-validator__note,
.mi-schema-validator__empty {
  color: #5f7087;
  font-size: 0.95rem;
}

.mi-schema-validator__alert {
  border-radius: 14px;
  padding: 0.9rem 1rem;
}

.mi-schema-validator__alert--error {
  background: #fff0ef;
  border: 1px solid #f0b4af;
  color: #8f2f28;
}

.mi-schema-validator__summary-grid,
.mi-schema-validator__types-grid,
.mi-schema-validator__entity-grid {
  display: grid;
  gap: 1rem;
}

.mi-schema-validator__summary-grid {
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
}

.mi-schema-validator__types-grid,
.mi-schema-validator__entity-grid {
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
}

.mi-schema-validator__types-grid > *,
.mi-schema-validator__entity-grid > *,
.mi-schema-validator__modal-grid > * {
  min-width: 0;
}

.mi-schema-validator__card {
  padding: 1rem;
}

.mi-schema-validator__label {
  color: #60728a;
  display: block;
  font-size: 0.8rem;
  letter-spacing: 0.04em;
  margin-bottom: 0.35rem;
  text-transform: uppercase;
}

.mi-schema-validator__list {
  margin: 0;
  padding-left: 1.1rem;
}

.mi-schema-validator__list li {
  margin: 0.35rem 0;
}

.mi-schema-validator__stack {
  display: grid;
  gap: 1rem;
}

.mi-schema-validator__details {
  padding: 1rem;
}

.mi-schema-validator__details summary {
  cursor: pointer;
  font-weight: 600;
}

.mi-schema-validator pre,
.mi-schema-validator__clipboard {
  background: #102038;
  border-radius: 14px;
  color: #e5eefc;
  font-family: Menlo, Monaco, Consolas, monospace;
  font-size: 0.82rem;
  overflow: auto;
  padding: 1rem;
}

.mi-schema-validator__section-head {
  align-items: center;
  display: flex;
  gap: 0.75rem;
  justify-content: space-between;
}

.mi-schema-validator__copy {
  background: #eef4fb;
  color: #163a63;
}

.mi-schema-validator__type-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  list-style: none;
  margin: 0;
  padding: 0;
}

.mi-schema-validator__type-list li {
  margin: 0;
}

.mi-schema-validator__type-link {
  align-items: center;
  background: linear-gradient(180deg, #f8fbff 0%, #edf4fc 100%);
  border: 1px solid #c8d7eb;
  border-radius: 999px;
  color: #15314f;
  cursor: pointer;
  display: inline-flex;
  gap: 0.55rem;
  min-height: 42px;
  padding: 0.45rem 0.55rem 0.45rem 0.9rem;
  transition: transform 0.16s ease, box-shadow 0.16s ease, border-color 0.16s ease, background 0.16s ease, color 0.16s ease;
}

.mi-schema-validator__type-link:hover,
.mi-schema-validator__type-link:focus-visible {
  background: linear-gradient(180deg, #163a63 0%, #1d4c80 100%);
  border-color: #163a63;
  box-shadow: 0 10px 24px rgba(22, 58, 99, 0.18);
  color: #ffffff;
  outline: none;
  transform: translateY(-1px);
}

.mi-schema-validator__type-link:hover .mi-schema-validator__type-label,
.mi-schema-validator__type-link:hover .mi-schema-validator__type-count,
.mi-schema-validator__type-link:focus-visible .mi-schema-validator__type-label,
.mi-schema-validator__type-link:focus-visible .mi-schema-validator__type-count {
  color: #ffffff;
}

.mi-schema-validator__type-label {
  color: inherit;
  font-size: 0.95rem;
  font-weight: 700;
  line-height: 1.1;
}

.mi-schema-validator__type-count {
  align-items: center;
  background: rgba(255, 255, 255, 0.72);
  border-radius: 999px;
  color: #15314f;
  display: inline-flex;
  font-size: 0.82rem;
  font-weight: 700;
  justify-content: center;
  min-width: 1.9rem;
  padding: 0.22rem 0.5rem;
}

.mi-schema-validator__entity-group + .mi-schema-validator__entity-group {
  margin-top: 1.5rem;
}

.mi-schema-validator__entity-card {
  background: #fff;
  border: 1px solid #d9e1ef;
  border-radius: 16px;
  display: grid;
  gap: 0.7rem;
  min-width: 0;
  overflow: hidden;
  padding: 1rem;
}

.mi-schema-validator__entity-card strong,
.mi-schema-validator__entity-card p,
.mi-schema-validator__entity-card dl {
  margin: 0;
  min-width: 0;
}

.mi-schema-validator__entity-card strong,
.mi-schema-validator__entity-card p,
.mi-schema-validator__entity-card dt,
.mi-schema-validator__entity-card dd {
  overflow-wrap: anywhere;
  word-break: break-word;
}

.mi-schema-validator__entity-card dl {
  display: grid;
  gap: 0.35rem;
}

.mi-schema-validator__entity-card dt {
  color: #60728a;
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
}

.mi-schema-validator__entity-card dd {
  margin: 0;
}

.mi-schema-validator__pill {
  background: #e9f1fb;
  border-radius: 999px;
  color: #163a63;
  display: inline-flex;
  font-size: 0.8rem;
  font-weight: 600;
  padding: 0.3rem 0.6rem;
  width: fit-content;
}

.mi-schema-validator__clipboard {
  height: 1px;
  left: -9999px;
  opacity: 0;
  position: absolute;
  pointer-events: none;
  width: 1px;
}

.mi-schema-validator__modal[hidden] {
  display: none;
}

.mi-schema-validator__modal {
  inset: 0;
  position: fixed;
  z-index: 99999;
}

.mi-schema-validator__modal-backdrop {
  background: rgba(10, 17, 28, 0.68);
  inset: 0;
  position: absolute;
}

.mi-schema-validator__modal-panel {
  background: linear-gradient(180deg, #ffffff 0%, #f4f7fc 100%);
  border: 1px solid #d7e1f0;
  border-radius: 22px;
  box-shadow: 0 24px 80px rgba(19, 34, 56, 0.22);
  left: 50%;
  max-height: 86vh;
  max-width: min(1080px, calc(100vw - 2rem));
  overflow: hidden;
  position: absolute;
  top: 50%;
  transform: translate(-50%, -50%);
  width: 100%;
}

.mi-schema-validator__modal-head,
.mi-schema-validator__modal-stats,
.mi-schema-validator__modal-body {
  padding: 1rem 1.25rem;
}

.mi-schema-validator__modal-head {
  align-items: flex-start;
  border-bottom: 1px solid #d9e1ef;
  display: flex;
  gap: 1rem;
  justify-content: space-between;
}

.mi-schema-validator__modal-head h3 {
  margin: 0 0 0.35rem;
}

.mi-schema-validator__modal-head p {
  color: #5f7087;
  margin: 0;
}

.mi-schema-validator__modal-head p:empty {
  display: none;
}

.mi-schema-validator__modal-close {
  background: #eef4fb;
  color: #163a63;
}

.mi-schema-validator__modal-pill {
  background: #e9f1fb;
  border-radius: 999px;
  color: #163a63;
  display: inline-flex;
  font-size: 0.82rem;
  font-weight: 600;
  padding: 0.35rem 0.65rem;
}

.mi-schema-validator__modal-body {
  max-height: calc(86vh - 130px);
  overflow: auto;
}

.mi-schema-validator__modal-grid {
  display: grid;
  gap: 1rem;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
}

.mi-schema-validator__modal-card {
  background: #fff;
  border: 1px solid #d9e1ef;
  border-radius: 16px;
  display: grid;
  gap: 0.75rem;
  min-width: 0;
  overflow: hidden;
  padding: 1rem;
}

.mi-schema-validator__modal-card h4,
.mi-schema-validator__modal-card p,
.mi-schema-validator__modal-card dl {
  margin: 0;
  min-width: 0;
}

.mi-schema-validator__modal-card h4,
.mi-schema-validator__modal-card p,
.mi-schema-validator__modal-card dt,
.mi-schema-validator__modal-card dd {
  overflow-wrap: anywhere;
  word-break: break-word;
}

.mi-schema-validator__modal-card dl {
  display: grid;
  gap: 0.35rem;
}

.mi-schema-validator__modal-card dt {
  color: #60728a;
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
}

.mi-schema-validator__modal-card dd {
  margin: 0;
}

.mi-schema-validator__modal-card details {
  background: #f7f9fd;
  border: 1px solid #d9e1ef;
  border-radius: 12px;
  padding: 0.75rem 0.85rem;
}

.mi-schema-validator__modal-card details summary {
  cursor: pointer;
  font-weight: 600;
}

.mi-schema-validator__modal-card pre {
  margin-top: 0.75rem;
}

.mi-schema-validator__json-details {
  margin-top: 0.9rem;
}

.mi-schema-validator__json-actions {
  display: flex;
  gap: 0.65rem;
  justify-content: flex-end;
  margin: 0.75rem 0;
}

.mi-schema-validator__json-preview {
  max-height: 300px;
  min-height: 140px;
  overflow: auto;
  overflow-wrap: anywhere;
  white-space: pre-wrap;
  word-break: break-word;
}

@media (max-width: 720px) {
  .mi-schema-validator__form-row {
    grid-template-columns: 1fr;
  }

  .mi-schema-validator__section-head {
    align-items: flex-start;
    flex-direction: column;
  }

  .mi-schema-validator__modal-panel {
    max-width: calc(100vw - 1rem);
  }
}
