.presentation-json-preview {
  position: relative;
  min-width: 0;
}

.presentation-json-preview .wow-json {
  min-height: 62px;
  padding-top: 42px;
}

.presentation-json-open {
  position: absolute;
  z-index: 2;
  top: 8px;
  right: 8px;
  display: inline-flex;
  width: 30px;
  height: 30px;
  align-items: center;
  justify-content: center;
  padding: 0;
  border: 1px solid rgba(224, 236, 255, .32);
  border-radius: 8px;
  background: #202635;
  color: #f5f5f7;
  cursor: pointer;
}

.presentation-json-open:hover:not(:disabled) {
  border-color: var(--source);
  background: #293249;
}

.presentation-json-open:disabled {
  cursor: not-allowed;
  opacity: .45;
}

.presentation-json-open svg {
  width: 17px;
  height: 17px;
  pointer-events: none;
}

.presentation-json-open:focus-visible,
.presentation-json-dialog :focus-visible {
  outline: 3px solid var(--osl-glass-focus, #d7ff78);
  outline-offset: 2px;
}

.presentation-json-dialog {
  width: min(90dvw, calc(100dvw - 16px));
  height: min(90dvh, calc(100dvh - 16px));
  max-width: none;
  max-height: none;
  margin: auto;
  padding: 0;
  overflow: hidden;
  border: 1px solid rgba(224, 236, 255, .36);
  border-radius: 18px;
  background: #0d111b;
  color: #f5f5f7;
  box-shadow: 0 28px 90px rgba(0, 0, 0, .72);
}

.presentation-json-dialog:not([open]) {
  display: none;
}

.presentation-json-dialog::backdrop {
  background: rgba(2, 4, 9, .78);
  backdrop-filter: blur(3px);
}

.presentation-json-surface {
  display: flex;
  width: 100%;
  height: 100%;
  min-width: 0;
  min-height: 0;
  flex-direction: column;
  background: #0d111b;
}

.presentation-json-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: start;
  padding: 16px 18px 13px;
  border-bottom: 1px solid rgba(224, 236, 255, .18);
  background: #151b2a;
}

.presentation-json-heading {
  min-width: 0;
}

.presentation-json-heading h2 {
  margin: 0;
  font-size: clamp(18px, 2.2vw, 26px);
  line-height: 1.2;
}

.presentation-json-context,
.presentation-json-freshness {
  margin: 5px 0 0;
  overflow-wrap: anywhere;
  color: #aeb8ca;
  font: 600 13px/1.4 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

.presentation-json-redaction {
  display: inline-flex;
  width: fit-content;
  margin-top: 8px;
  padding: 3px 8px;
  border: 1px solid #d6a94a;
  border-radius: 999px;
  color: #f4d783;
  background: rgba(214, 169, 74, .12);
  font: 800 12px/1.35 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  text-transform: uppercase;
  letter-spacing: .03em;
}

.presentation-json-redaction[data-redacted="false"] {
  border-color: #46d18a;
  color: #83eeb4;
  background: rgba(70, 209, 138, .1);
}

.presentation-json-close {
  display: inline-flex;
  width: 42px;
  height: 42px;
  align-items: center;
  justify-content: center;
  padding: 0;
  border: 1px solid rgba(224, 236, 255, .3);
  border-radius: 11px;
  background: #20283a;
  color: #f5f5f7;
  font: 800 22px/1 system-ui, sans-serif;
  cursor: pointer;
}

.presentation-json-controls {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 9px;
  padding: 11px 18px 12px;
  border-bottom: 1px solid rgba(224, 236, 255, .12);
  background: #111724;
}

.presentation-json-path-label {
  grid-column: 1 / -1;
  color: #c9d2e3;
  font-size: 12px;
  font-weight: 750;
}

.presentation-json-path {
  min-width: 0;
  height: 42px;
  padding: 8px 11px;
  border: 1px solid rgba(224, 236, 255, .28);
  border-radius: 9px;
  background: #090d15;
  color: #f5f5f7;
  font: 16px/1.3 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

.presentation-json-highlight-button {
  min-height: 42px;
  padding: 8px 14px;
  border: 1px solid #a3e635;
  border-radius: 9px;
  background: rgba(163, 230, 53, .14);
  color: #d7ff78;
  font-weight: 800;
  cursor: pointer;
}

.presentation-json-path-status {
  grid-column: 1 / -1;
  min-height: 20px;
  margin: 0;
  color: #aeb8ca;
  font-size: 12px;
}

.presentation-json-output {
  flex: 1 1 auto;
  min-width: 0;
  min-height: 0;
  margin: 0;
  padding: 20px 22px 44px;
  overflow: auto;
  background: #090d15;
  color: #e8edf6;
  font: 19px/1.58 ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
  font-variant-ligatures: none;
  tab-size: 2;
  white-space: pre;
  overscroll-behavior: contain;
}

.presentation-json-line {
  display: block;
  width: max-content;
  min-width: 100%;
  padding: 1px 8px;
  border-left: 4px solid transparent;
  border-radius: 4px;
  scroll-margin-block: 35vh;
}

.presentation-json-key { color: #9cdcfe; }
.presentation-json-string { color: #ce9178; }
.presentation-json-number { color: #b5cea8; }
.presentation-json-boolean { color: #c586c0; }
.presentation-json-null { color: #c586c0; font-style: italic; }
.presentation-json-punctuation { color: #d4d4d4; }

.presentation-json-highlight {
  border-left-color: #d7ff78;
  outline: 2px solid rgba(215, 255, 120, .82);
  outline-offset: -2px;
  background: rgba(163, 230, 53, .2);
  box-shadow: 0 0 0 6px rgba(163, 230, 53, .07);
}

@media (max-width: 620px) {
  .presentation-json-dialog {
    border-radius: 13px;
  }

  .presentation-json-head {
    padding: 12px;
  }

  .presentation-json-controls {
    grid-template-columns: 1fr;
    padding: 10px 12px;
  }

  .presentation-json-path-label,
  .presentation-json-path-status {
    grid-column: 1;
  }

  .presentation-json-output {
    padding: 16px 10px 36px;
    font-size: 18px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .presentation-json-dialog::backdrop {
    backdrop-filter: none;
  }
}

@media (forced-colors: active) {
  .presentation-json-dialog,
  .presentation-json-close,
  .presentation-json-open,
  .presentation-json-path,
  .presentation-json-highlight-button {
    border: 2px solid CanvasText;
    background: Canvas;
    color: CanvasText;
    forced-color-adjust: auto;
  }

  .presentation-json-highlight {
    border-left-color: Highlight;
    outline-color: Highlight;
  }
}
