/* Site-specific styles for json-formatter. Shared chrome (vars, base reset,
 * .btn, .topbar, .status colors, .footer) lives in /_chrome.css and is loaded
 * ahead of this file. */

.grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  padding: 12px;
  height: calc(100vh - 110px);
  min-height: 480px;
}

@media (max-width: 800px) {
  .grid {
    grid-template-columns: 1fr;
    height: auto;
  }
}

.pane {
  display: flex;
  flex-direction: column;
  background: var(--bg-pane);
  border: 1px solid var(--border);
  border-radius: 10px;
  overflow: hidden;
  min-height: 320px;
}

.pane-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 12px;
  border-bottom: 1px solid var(--border);
  gap: 8px;
  flex-wrap: wrap;
}

.pane-head label {
  font-size: 12px;
  color: var(--fg-mute);
  text-transform: uppercase;
  letter-spacing: 0.6px;
}

.indent {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: var(--fg-mute);
}

.indent select {
  font-family: var(--sans);
  font-size: 12px;
  padding: 4px 6px;
  background: var(--bg-elev);
  color: var(--fg);
  border: 1px solid var(--border);
  border-radius: 6px;
}

textarea#input,
pre#output {
  flex: 1;
  margin: 0;
  padding: 12px 14px;
  border: 0;
  background: transparent;
  color: var(--fg);
  font-family: var(--mono);
  font-size: 13px;
  line-height: 1.5;
  resize: none;
  overflow: auto;
  outline: none;
  white-space: pre;
  tab-size: 2;
}

textarea#input::placeholder {
  color: var(--fg-mute);
}

pre#output {
  white-space: pre;
  min-height: 0;
}

/* The shared .status only sets typography + color variants — the pane
 * needs an internal border + padding to fit the layout. */
.status,
.meta {
  padding: 8px 12px;
  border-top: 1px solid var(--border);
}

.meta {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--fg-mute);
}

/* JSON syntax highlighting. */
.tok-key {
  color: var(--accent);
}
.tok-str {
  color: #b6e3a0;
}
.tok-num {
  color: #f0c674;
}
.tok-bool {
  color: #c39bd3;
}
.tok-null {
  color: #c39bd3;
}
.tok-err-pos {
  background: rgba(255, 80, 80, 0.25);
  border-bottom: 1px solid var(--err);
  padding: 0 1px;
  border-radius: 2px;
}

@media (prefers-color-scheme: light) {
  .tok-str {
    color: #1f7a3e;
  }
  .tok-num {
    color: #8a5a00;
  }
  .tok-bool,
  .tok-null {
    color: #7a3ab3;
  }
}
