* {
    box-sizing: border-box;
}

body {
    font-family: 'Istok Web', sans-serif;
    font-size: 16px;
    line-height: 1.3em;
    padding-top: 1px;
}

.page-heading,
.decode-form,
.output {
    margin: 2rem;
}

.page-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: .5rem;
    margin-bottom: 0;
}

.page-heading h1 {
    margin: 0;
}

.decode-form {
    margin-top: 1rem;
    margin-bottom: 0;
}

.info-popup {
    position: relative;
}

.info-popup summary {
    display: flex;
    position: relative;
    align-items: center;
    justify-content: center;
    width: 1.1rem;
    height: 1.1rem;
    border-radius: 50%;
    border: solid 1px var(--link-color);
    color: var(--link-color);
    font-family: Georgia, serif;
    font-style: italic;
    font-size: .7rem;
    line-height: 1;
    cursor: pointer;
    list-style: none;
    user-select: none;
}

.info-popup summary::after {
    content: "";
    position: absolute;
    inset: -0.5rem;
}

.info-popup summary::-webkit-details-marker {
    display: none;
}

.info-popup summary:hover,
.info-popup[open] summary {
    border-color: var(--text-color);
    color: var(--text-color);
}

.info-popup p {
    position: absolute;
    top: calc(100% + .5rem);
    right: 0;
    z-index: 10;
    width: min(22rem, 80vw);
    max-width: calc(100vw - 2rem);
    margin: 0;
    padding: .75rem 1rem;
    background: var(--background);
    color: var(--text-color);
    border: solid 1px var(--background-accent);
    box-shadow: .1em .1em 0 var(--background-accent);
    font-size: .95rem;
    line-height: 1.4;
}

.encoded {
    display: block;
    background-color: var(--input-background);
    color: var(--input-text-color);
    font-size: 1.2rem;
    width: 100%;
    height: 40vh;
    min-height: 200px;
    padding: .5rem;
    border: solid 1px var(--background-accent);
    resize: none;
}

.submit-button {
    position: relative;
    background-color: var(--text-color);
    color: var(--background);
    font-family: monospace;
    font-size: .9rem;
    margin-top: .75rem;
    padding: .75em;
    cursor: pointer;
    border: none;
    outline: 0;
    transition: all .2s ease-in-out;
}

.submit-button:active {
    top: 2px;
    left: 2px;
    box-shadow: 1px 1px 0 0 #BBB inset;
}

.output {
    display: flex;
    margin-top: 0;
    opacity: 0;
    transition: opacity .2s ease-out;
}

.output.with-results {
    opacity: 1;
}

.decoded::before,
.decoded-params::before {
    display: block;
    font-size: 1.5rem;
    width: 100%;
    padding-bottom: .2em;
    margin-bottom: .6em;
}

.decoded {
    flex: 3;
    word-break: break-all;
    line-height: 1.5;
    margin-top: 2rem;

    &::before {
        content: "Decoded";
    }
}

.decoded-params {
    flex: 2;
    margin-top: 2rem;
    margin-left: 2rem;

    &::before {
        content: "Decoded key/value pairs";
    }
}

.decoded-line {
    display: flex;
    line-height: 1.25;
    word-break: break-all;
    padding-top: .375em;
    padding-bottom: .375em;
    border-bottom: solid 1px #EEE;
}

.decoded-key {
    flex: 2;
    padding-right: 1em;
}

.decoded-value {
    flex: 3;
}

@media screen and (max-width: 50em) {

    .page-heading,
    .decode-form,
    .output {
        margin: 1rem;
    }

    .page-heading h1 {
        padding: 0;
    }

    .output {
        display: block;
    }

    .decoded-params {
        margin-left: 0;
    }

}
