.json-diff-shell,
.json-diff-shell *,
.json-diff-shell *::before,
.json-diff-shell *::after {
  box-sizing: border-box;
}

.json-diff-shell {
  display: grid;
  gap: 24px;
  overflow-x: clip;
}

.json-diff-page .section-inner {
  max-width: min(var(--max), 100%);
}

.json-diff-workbench {
  display: grid;
  gap: 18px;
  grid-template-columns: minmax(0, 1fr) minmax(300px, 0.34fr);
}

.json-diff-panel,
.json-diff-side-panel,
.json-diff-card {
  background: #ffffff;
  border: 1px solid rgba(23, 32, 31, 0.12);
  border-radius: 8px;
  box-shadow: 0 14px 34px rgba(23, 32, 31, 0.07);
}

.json-diff-panel {
  display: grid;
  gap: 18px;
  min-width: 0;
  padding: 22px;
}

.json-diff-side {
  align-content: start;
  display: grid;
  gap: 14px;
  min-width: 0;
}

.json-diff-side-panel,
.json-diff-card {
  display: grid;
  gap: 12px;
  padding: 18px;
}

.json-diff-heading,
.json-diff-subhead {
  align-items: start;
  display: flex;
  gap: 14px;
  justify-content: space-between;
}

.json-diff-heading h2,
.json-diff-side-panel h2,
.json-diff-card h3,
.json-diff-subhead h3,
.json-diff-empty h3 {
  color: #17201f;
  line-height: 1.3;
  margin: 0;
}

.json-diff-heading h2,
.json-diff-side-panel h2 {
  font-size: 20px;
}

.json-diff-card h3,
.json-diff-subhead h3,
.json-diff-empty h3 {
  font-size: 16px;
}

.json-diff-heading p,
.json-diff-side-panel p,
.json-diff-card p,
.json-diff-empty p,
.json-diff-help,
.json-diff-list li {
  color: #5f6c68;
  line-height: 1.6;
  margin: 0;
}

.json-diff-chip {
  align-items: center;
  background: #e9f2ff;
  border: 1px solid rgba(43, 91, 143, 0.18);
  border-radius: 8px;
  color: #244f7f;
  display: inline-flex;
  flex: 0 0 auto;
  font-size: 12px;
  font-weight: 850;
  min-height: 30px;
  padding: 5px 9px;
  white-space: nowrap;
}

.json-diff-inputs {
  display: grid;
  gap: 14px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.json-diff-field,
.json-diff-unlock {
  display: grid;
  gap: 8px;
  min-width: 0;
}

.json-diff-field span,
.json-diff-unlock span {
  color: #263331;
  font-size: 13px;
  font-weight: 850;
}

.json-diff-field textarea,
.json-diff-unlock input {
  background: #ffffff;
  border: 1px solid rgba(23, 32, 31, 0.18);
  border-radius: 8px;
  color: #17201f;
  font: inherit;
  min-width: 0;
  padding: 10px 12px;
  width: 100%;
}

.json-diff-field textarea {
  min-height: 300px;
  resize: vertical;
}

.json-diff-field textarea:focus-visible,
.json-diff-unlock input:focus-visible,
.json-diff-button:focus-visible,
.json-diff-buy:focus-visible {
  outline: 2px solid #244f7f;
  outline-offset: 2px;
}

.json-diff-actions,
.json-diff-export-actions,
.json-diff-unlock-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.json-diff-button,
.json-diff-buy {
  align-items: center;
  background: #17201f;
  border: 1px solid #17201f;
  border-radius: 8px;
  color: #ffffff;
  cursor: pointer;
  display: inline-flex;
  font: inherit;
  font-weight: 800;
  justify-content: center;
  min-height: 42px;
  padding: 10px 14px;
  text-decoration: none;
}

.json-diff-button.is-secondary,
.json-diff-buy.is-secondary {
  background: #ffffff;
  color: #17201f;
}

.json-diff-button:disabled {
  background: #edf2ef;
  border-color: #d5ded9;
  color: #7a8581;
  cursor: not-allowed;
}

.json-diff-status {
  align-items: center;
  color: #5f6c68;
  display: inline-flex;
  line-height: 1.5;
  min-height: 42px;
}

.json-diff-alert,
.json-diff-error {
  background: #fff4e6;
  border: 1px solid rgba(181, 91, 11, 0.22);
  border-radius: 8px;
  color: #7a3f08;
  line-height: 1.6;
  padding: 12px 14px;
}

.json-diff-error:empty {
  display: none;
}

.json-diff-results {
  display: grid;
  gap: 10px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.json-diff-metric {
  background: #f8faf8;
  border: 1px solid rgba(23, 32, 31, 0.08);
  border-radius: 8px;
  display: grid;
  gap: 5px;
  min-height: 78px;
  padding: 12px;
}

.json-diff-metric span {
  color: #5f6c68;
  font-size: 12px;
  font-weight: 800;
}

.json-diff-metric strong {
  color: #17201f;
  font-size: 24px;
  line-height: 1.15;
}

.json-diff-preview {
  display: grid;
  gap: 10px;
}

.json-diff-item {
  background: #f8faf8;
  border: 1px solid rgba(23, 32, 31, 0.1);
  border-radius: 8px;
  display: grid;
  gap: 8px;
  padding: 12px;
}

.json-diff-item[data-type="added"] {
  border-left: 4px solid #1f7a4d;
}

.json-diff-item[data-type="removed"] {
  border-left: 4px solid #a74333;
}

.json-diff-item[data-type="changed"] {
  border-left: 4px solid #b56b0b;
}

.json-diff-item-header {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.json-diff-badge {
  background: #17201f;
  border-radius: 8px;
  color: #ffffff;
  display: inline-flex;
  font-size: 12px;
  font-weight: 850;
  padding: 5px 8px;
}

.json-diff-path {
  color: #17201f;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
  font-size: 13px;
  overflow-wrap: anywhere;
}

.json-diff-values {
  display: grid;
  gap: 8px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.json-diff-values code {
  background: #ffffff;
  border: 1px solid rgba(23, 32, 31, 0.08);
  border-radius: 8px;
  color: #263331;
  display: block;
  font-size: 12px;
  max-height: 120px;
  overflow: auto;
  padding: 8px;
  white-space: pre-wrap;
}

.json-diff-empty {
  background: #f8faf8;
  border: 1px dashed #aebbb5;
  border-radius: 8px;
  display: grid;
  gap: 8px;
  padding: 18px;
}

.json-diff-list {
  display: grid;
  gap: 8px;
  margin: 0;
  padding-left: 20px;
}

@media (max-width: 900px) {
  .json-diff-workbench,
  .json-diff-inputs,
  .json-diff-results,
  .json-diff-values {
    grid-template-columns: 1fr;
  }

  .json-diff-panel,
  .json-diff-side-panel,
  .json-diff-card {
    padding: 16px;
  }

  .json-diff-heading,
  .json-diff-subhead {
    display: grid;
  }

  .json-diff-field textarea {
    min-height: 220px;
  }
}

@media (max-width: 560px) {
  .json-diff-actions .json-diff-button,
  .json-diff-export-actions .json-diff-button,
  .json-diff-buy,
  .json-diff-unlock-row .json-diff-button {
    width: 100%;
  }
}
