/* DevToolBox — shared live-tool panel styles
 * Used by every page that ships a real client-side tool.
 * Keeps the tool markup identical across pages (see /js/*.js modules). */

.dt-tool {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  margin: 24px 0 32px;
}
.dt-tool * { box-sizing: border-box; }

.dt-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 14px;
}
.dt-head h2 {
  font-size: 1.05rem;
  color: var(--text-bright);
  border: none;
  padding: 0;
  margin: 0;
}

.dt-bar { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }

.dt-btn {
  background: var(--bg);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 8px 14px;
  border-radius: var(--radius);
  cursor: pointer;
  font-size: .82rem;
  font-family: inherit;
  transition: border-color .15s, background .15s, color .15s;
}
.dt-btn:hover { border-color: var(--accent); color: var(--text-bright); }
.dt-btn.primary { background: var(--accent); border-color: var(--accent); color: #06121a; font-weight: 600; }
.dt-btn.primary:hover { opacity: .88; color: #06121a; }
.dt-btn.on { background: var(--accent); border-color: var(--accent); color: #06121a; font-weight: 600; }
.dt-btn.ghost { color: var(--text-dim); }
.dt-btn[disabled] { opacity: .45; cursor: not-allowed; }

.dt-field { display: flex; align-items: center; gap: 6px; font-size: .82rem; color: var(--text-dim); }
.dt-field select,
.dt-field input[type="number"],
.dt-field input[type="text"] {
  background: var(--bg);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 7px 9px;
  border-radius: var(--radius);
  font-family: inherit;
  font-size: .82rem;
}
.dt-field select:focus,
.dt-field input:focus { outline: none; border-color: var(--accent); }
.dt-field input[type="number"] { width: 84px; }

.dt-grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.dt-grid2 > div { min-width: 0; }

.dt-ta {
  width: 100%;
  min-height: 240px;
  background: var(--bg);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 12px;
  font-family: 'JetBrains Mono', 'SF Mono', 'Fira Code', ui-monospace, Consolas, monospace;
  font-size: .82rem;
  line-height: 1.55;
  resize: vertical;
  tab-size: 2;
}
.dt-ta:focus { outline: none; border-color: var(--accent); }
.dt-ta.out { color: var(--green); }
.dt-ta.sm { min-height: 120px; }

.dt-status {
  margin-top: 12px;
  font-size: .84rem;
  line-height: 1.6;
  color: var(--text-dim);
  min-height: 22px;
  word-break: break-word;
}
.dt-status.ok { color: var(--green); }
.dt-status.err { color: var(--red); }
.dt-status b { color: var(--text-bright); }

.dt-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 12px;
}
.dt-chip {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 3px 10px;
  font-size: .74rem;
  color: var(--text-dim);
  font-family: 'JetBrains Mono', ui-monospace, monospace;
}
.dt-chip b { color: var(--text-bright); font-weight: 600; }

.dt-note { font-size: .78rem; color: var(--text-dim); margin-top: 10px; }
.dt-note code { color: var(--text); font-size: .78rem; }

.dt-sub {
  margin-top: 18px;
  border-top: 1px solid var(--border);
  padding-top: 16px;
}
.dt-sub h3 {
  font-size: .92rem;
  color: var(--text-bright);
  margin-bottom: 10px;
  font-weight: 600;
}

.dt-tree {
  margin-top: 12px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 12px;
  font-family: 'JetBrains Mono', 'SF Mono', ui-monospace, monospace;
  font-size: .8rem;
  line-height: 1.7;
  max-height: 420px;
  overflow: auto;
  display: none;
}
.dt-tree.show { display: block; }
.dt-tree ul { list-style: none; padding-left: 18px; margin: 0; border-left: 1px dotted var(--border); }
.dt-tree > ul { padding-left: 0; border-left: none; }
.dt-tree .k { color: var(--accent); cursor: pointer; }
.dt-tree .k:hover { text-decoration: underline; }
.dt-tree .v-str { color: var(--green); }
.dt-tree .v-num { color: var(--orange); }
.dt-tree .v-bool { color: var(--purple); }
.dt-tree .v-null { color: var(--text-dim); }
.dt-tree .cnt { color: var(--text-dim); font-size: .74rem; margin-left: 6px; }
.dt-tree .collapsed > ul { display: none; }
.dt-tree .caret {
  display: inline-block;
  width: 12px;
  color: var(--text-dim);
  cursor: pointer;
  user-select: none;
}

.dt-diff { font-family: 'JetBrains Mono', ui-monospace, monospace; font-size: .8rem; line-height: 1.9; }
.dt-diff .ln { display: block; padding: 1px 8px; border-radius: 4px; word-break: break-all; }
.dt-diff .add { background: rgba(127,217,98,.1); color: var(--green); }
.dt-diff .rem { background: rgba(240,113,120,.1); color: var(--red); }
.dt-diff .chg { background: rgba(255,213,128,.1); color: var(--yellow); }
.dt-diff .path { color: var(--text-bright); }

.dt-out-box {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 12px;
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-size: .82rem;
  word-break: break-all;
  min-height: 22px;
  color: var(--text);
}
.dt-kv { width: 100%; border-collapse: collapse; font-size: .82rem; margin-top: 8px; }
.dt-kv th, .dt-kv td { text-align: left; padding: 6px 10px; border-bottom: 1px solid var(--border); }
.dt-kv th { color: var(--text-dim); font-weight: 500; font-size: .76rem; text-transform: uppercase; letter-spacing: .04em; }
.dt-kv td { font-family: 'JetBrains Mono', ui-monospace, monospace; word-break: break-all; }
.dt-kv tr:last-child td { border-bottom: none; }

.dt-toast {
  position: fixed;
  left: 50%;
  bottom: 28px;
  transform: translateX(-50%) translateY(20px);
  background: var(--bg-card);
  border: 1px solid var(--accent);
  color: var(--text-bright);
  padding: 10px 18px;
  border-radius: var(--radius);
  font-size: .84rem;
  box-shadow: var(--shadow);
  opacity: 0;
  pointer-events: none;
  transition: opacity .2s, transform .2s;
  z-index: 200;
}
.dt-toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

@media (max-width: 760px) {
  .dt-grid2 { grid-template-columns: 1fr; }
  .dt-ta { min-height: 170px; }
  .dt-btn { padding: 7px 11px; font-size: .78rem; }
}
