/* JSON 포맷터 & 검증기 */
:root {
  --bg: #f8fafc;
  --card: #ffffff;
  --border: #e2e8f0;
  --text: #1e293b;
  --muted: #64748b;
  --amber: #d97706;
  --amber2: #b45309;
  --amber-light: rgba(217,119,6,.08);
  --editor-bg: #0f172a;
  --editor-text: #e2e8f0;
  --radius: 14px;
  --shadow: 0 2px 12px rgba(0,0,0,.07);
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
body { background: var(--bg); color: var(--text); font-family: 'Pretendard', 'Apple SD Gothic Neo', sans-serif; font-size: 14px; }

.wrap { max-width: 100%; padding: 10px 0 60px; }

/* ── 상단 헤더 ── */
.top { margin-bottom: 20px; }
.brand { display: flex; align-items: center; gap: 14px; }
.logo {
  width: 48px; height: 48px;
  background: linear-gradient(135deg, #d97706, #ea580c);
  border-radius: 13px; display: flex; align-items: center; justify-content: center;
  font-size: 22px; flex-shrink: 0;
}
h1 { font-size: 22px; font-weight: 700; }
.sub { font-size: 13px; color: var(--muted); margin-top: 2px; }

/* ── 카드 ── */
.card { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); padding: 20px; margin-bottom: 16px; box-shadow: var(--shadow); }
.card-title { font-size: 15px; font-weight: 600; margin-bottom: 14px; display: flex; align-items: center; gap: 6px; }

/* ── 액션 바 ── */
.action-bar { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 12px; align-items: center; }
.btn-action {
  padding: 7px 14px; border-radius: 8px; border: 1.5px solid var(--border);
  background: #fff; cursor: pointer; font-size: 13px; font-weight: 600; color: var(--text);
  transition: all .15s;
}
.btn-action:hover { border-color: var(--amber); color: var(--amber); }
.btn-action.primary { background: var(--amber); border-color: var(--amber); color: #fff; }
.btn-action.primary:hover { background: var(--amber2); border-color: var(--amber2); }
.btn-action.danger { border-color: #ef4444; color: #ef4444; }
.btn-action.danger:hover { background: #fef2f2; }

.indent-select {
  padding: 6px 10px; border-radius: 8px; border: 1.5px solid var(--border);
  font-size: 13px; background: #fff; color: var(--text); outline: none;
}
.spacer { flex: 1; }
.char-count { font-size: 12px; color: var(--muted); }

/* ── 에디터 ── */
.editor-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.editor-pane { display: flex; flex-direction: column; }
.pane-label { font-size: 11px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; margin-bottom: 6px; }

textarea.code-area {
  flex: 1; min-height: 360px; padding: 14px; border-radius: 10px;
  border: 1.5px solid var(--border); font-family: 'JetBrains Mono', 'Fira Code', 'Courier New', monospace;
  font-size: 13px; line-height: 1.6; background: var(--editor-bg); color: var(--editor-text);
  resize: vertical; outline: none; transition: border-color .15s;
}
textarea.code-area:focus { border-color: var(--amber); }
textarea.code-area.error { border-color: #ef4444; }
textarea.code-area.ok { border-color: #22c55e; }

/* ── 상태 바 ── */
.status-bar {
  margin-top: 8px; padding: 8px 12px; border-radius: 8px;
  font-size: 12px; font-weight: 600; min-height: 34px;
  display: flex; align-items: center; gap: 6px;
}
.status-bar.idle { background: #f1f5f9; color: var(--muted); }
.status-bar.ok { background: #f0fdf4; color: #16a34a; }
.status-bar.err { background: #fef2f2; color: #dc2626; }

/* ── 경로 탐색 ── */
.path-card { }
.path-row { display: flex; gap: 8px; align-items: center; }
.path-input {
  flex: 1; padding: 9px 12px; border: 1.5px solid var(--border); border-radius: 9px;
  font-size: 13px; font-family: 'JetBrains Mono', monospace; outline: none;
  background: var(--editor-bg); color: var(--editor-text);
}
.path-input:focus { border-color: var(--amber); }
.path-result {
  margin-top: 10px; padding: 10px 14px; background: var(--editor-bg); color: #86efac;
  border-radius: 8px; font-family: 'JetBrains Mono', monospace; font-size: 13px;
  min-height: 40px; white-space: pre-wrap; word-break: break-all; line-height: 1.6;
}
.path-hint { font-size: 11px; color: var(--muted); margin-top: 6px; }

/* ── 안내 섹션 ── */
.guide-section { margin-top: 24px; padding: 22px; background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); }
.guide-section h2 { font-size: 15px; font-weight: 700; margin: 18px 0 8px; }
.guide-section h2:first-child { margin-top: 0; }
.guide-steps { padding-left: 18px; }
.guide-steps li { margin-bottom: 6px; line-height: 1.6; color: var(--muted); }
.guide-features, .guide-usecase { list-style: none; padding: 0; }
.guide-features li, .guide-usecase li { padding: 4px 0 4px 16px; position: relative; color: var(--muted); line-height: 1.6; }
.guide-features li::before { content: '•'; position: absolute; left: 0; color: var(--amber); font-weight: 700; }
.guide-usecase li::before { content: '✓'; position: absolute; left: 0; color: var(--amber); font-weight: 700; }
.guide-privacy { margin-top: 14px; padding: 12px 14px; background: var(--amber-light); border-radius: 8px; font-size: 12px; color: var(--muted); line-height: 1.6; }

@media (max-width: 640px) {
  .editor-grid { grid-template-columns: 1fr; }
}
