/* JSON Formatterの共通レイアウトに追加するSchema生成専用トークン。 */
.json-schema-page {
  --json-editor-drag-accent: var(--json-focus);
  --json-schema-field-basis: 260px;
  --json-schema-description-basis: 360px;
  --json-schema-field-gap: 5px;
  --json-schema-result-gap: 16px;
  --json-schema-export-gap: 10px;
  --json-schema-export-input-width: 280px;
  --json-schema-warning-background: #fff8e5;
  --json-schema-warning-border: #e4b341;
  --json-schema-warning-text: #5f4600;
  --json-schema-warning-margin: 0 14px 14px;
  --json-schema-warning-padding: 12px 14px;
  --json-schema-warning-radius: 7px;
  --json-schema-warning-heading-gap: 8px;
  --json-schema-warning-list-indent: 22px;
}

/* Schema基本情報 */
.json-schema-page .json-schema-field {
  display: grid;
  flex: 1 1 var(--json-schema-field-basis);
  gap: var(--json-schema-field-gap);
  color: var(--json-muted);
}

.json-schema-page .json-schema-field--description {
  flex-basis: var(--json-schema-description-basis);
}

/* 生成結果とファイル出力 */
.json-schema-page .json-schema-result-panel {
  margin-block-start: var(--json-schema-result-gap);
}

.json-schema-page .json-schema-export {
  display: flex;
  flex-wrap: wrap;
  align-items: end;
  justify-content: flex-end;
  gap: var(--json-schema-export-gap);
}

.json-schema-page .json-schema-export-field {
  display: grid;
  gap: var(--json-schema-field-gap);
  color: var(--json-muted);
}

.json-schema-page .json-schema-export-file-name {
  min-width: var(--json-schema-export-input-width);
}

.json-schema-page .json-schema-stats {
  grid-template-columns: repeat(6, minmax(0, 1fr));
}

/* Schema推定時の警告 */
.json-schema-page .json-schema-warnings {
  margin: var(--json-schema-warning-margin);
  padding: var(--json-schema-warning-padding);
  border: 1px solid var(--json-schema-warning-border);
  border-radius: var(--json-schema-warning-radius);
  color: var(--json-schema-warning-text);
  background: var(--json-schema-warning-background);
}

.json-schema-page .json-schema-warnings h3 {
  margin-block: 0 var(--json-schema-warning-heading-gap);
}

.json-schema-page .json-schema-warnings ul {
  margin-block: 0;
  padding-inline-start: var(--json-schema-warning-list-indent);
}

/* タブレット以下では統計情報を3列にする。 */
@media (max-width: 1000px) {
  .json-schema-page .json-schema-stats {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

/* スマートフォンでは設定項目と結果操作を縦に並べる。 */
@media (max-width: 700px) {
  .json-schema-page .json-schema-settings,
  .json-schema-page .json-schema-metadata {
    align-items: stretch;
    flex-direction: column;
  }

  .json-schema-page .json-schema-settings :is(.json-format-setting, .json-format-select) {
    width: 100%;
    min-width: 0;
  }

  .json-schema-page .json-schema-metadata :is(.json-schema-field, .json-format-input) {
    width: 100%;
    min-width: 0;
  }

  .json-schema-page .json-schema-export,
  .json-schema-page .json-schema-export :is(.json-schema-export-field, .json-schema-export-file-name) {
    width: 100%;
    min-width: 0;
  }

  .json-schema-page .json-schema-stats {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
