/* Tool-specific reset + styles (cream/ink palette, matching existing site) */
* { margin: 0; padding: 0; box-sizing: border-box; }
html, body { height: 100%; }
body {
  background: #f7f3ea;
  color: #1c1a17;
  font-family: 'Pretendard Variable', Pretendard, -apple-system, BlinkMacSystemFont, system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
  padding: 1rem;
  line-height: 1.6;
}
.ad { text-align: center; margin: 1rem auto; min-height: 60px; }
.back-link { display: inline-block; font-size: 0.9rem; color: #6f695f; text-decoration: none; margin-bottom: 0.75rem; }
.back-link:hover { color: #1c1a17; }
main { max-width: 1200px; margin: 0 auto; padding: 2rem 0; }
h1 { font-size: 1.75rem; font-weight: 700; margin-bottom: 0.5rem; }
.subtitle { color: #6f695f; font-size: 0.95rem; margin-bottom: 1.5rem; }
.toolbar { display: flex; gap: 0.5rem; flex-wrap: wrap; margin-bottom: 1rem; }
.toolbar button, .file-label {
  padding: 0.5rem 0.9rem; font-size: 0.9rem; font-weight: 500;
  border: 1px solid #ddd; border-radius: 6px; cursor: pointer; background: #fff; font-family: inherit; color: #1c1a17;
}
.toolbar button:hover { background: #f0edea; }
.btn-primary { background: #1c1a17; color: #f7f3ea; border-color: #1c1a17; }
.btn-primary:hover { background: #2d2a25; }
.file-label { display: inline-flex; align-items: center; }
.file-label input[type="file"] { display: none; }
.panes { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.pane label { display: block; font-size: 0.85rem; font-weight: 500; margin-bottom: 0.4rem; }
.pane textarea {
  width: 100%; min-height: 320px; padding: 0.75rem; font-size: 0.85rem; border: 1px solid #ddd;
  border-radius: 6px; background: #fff; font-family: 'SF Mono', Consolas, 'Liberation Mono', Menlo, monospace; color: #1c1a17; resize: vertical;
}
.pane textarea[readonly] { background: #faf9f6; }
.actions { display: flex; gap: 0.75rem; margin-top: 0.75rem; }
.actions button {
  padding: 0.5rem 0.9rem; font-size: 0.9rem; font-weight: 500;
  border: 1px solid #ddd; border-radius: 6px; cursor: pointer; background: #fff; font-family: inherit; color: #1c1a17;
}
.actions button:hover { background: #f0edea; }
.error-banner {
  margin-top: 1rem; padding: 0.75rem 1rem; background: #fdecea; color: #5a1a1a; border: 1px solid #f5c6c6; border-radius: 6px; font-size: 0.9rem;
}
.error-banner.hidden { display: none; }
#tree-panel {
  margin-top: 0.5rem; padding: 0.75rem; background: #fff; border: 1px solid #ddd; border-radius: 6px; min-height: 320px;
  font-family: 'SF Mono', Consolas, 'Liberation Mono', Menlo, monospace; font-size: 0.85rem; overflow: auto;
}
#tree-panel.hidden { display: none; }
.pane textarea.hidden { display: none; }
#tree-panel details { margin: 0.25rem 0; }
#tree-panel summary { cursor: pointer; font-weight: 500; outline: none; list-style: none; }
#tree-panel summary::-webkit-details-marker { display: none; }
#tree-panel summary::before { content: '▶ '; font-size: 0.7rem; display: inline-block; transition: transform 0.15s; }
#tree-panel details[open] > summary::before { content: '▼ '; }
.tree-key { color: #1c1a17; }
.tree-string { color: #2f6f44; }
.tree-number { color: #8c5e0c; }
.tree-boolean { color: #6b4c9a; }
.tree-null { color: #6f695f; }
.tree-bracket { color: #6f695f; }
.tips h2 { font-size: 1.25rem; font-weight: 600; margin: 2rem 0 1rem; }
.tips dl dt { font-weight: 600; margin: 1rem 0 0.3rem; font-size: 0.95rem; }
.tips dl dd { color: #6f695f; font-size: 0.9rem; margin-bottom: 0.5rem; }
footer { text-align: center; margin-top: 2rem; font-size: 0.8rem; color: #6f695f; }

@media (max-width: 600px) {
  body { padding: 0.75rem; }
  main { padding: 1rem 0; }
  h1 { font-size: 1.35rem; margin-bottom: 0.35rem; }
  .subtitle { font-size: 0.85rem; margin-bottom: 0.75rem; }
  .toolbar { gap: 0.4rem; }
  .toolbar button, .file-label { padding: 0.45rem 0.7rem; font-size: 0.85rem; }
  .panes { grid-template-columns: 1fr; }
  .pane textarea { min-height: 200px; }
  #tree-panel { min-height: 200px; }
  .actions { flex-wrap: wrap; }
  .tips h2 { margin: 1.25rem 0 0.6rem; font-size: 1.1rem; }
  .tips dl dt { margin: 0.75rem 0 0.2rem; font-size: 0.9rem; }
  .tips dl dd { font-size: 0.85rem; margin-bottom: 0.4rem; }
  footer { margin-top: 1.25rem; }
}
