.json-formatter-page {
  --json-frame-width: 1200px;
  --json-border: rgba(91, 109, 139, 0.28);
  --json-border-strong: rgba(94, 167, 255, 0.36);
  --json-ink: rgba(28, 37, 53, 0.98);
  --json-muted: rgba(206, 219, 239, 0.9);
  --json-panel-input: linear-gradient(180deg, rgba(28, 41, 66, 0.98), rgba(15, 21, 37, 0.99));
  --json-panel-output: linear-gradient(180deg, rgba(20, 31, 52, 0.98), rgba(10, 18, 34, 0.99));
  --json-editor: linear-gradient(180deg, rgba(247, 249, 252, 0.99), rgba(235, 240, 248, 0.99));
  --json-editor-shadow: rgba(15, 25, 42, 0.12);
  --json-editor-border: rgba(123, 145, 183, 0.28);
  --json-success: rgba(139, 226, 186, 0.96);
  --json-error: rgba(255, 150, 145, 0.98);
  --json-warning: rgba(247, 210, 124, 0.98);
}

.json-formatter-page .tool-frame {
  width: 100%;
  max-width: var(--json-frame-width);
  margin-inline: auto;
  padding-inline: clamp(0.35rem, 1vw, 0.7rem);
}

.json-formatter-page .tool-header-block {
  max-width: 42ch;
  padding-inline: 0.2rem;
}

.json-formatter-page .page-title {
  max-width: none;
  font-size: clamp(2.75rem, 3.7vw, 3.18rem);
  line-height: 0.96;
  white-space: nowrap;
}

.json-formatter-page .page-subtitle {
  max-width: 36ch;
  font-size: clamp(1.04rem, 1.4vw, 1.12rem);
}

@media (min-width: 721px) {
  .json-formatter-page .page-subtitle {
    font-size: 1.08rem;
  }
}

.json-bench {
  display: grid;
  gap: 0.74rem;
  padding: clamp(0.72rem, 1.1vw, 0.92rem);
  border-radius: 2rem;
  border: 1px solid rgba(93, 128, 178, 0.22);
  background:
    radial-gradient(circle at 12% 14%, rgba(104, 167, 255, 0.18), transparent 28%),
    radial-gradient(circle at 85% 12%, rgba(102, 214, 181, 0.14), transparent 30%),
    linear-gradient(180deg, rgba(17, 24, 40, 0.985), rgba(8, 13, 25, 0.995));
  box-shadow: 0 28px 56px rgba(4, 10, 24, 0.34);
}

.json-bench__rail {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
}

.json-chip,
.json-pill,
.json-diagnostics__chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 2.18rem;
  padding-inline: 0.92rem;
  border-radius: 999px;
  border: 1px solid rgba(117, 145, 190, 0.42);
  background: rgba(26, 41, 68, 0.45);
  color: rgba(231, 238, 250, 0.93);
  font-size: 0.93rem;
  line-height: 1;
  white-space: nowrap;
}

.json-pill {
  min-height: 2.08rem;
  font-size: 0.9rem;
}

.json-pill--quiet {
  color: rgba(194, 207, 232, 0.78);
}

.json-bench__layout {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.68rem;
  align-items: stretch;
}

.json-panel {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto auto;
  gap: 0.68rem;
  min-width: 0;
  min-height: 100%;
  padding: 0.72rem;
  border-radius: 1.48rem;
  border: 1px solid var(--json-border);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

.json-panel--input {
  background: var(--json-panel-input);
}

.json-panel--output {
  background: var(--json-panel-output);
}

.json-panel__header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.8rem;
  min-height: 4.35rem;
}

.json-panel__header > div {
  flex: 1 1 auto;
  min-height: 4.35rem;
  display: grid;
  align-content: start;
}

.json-panel__eyebrow {
  margin: 0 0 0.24rem;
  color: rgba(250, 245, 234, 0.98);
  font-size: 0.82rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.json-panel__hint {
  margin: 0;
  color: var(--json-muted);
  font-size: 0.93rem;
  line-height: 1.22;
  max-width: 20ch;
}

.json-panel__meta {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 0.55rem;
}

.json-textarea {
  width: 100%;
  min-height: 9.55rem;
  resize: vertical;
  padding: 1rem 1.05rem;
  border: 1px solid var(--json-editor-border);
  border-radius: 1.18rem;
  background: var(--json-editor);
  color: var(--json-ink);
  font: 600 0.97rem/1.48 Consolas, "SFMono-Regular", Menlo, Monaco, monospace;
  box-shadow:
    inset 0 0 0 1px rgba(255, 255, 255, 0.14),
    0 10px 24px var(--json-editor-shadow);
}

.json-textarea::placeholder {
  color: rgba(100, 109, 129, 0.84);
}

.json-textarea:focus-visible {
  outline: 2px solid rgba(119, 183, 255, 0.74);
  outline-offset: 2px;
}

.json-textarea--output {
  min-height: 9.2rem;
}

.json-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.72rem;
}

.json-actions .button,
.json-copy {
  min-height: 2.8rem;
  justify-content: center;
  font-size: 0.95rem;
}

.json-copy {
  min-width: 6.8rem;
}

.json-feedback-slot {
  min-height: 1.2rem;
  display: flex;
  align-items: center;
}

.json-inline-feedback {
  margin: 0;
  color: rgba(132, 190, 255, 0.98);
  font-size: 0.86rem;
  line-height: 1.18;
}

.json-inline-feedback[data-tone="success"] {
  color: var(--json-success);
}

.json-inline-feedback[data-tone="error"] {
  color: var(--json-error);
}

.json-inline-feedback[data-tone="warning"] {
  color: var(--json-warning);
}

.json-diagnostics {
  display: grid;
  gap: 0.46rem;
  padding: 0.66rem 0.72rem;
  border-radius: 1.18rem;
  border: 1px solid rgba(102, 128, 172, 0.3);
  background: rgba(14, 22, 39, 0.5);
}

.json-diagnostics[data-tone="success"] {
  border-color: rgba(112, 188, 145, 0.4);
  background: rgba(14, 32, 28, 0.52);
}

.json-diagnostics[data-tone="error"] {
  border-color: rgba(192, 108, 105, 0.42);
  background: rgba(43, 18, 22, 0.52);
}

.json-diagnostics__summary {
  display: grid;
  gap: 0.28rem;
}

.json-diagnostics__title,
.json-diagnostics__detail {
  margin: 0;
}

.json-diagnostics__title {
  color: rgba(245, 248, 252, 0.98);
  font-size: 0.95rem;
  font-weight: 700;
}

.json-diagnostics__detail {
  color: rgba(203, 216, 238, 0.9);
  font-size: 0.89rem;
  line-height: 1.28;
}

.json-diagnostics__chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
}

.json-diagnostics__chip {
  justify-content: flex-start;
  min-height: 1.86rem;
  background: rgba(255, 255, 255, 0.06);
  font-size: 0.86rem;
}

.json-metrics {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, max-content));
  align-content: start;
  gap: 0.44rem;
  min-height: 3.9rem;
}

@media (max-width: 1080px) {
  .json-formatter-page .tool-header-block {
    max-width: 46ch;
    padding-inline: 0.1rem;
  }

  .json-bench {
    padding: 0.68rem;
  }

  .json-panel {
    padding: 0.6rem;
  }

  .json-textarea,
  .json-textarea--output {
    min-height: 9.2rem;
  }
}

@media (max-width: 860px) and (min-width: 721px) {
  .json-bench__rail {
    display: none;
  }

  .json-bench {
    gap: 0.72rem;
    padding: 0.68rem;
  }

  .json-bench__layout {
    gap: 0.68rem;
  }

  .json-panel {
    gap: 0.72rem;
    padding: 0.62rem;
  }

  .json-panel__header {
    gap: 0.65rem;
    min-height: 4.2rem;
  }

  .json-panel__header > div {
    min-height: 4.2rem;
  }

  .json-panel__hint {
    font-size: 0.94rem;
    line-height: 1.24;
    max-width: 20ch;
  }

  .json-textarea,
  .json-textarea--output {
    min-height: 8.9rem;
    padding: 0.88rem 0.92rem;
    font-size: 0.95rem;
    line-height: 1.42;
  }

  .json-actions .button,
  .json-copy {
    min-height: 2.72rem;
    font-size: 0.92rem;
  }
}

@media (max-width: 720px) {
  .json-formatter-page .tool-header-block {
    max-width: none;
    padding-inline: 0.42rem;
  }

  .json-formatter-page .page-title {
    max-width: none;
    font-size: clamp(1.92rem, 8vw, 2.24rem);
    line-height: 1;
    white-space: nowrap;
  }

  .json-formatter-page .page-subtitle {
    max-width: 34ch;
    padding-inline: 0.12rem 0.08rem;
    font-size: 0.9rem;
    line-height: 1.18;
  }

  .json-bench__rail {
    display: none;
  }

  .json-bench__layout {
    grid-template-columns: 1fr;
    gap: 0.52rem;
  }

  .json-bench {
    padding: 0.62rem;
    gap: 0.32rem;
  }

  .json-panel {
    padding: 0.58rem;
    gap: 0.32rem;
  }

  .json-panel__header {
    flex-direction: column;
    align-items: stretch;
    min-height: 0;
    gap: 0.28rem;
  }

  .json-panel__header > div {
    min-height: 0;
  }

  .json-panel__meta {
    justify-content: flex-start;
    gap: 0.28rem;
  }

  .json-panel--input .json-pill--quiet {
    display: none;
  }

  .json-panel__hint {
    max-width: none;
    font-size: 0.84rem;
    line-height: 1.18;
  }

  .json-textarea,
  .json-textarea--output {
    min-height: 8.35rem;
    padding: 0.68rem;
    font-size: 0.95rem;
  }

  .json-panel--output {
    margin-top: 0;
    padding-top: 0.58rem;
  }

  .json-panel--output .json-panel__header {
    position: static;
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
    gap: 0.6rem;
  }

  .json-panel--output .json-panel__header > div {
    display: flex;
    min-height: 0;
  }

  .json-panel--output .json-panel__hint {
    display: none;
  }

  .json-copy {
    min-width: 5.4rem;
    min-height: 2.5rem;
  }

  .json-actions {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0.5rem;
  }

  .json-actions .button:first-child {
    grid-column: 1 / -1;
  }

  .json-actions .button,
  .json-copy {
    min-height: 2.5rem;
    font-size: 0.88rem;
  }

  .json-feedback-slot {
    min-height: 0.92rem;
  }

  .json-inline-feedback {
    font-size: 0.78rem;
    line-height: 1.12;
  }

  .json-diagnostics {
    padding: 0.5rem 0.58rem;
  }

  .json-diagnostics__detail {
    font-size: 0.85rem;
  }

  .json-diagnostics__chip {
    min-height: 1.72rem;
    font-size: 0.81rem;
  }

  .json-metrics {
    display: flex;
    flex-wrap: wrap;
    min-height: 0;
  }
}

@media (max-width: 480px) {
  .json-formatter-page .tool-frame {
    padding-inline: 0.46rem;
  }

  .json-formatter-page .tool-header-block {
    padding-inline: 0.44rem;
  }

  .json-formatter-page .page-subtitle {
    padding-inline: 0.1rem 0.06rem;
  }

  .json-chip,
  .json-pill,
  .json-diagnostics__chip {
    min-height: 2.02rem;
    padding-inline: 0.82rem;
    font-size: 0.87rem;
  }

  .json-panel__hint {
    font-size: 0.96rem;
  }

  .json-panel {
    padding: 0.58rem;
  }

  .json-textarea,
  .json-textarea--output {
    min-height: 7.7rem;
  }
}
