body {
    margin: 0;
    padding-top: 10px;
    overflow: hidden;
}
h3 {
    margin: 0.5em;
}
input {
    width: 100%;
    height: 1rem;
}

.content {
    display: none;
    position: absolute;
    padding: 0.5em;
    z-index: 1;
    border: 1px dotted;
    border-radius: 0.4em;
}
div:hover > .content {
    display: block;
}

header {
    display: flex;
    white-space: nowrap;
    font-variant: small-caps;

    > * {
        text-decoration: none;
        margin: 0 0.25em;
        flex-shrink: 1;
    }

    /* current price box */
    .current {
        border: 1px dotted cadetblue;
        padding: 0.2em;
        max-width: 10em;
        margin-left: 2em;
        margin-top: -3px;
        border-radius: 0.4em;
        background: skyblue;
        overflow: hidden;
        flex-shrink: 0;

        .unit {
            font-variant: all-small-caps;
            font-size: 0.75em;
        }
    }

    /* electricity transfer settings */
    .transfer {
        label {
            display: block;
            text-align: left;
            display: flex;
        }
        label > * {
            flex: 1;
        }
        label input {
            width: 6em;
            flex: none;
        }
        .transfer-icon {
            font-size: 1.3em;
            line-height: 1em;
            padding: 0 0.2em;
            border: 1px dotted cadetblue;
            border-radius: 0.4em;
            background: skyblue;
        }
        .content {
            background: skyblue;
            border-color: cadetblue;
            border-top-left-radius: 0;
        }
        &:hover {
            .transfer-icon {
                border-radius: 0.4em 0.4em 0 0;
                border-bottom-color: skyblue;
            }
            .content {
                border-top: hidden;
            }
        }
    }

    #template,
    #query {
        font-size: 0.65rem;
    }
    #query:hover,
    #query:focus {
        flex-shrink: 0;
    }

    .api {
        .content {
            flex-direction: column;
            background: white;
            border-color: gray;
            border-right: 0;
            right: 0;
        }
        &:hover {
            .content {
                display: flex;
            }
        }
    }

    .repo img {
        width: 1.25em;
        height: 1.25em;
    }
}

.stamp {
    width: 1rem;
}
main {
    height: 80vh;
    height: calc(99dvh - 32px);

    /* show chart or tabular view */
    .mode {
        position: absolute;
        left: 8px;
        top: 6px;
        text-decoration: none;
    }

    #chart {
        height: 100%;
    }

    /* Tabular view */
    #table {
        display: none;
        overflow: scroll;
        height: 100%;

        &:target {
            display: block;
        }
        &:target + #chart {
            display: none;
        }

        table {
            border-spacing: 2em 0.2em;
            margin: 1em;
        }
        th {
            text-align: left;
            border-bottom: 1px solid black;
        }
    }
}