.json-tool-wrapper { --p-bg: #ffffff; --p-border: #e2e8f0; --p-primary: #3b82f6; --p-text: #0f172a; width: 100%; max-width: 1000px; margin: 0 auto; background: var(--p-bg); border-radius: 24px; padding: 32px; border: 1px solid var(--p-border); box-shadow: 0 10px 25px -5px rgba(0,0,0,0.05); box-sizing: border-box; }
.json-header { font-size: 1.5rem; font-weight: 600; color: var(--p-text); margin-bottom: 8px; display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.json-badge { background: #dbeafe; color: #1e40af; padding: 4px 12px; border-radius: 30px; font-size: 0.8rem; font-weight: 500; }
.json-subtitle { color: #64748b; font-size: 0.95rem; padding-bottom: 16px; border-bottom: 1px solid var(--p-border); margin-bottom: 24px; }

.json-editor-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; align-items: stretch;}
.json-label-row { font-weight: 600; margin-bottom: 12px; color: var(--p-text); display: flex; align-items: center; justify-content: space-between; }
.json-text-btn { background: none; border: none; color: var(--p-primary); cursor: pointer; font-weight: 600; font-size: 0.9rem; padding: 4px 8px; border-radius: 6px; transition: 0.2s; }
.json-text-btn:hover { background: rgba(59, 130, 246, 0.1); }

.json-textarea { width: 100%; min-width: 0; height: 450px; padding: 16px; border: 2px solid var(--p-border); border-radius: 12px; font-family: monospace; font-size: 0.9rem; resize: vertical; outline: none; background: #f8fafc; color: #334155; line-height: 1.6; transition: 0.2s; box-sizing: border-box; }
.json-textarea:focus { border-color: var(--p-primary); box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1); background: #ffffff; }

.json-actions { display: flex; gap: 12px; margin-top: 20px; flex-wrap: wrap; }
.json-btn { padding: 12px 24px; border-radius: 8px; font-weight: 600; cursor: pointer; border: none; transition: 0.2s; display: flex; align-items: center; justify-content: center; gap: 8px; box-sizing: border-box; }
.json-btn-primary { background: var(--p-primary); color: white; box-shadow: 0 4px 12px rgba(59, 130, 246, 0.2); }
.json-btn-primary:hover { background: #2563eb; transform: translateY(-1px); }
.json-btn-secondary { background: #f1f5f9; color: #475569; border: 1px solid #cbd5e1; }
.json-btn-secondary:hover { background: #e2e8f0; }
.json-error-box { display: none; margin-top: 20px; padding: 16px; background: #fef2f2; border: 1px solid #fecaca; color: #ef4444; border-radius: 8px; font-size: 0.95rem; font-family: monospace; word-break: break-word; }

@media(max-width: 640px) { 
    .json-editor-grid { grid-template-columns: 1fr; } 
    .json-tool-wrapper { padding: 20px; border-radius: 16px; }
    .json-header { font-size: 1.25rem; line-height: 1.4; gap: 8px; }
    .json-textarea { height: 300px; }
    .json-actions { display: grid; grid-template-columns: 1fr 1fr; }
    .json-btn-primary { grid-column: span 2; }
}

[data-theme="dark"] .json-tool-wrapper { background: #1e293b; border-color: #334155; }
[data-theme="dark"] .json-header, [data-theme="dark"] .json-label-row { color: #f8fafc; }
[data-theme="dark"] .json-textarea { background: #0f172a !important; border-color: #475569 !important; color: #f8fafc !important; }
[data-theme="dark"] .json-textarea:focus { border-color: var(--p-primary) !important; }
[data-theme="dark"] .json-btn-secondary { background: #1e293b; color: #cbd5e1; border-color: #475569; }
[data-theme="dark"] .json-btn-secondary:hover { background: #334155; }
[data-theme="dark"] .json-error-box { background: rgba(220,38,38,0.1); border-color: #b91c1c; color: #fca5a5; }