.diag-modal-overlay {
  overflow-y: auto;
}

.diag-modal-overlay[hidden] {
  display: none;
}

.diag-modal {
  width: min(1000px, 100%);
}

.diag-modal__head {
  padding: 16px 16px 8px;
}

.diag-modal__frame {
  padding: 8px 16px 16px;
}

.diag-modal__card {
  display: grid;
  grid-template-columns: 272px minmax(0, 1fr);
  grid-template-rows: minmax(504px, auto);
  background: var(--white);
  border: 1px solid var(--hairline);
  border-radius: 12px;
  box-shadow: 0 1px 12px rgba(29, 42, 52, 0.06);
  overflow: hidden;
}

.diag-modal__tabs {
  display: flex;
  flex-direction: column;
  border-right: 1px solid var(--border);
}

.diag-modal__tab {
  position: relative;
  display: flex;
  align-items: center;
  gap: 4px;
  width: 100%;
  height: 56px;
  padding: 0 12px;
  border: none;
  background: transparent;
  color: var(--ink);
  font: inherit;
  font-size: 14px;
  font-weight: 500;
  line-height: 1.6;
  text-align: left;
  cursor: pointer;
}

.diag-modal__tab-icon {
  display: grid;
  flex: 0 0 32px;
  place-items: center;
  width: 32px;
  height: 32px;
  border: 1px solid var(--hairline);
  border-radius: 8px;
  box-sizing: border-box;
}

.diag-modal__tab-icon img {
  display: block;
}

.diag-modal__tab-label {
  white-space: nowrap;
}

.diag-modal__tab-alert {
  flex: 0 0 auto;
  margin-left: 8px;
}

.diag-modal__tab:hover {
  background: var(--brand-100);
  color: var(--brand);
}

.diag-modal__tab.is-selected {
  background: var(--brand-100);
  color: var(--brand);
}

.diag-modal__tab:hover .diag-modal__tab-icon,
.diag-modal__tab.is-selected .diag-modal__tab-icon {
  border-color: var(--border);
}

.diag-modal__tab.is-selected::after {
  content: "";
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  width: 4px;
  border-radius: 8px 0 0 8px;
  background: var(--brand);
}

.diag-modal__tab:focus-visible {
  outline: 2px solid var(--brand);
  outline-offset: -2px;
}

/* Content scrolls inside the height set by the tab column; the alert banner stays pinned above it. */
.diag-modal__panel {
  display: flex;
  flex-direction: column;
  height: 0;
  min-height: 100%;
  min-width: 0;
}

.diag-modal__banner-wrap {
  flex: 0 0 auto;
  padding: 16px 16px 0;
}

.diag-modal__banner {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 12px 16px;
  border: 1px solid #f2b50d;
  border-radius: 8px;
  background: #fffdf0;
}

.diag-modal__banner-title {
  display: flex;
  align-items: center;
  gap: 4px;
  margin: 0;
  color: var(--ink);
  font-size: 14px;
  font-weight: 500;
  line-height: 1.6;
}

.diag-modal__banner-title img {
  flex: 0 0 auto;
}

.diag-modal__banner-text {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
  font-weight: 400;
  line-height: 1.6;
}

.diag-modal__content {
  display: flex;
  flex: 1 1 0;
  align-items: flex-start;
  justify-content: space-between;
  min-height: 0;
  padding: 16px 4px 16px 16px;
  overflow-y: auto;
  box-sizing: border-box;
  scrollbar-width: thin;
  scrollbar-color: #b0b9c4 transparent;
}

.diag-modal__content:focus-visible {
  outline: 2px solid var(--brand);
  outline-offset: -2px;
}

.diag-modal__copy {
  display: flex;
  flex: 1 1 auto;
  flex-direction: column;
  gap: 16px;
  min-width: 0;
}

.diag-modal__heading {
  margin: 0;
  color: var(--ink);
  font-size: 20px;
  font-weight: 600;
  line-height: 1.3;
}

.diag-modal__heading-group {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.diag-modal__reported {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  font-weight: 400;
  line-height: 1.4;
}

.diag-modal__body {
  color: var(--ink);
  font-size: 16px;
  font-weight: 400;
  line-height: 1.5;
}

.diag-modal__body p {
  margin: 0 0 24px;
}

.diag-modal__body > :last-child {
  margin-bottom: 0;
}

.diag-modal__list {
  margin: 0;
  padding: 0 0 0 18px;
  list-style: none;
}

.diag-modal__list li::before {
  content: "- ";
}

.diag-modal__pending {
  color: var(--muted);
}

.diag-modal__illustration {
  display: flex;
  flex: 0 0 auto;
  align-items: center;
  justify-content: center;
  min-width: 202px;
  min-height: 375px;
  padding: 40px 16px 16px;
}

.diag-modal__illustration svg {
  display: block;
}

.diag-tone--success {
  color: #008035;
}

.diag-tone--warning {
  color: #f2b50d;
}

.diag-tone--danger {
  color: #cc0300;
}
