.diagnostics-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-width: 32px;
  min-height: 32px;
  padding: 6px 9px;
  border: 1px solid var(--border, #38413a);
  border-radius: 8px;
  background: var(--surface, #202621);
  color: var(--muted, #b2bcb2);
  font:
    500 11px "Segoe UI",
    sans-serif;
  cursor: pointer;
}
.diagnostics-button:hover {
  color: var(--text, #edf0e9);
  border-color: var(--dim, #839183);
}
.diagnostics-login-button {
  position: absolute;
  right: 22px;
  top: 22px;
}
.diagnostics-count {
  font-size: 9px;
  border-radius: 8px;
  background: #8d573a;
  color: #fff;
  padding: 1px 5px;
}
.diagnostics-panel {
  box-sizing: border-box;
  width: min(920px, calc(100vw - 28px));
  max-height: 88dvh;
  padding: 24px;
  border: 1px solid var(--border, #38413a);
  border-radius: 15px;
  background: var(--bg, #181e19);
  color: var(--text, #edf0e9);
  box-shadow: 0 20px 80px #0006;
  font:
    13px "Segoe UI",
    sans-serif;
  overflow: auto;
}
.diagnostics-panel::backdrop {
  background: #030a07ae;
}
.diagnostics-heading {
  display: flex;
  justify-content: space-between;
  align-items: start;
  gap: 15px;
}
.diagnostics-heading h2 {
  font-weight: 550;
  font-size: 23px;
  margin: 7px 0 12px;
  letter-spacing: -0.6px;
}
.diagnostics-eyebrow {
  font-size: 9px;
  letter-spacing: 1.5px;
  color: var(--muted, #a0aca0);
}
.diagnostics-close {
  font-size: 25px;
  color: inherit;
  background: none;
  border: 0;
  padding: 0 8px;
  cursor: pointer;
}
.diagnostics-intro,
.diagnostics-retention,
.diagnostics-notice {
  font-size: 11px;
  line-height: 1.75;
  color: var(--muted, #a0aca0);
  margin: 8px 0 15px;
}
.diagnostics-filters {
  display: grid;
  grid-template-columns: 1.2fr 1fr 1fr;
  gap: 10px;
}
.diagnostics-filters label {
  display: block;
  font-size: 11px;
  color: var(--muted, #a0aca0);
  margin: 0;
}
.diagnostics-filters select,
.diagnostics-filters input {
  display: block;
  box-sizing: border-box;
  width: 100%;
  margin-top: 6px;
  border: 1px solid var(--border, #38413a);
  border-radius: 7px;
  background: var(--surface, #222a23);
  color: var(--text, #edf0e9);
  padding: 9px;
  font:
    12px "Segoe UI",
    sans-serif;
}
.diagnostics-search-label {
  grid-column: 1/-1;
}
.diagnostics-toolbar {
  display: flex;
  gap: 7px;
  flex-wrap: wrap;
  margin: 16px 0 10px;
}
.diagnostics-toolbar button,
#diagnostics-older {
  font:
    11px "Segoe UI",
    sans-serif;
  padding: 8px 10px;
  min-height: 32px;
  border: 1px solid var(--border, #38413a);
  border-radius: 7px;
  background: var(--surface, #222a23);
  color: var(--text, #edf0e9);
  cursor: pointer;
}
.diagnostics-toolbar button:disabled {
  opacity: 0.5;
  cursor: wait;
}
.diagnostics-summary {
  font-size: 10px;
  color: var(--muted, #a0aca0);
  padding: 7px 0;
}
.diagnostics-entries {
  list-style: none;
  padding: 0;
  margin: 0;
  max-height: 40dvh;
  min-height: 140px;
  overflow: auto;
  overscroll-behavior: contain;
  border: 1px solid var(--border, #38413a);
  border-radius: 9px;
}
.diagnostics-entry {
  padding: 13px;
  border-bottom: 1px solid var(--border, #38413a);
  border-left: 3px solid #708479;
}
.diagnostics-entry:last-child {
  border-bottom: 0;
}
.diagnostics-entry[data-level="warning"] {
  border-left-color: #d5ab64;
}
.diagnostics-entry[data-level="error"] {
  border-left-color: #df8981;
}
.diagnostics-meta {
  display: flex;
  align-items: center;
  gap: 9px;
  font-size: 9px;
  color: var(--muted, #a0aca0);
}
.diagnostics-meta time {
  margin-left: auto;
  white-space: nowrap;
}
.diagnostics-level {
  font-weight: 650;
  color: var(--text, #edf0e9);
}
.diagnostics-entry[data-level="error"] .diagnostics-level {
  color: #df8981;
}
.diagnostics-entry[data-level="warning"] .diagnostics-level {
  color: #cba154;
}
.diagnostics-entry p {
  margin: 7px 0;
  font-size: 12px;
  line-height: 1.65;
  color: var(--text, #edf0e9);
}
.diagnostics-entry code {
  font-size: 10px;
  line-height: 1.6;
  color: var(--muted, #a0aca0);
  overflow-wrap: anywhere;
  white-space: pre-wrap;
}
.diagnostics-empty {
  padding: 25px 14px;
  color: var(--muted, #a0aca0);
  font-size: 12px;
  line-height: 1.8;
}
#diagnostics-older {
  margin-top: 10px;
}
.diagnostics-panel :focus-visible {
  outline: 2px solid var(--accent, #b4edb8);
  outline-offset: 3px;
}
.diagnostics-panel [hidden],
.diagnostics-button [hidden] {
  display: none !important;
}
@media (max-width: 600px) {
  .diagnostics-panel {
    padding: 17px;
  }
  .diagnostics-filters {
    grid-template-columns: 1fr 1fr;
  }
  .diagnostics-search-label {
    grid-column: auto;
  }
  .diagnostics-meta {
    flex-wrap: wrap;
  }
  .diagnostics-meta time {
    margin-left: 0;
  }
  .diagnostics-entries {
    max-height: 34dvh;
  }
  .diagnostics-login-button {
    right: 12px;
    top: 12px;
  }
  .diagnostics-heading h2 {
    font-size: 21px;
  }
}
.diagnostics-fallback {
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 20;
}
