:root {
    --bg: #FDA;
    --bx: #FC8;
    --fg: #FA5;
    --bt: #A51;
    --bt2: #840;
    --cl: #FFF;
}

html, body {
    margin: 0;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: var(--bg);
}
p, h1, h2, h3, h4, h5, h6, ul, ol, li, dl, dt, dd, form, fieldset, legend, input, textarea, blockquote, th, td {
    margin: 0;
    padding: 0;
}
* {
    box-sizing: border-box;
}

p, h1 {
    margin: 0 1rem .5rem 1rem;
}

main {
    display: flex;
    flex-direction: column;
    min-height: calc(100vh - 9rem);
    margin: 1rem;
    padding: 1rem;
    gap: 1rem;
    border-radius: .5rem;
    background: var(--bx);
}

fieldset {
    display: flex;
    width: 100%;
    height: fit-content;
    padding: 1rem;
    gap: 1rem;
    border: none;
    border-radius: .25rem;
    background: var(--fg);
}

input[type=text] {
    width: 24rem;
    padding: .5rem 1rem;
    font: inherit;
    border: none;
    border-radius: .25rem;
    background: #5215;
    color: #FFF;
}
input[type=text]::placeholder {
    color: #FDA;
}
input[type=text]:focus {
    outline: none;
}

.button {
    display: block;
    width: fit-content;
    margin: 0;
    padding: .5rem 1rem;
    border: none;
    border-radius: .25rem;
    background: var(--bt);
    color: var(--cl);
    font: inherit;
}
.button:active {
    background: var(--bt2);
}
.button:focus {
    outline: 1px solid #000;
}

.json-fields-zone {
    gap: 0;
    flex-direction: column;
    max-width: 100%;
}
.json-fields {
    display: flex;
    gap: 1rem;
    align-items: center;
    flex-wrap: wrap;
    max-width: 100%;
}

.jsfield, .jsmap {
    height: fit-content;
    padding: .5rem 1rem;
    border-radius: .25rem;
    background: #A213;
    color: #000;
    text-shadow: none;
}
.jsfield__key, .jsmap__output {
    margin: 0 .25rem .25rem 0;
    font-size: 1rem;
}
.jsfield__content {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: .5rem;
    width: fit-content;
    margin-left: auto;
    font-size: .75rem;
}
.jsfield--selected {
    box-shadow: #510 0 0 0 1px inset;
}
.jsfield[data-key] {
    background: #510;
    color: #F62;
}

.map {
    flex-direction: column;
}
.map-zone {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
}

.jsmap {
    display: flex;
    align-items: center;
    gap: .5rem;
}
.jsmap__input {
    font-family: 'Courier New', Courier, monospace;
}
.jsmap__output {
    margin: 0;
    padding: .5rem 1rem;
    border-radius: .25rem;
    background: #A213;
}

.json-new-key {
    display: flex;
    gap: 1rem;
    width: 100%;
    padding: 1rem;
}

.preview {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    max-width: 100%;
}
.preview fieldset {
    display: block;
    max-width: 100%;
}
.preview pre {
    width: 100%;
    padding: .5rem;
    border-radius: .25rem;
    border: .125rem solid #753;
    background: #210;
    color: #EDC;
    white-space: pre-wrap;
}