/* JSON整形・チェック ツール専用スタイル。
   common.css のレガシーグローバル（h2{width:900px} / *{font-size:14px} 等）を
   打ち消すため、寸法・フォントサイズは明示的に指定している。 */

.jsonf {
  max-width: 960px;
  margin: 24px auto 0;
  box-sizing: border-box;
}

.jsonf *,
.jsonf *::before,
.jsonf *::after {
  box-sizing: border-box;
}

.jsonf-note {
  font-size: 13px;
  color: #666;
  line-height: 1.7;
  margin: 0 0 18px;
}

.jsonf-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}

.jsonf-pane {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.jsonf-pane-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 8px;
  min-height: 30px;
}

.jsonf-pane-head label,
.jsonf-pane-title {
  font-size: 14px;
  font-weight: 600;
  color: #333;
}

.jsonf-head-actions {
  display: flex;
  gap: 8px;
}

.jsonf-textarea {
  width: 100%;
  min-height: 320px;
  box-sizing: border-box;
  padding: 12px;
  font-size: 13px;
  line-height: 1.6;
  font-family: 'SFMono-Regular', Consolas, 'Liberation Mono', Menlo, monospace;
  border: 1px solid #ccc;
  border-radius: 8px;
  resize: vertical;
  tab-size: 2;
  white-space: pre;
  overflow: auto;
}

.jsonf-textarea:focus {
  outline: none;
  border-color: var(--accent, #3b82f6);
}

.jsonf-textarea[readonly] {
  background: #f8f9fa;
}

.jsonf-stats {
  margin-top: 6px;
  font-size: 12px;
  color: #777;
  min-height: 1.2em;
}

/* --- オプション --- */
.jsonf-options {
  border: 1px solid #e9ecef;
  border-radius: 8px;
  background: #f8f9fa;
  padding: 14px 18px;
  margin: 20px 0;
}

.jsonf-options legend {
  font-size: 14px;
  font-weight: 600;
  color: #333;
  padding: 0 8px;
}

.jsonf-option-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 22px;
  padding: 7px 0;
}

.jsonf-option-row + .jsonf-option-row {
  border-top: 1px dashed #dee2e6;
}

.jsonf-option-label {
  font-size: 13px;
  font-weight: 600;
  color: #555;
}

.jsonf-option {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  color: #333;
  cursor: pointer;
}

.jsonf-option input:disabled + span,
.jsonf-option input:disabled {
  opacity: 0.5;
  cursor: default;
}

.jsonf-repair-note {
  font-size: 12px;
  color: #888;
  margin-top: 4px;
  flex-basis: 100%;
}

/* --- ステータス表示 --- */
.jsonf-status {
  display: inline-flex;
  align-items: center;
  font-size: 12px;
  font-weight: 600;
  padding: 3px 10px;
  border-radius: 999px;
  white-space: nowrap;
}

.jsonf-status.idle {
  background: #eef1f4;
  color: #888;
}

.jsonf-status.ok {
  background: #e6f6ec;
  color: #1a7f45;
}

.jsonf-status.fixed {
  background: #fff4e0;
  color: #b26a00;
}

.jsonf-status.ng {
  background: #fdecec;
  color: #c0392b;
}

/* --- ボタン --- */
.jsonf-btn {
  background: var(--accent, #3b82f6);
  color: #fff;
  border: none;
  border-radius: 6px;
  padding: 8px 18px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: opacity 0.2s ease;
}

.jsonf-btn:hover:not(:disabled) {
  opacity: 0.85;
}

.jsonf-btn:disabled {
  background: #ccc;
  cursor: default;
}

.jsonf-btn.copied {
  background: #28a745;
}

.jsonf-btn-sub {
  background: #fff;
  color: #555;
  border: 1px solid #ccc;
  border-radius: 6px;
  padding: 6px 14px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
}

.jsonf-btn-sub:hover {
  background: #f1f3f5;
}

.jsonf-output-actions {
  display: flex;
  gap: 8px;
  margin-top: 10px;
}

/* --- エラー表示 --- */
.jsonf-error {
  margin-top: 12px;
  border: 1px solid #f3c9c4;
  background: #fdf3f2;
  border-radius: 8px;
  padding: 12px 14px;
}

.jsonf-error-head {
  font-size: 13px;
  font-weight: 700;
  color: #c0392b;
  line-height: 1.6;
}

.jsonf-error-raw {
  font-size: 12px;
  color: #a06a63;
  margin-top: 4px;
  font-family: 'SFMono-Regular', Consolas, Menlo, monospace;
  word-break: break-all;
}

.jsonf-excerpt {
  margin: 10px 0 0;
  padding: 10px;
  background: #fff;
  border: 1px solid #f0d5d1;
  border-radius: 6px;
  font-family: 'SFMono-Regular', Consolas, 'Liberation Mono', Menlo, monospace;
  font-size: 12px;
  line-height: 1.5;
  overflow-x: auto;
}

.jsonf-code-line {
  display: flex;
  white-space: pre;
}

.jsonf-code-line.is-error {
  background: #fdecec;
}

.jsonf-gutter {
  flex: 0 0 auto;
  width: 3em;
  text-align: right;
  padding-right: 12px;
  color: #b0b0b0;
  user-select: none;
}

.jsonf-code-line.is-error .jsonf-gutter {
  color: #c0392b;
  font-weight: 700;
}

.jsonf-code {
  flex: 1 1 auto;
  color: #333;
}

.jsonf-caret {
  color: #c0392b;
  font-weight: 700;
}

.jsonf-caret-line {
  display: flex;
  white-space: pre;
}

/* --- 修復した内容 --- */
.jsonf-repaired {
  margin-top: 12px;
  border: 1px solid #ffe0b0;
  background: #fffaf1;
  border-radius: 8px;
  padding: 12px 14px;
}

.jsonf-repaired-title {
  font-size: 13px;
  font-weight: 700;
  color: #b26a00;
  margin-bottom: 6px;
}

.jsonf-repaired ul {
  margin: 0 0 0 18px;
  padding: 0;
  list-style: disc;
}

.jsonf-repaired li {
  font-size: 13px;
  color: #6b4b12;
  line-height: 1.7;
}

.jsonf-repaired-note {
  font-size: 11px;
  color: #a98a55;
  margin-top: 6px;
}

@media (max-width: 720px) {
  .jsonf-grid {
    grid-template-columns: 1fr;
  }
  .jsonf-textarea {
    min-height: 220px;
  }
}
