body {
    font-family: monospace;
    color: #bdbdbd;
    background: #282828;

    margin: 0;
    height: 100vh;
    display: grid;
    grid-template-areas:
        "message diff"
        "footer footer";
    grid-template-rows: 1fr min-content;
    grid-template-columns: 1fr 1fr;
}

@media (max-width: 1000px) {
    body {
        grid-template-areas:
            "message"
            "diff"
            "footer";
        grid-template-rows: 1fr 1fr min-content;
        grid-template-columns: 1fr;
    }
}

pre {
    min-width: min-content;
}

section {
    padding: 0 10px;
    overflow: auto;
    background: #282828;
}

@media (max-width: 500px) {
    section {
        padding: 0 3px;
    }
}

body.loading section {
    display: none;
}

a {
    color: #229122;
}

section.message {
    grid-area: message;
    z-index: 0;
}

section.message .message {
    max-width: 600px;
    line-height: 1.5;
}

section.message p code, section.message pre {
    background: #093309;
    border: 1px solid #229122;
    border-radius: 4px;
}

section.message p code {
    padding: 1px 2px;
}

section.message pre {
    padding: 3px 5px;
}

section.message .comments {
    max-width: 600px;
}

section.message .comment {
    margin-top: 5px;
    margin-bottom: 20px;
    overflow-x: auto;
}

section.message .comment .diminished {
    color: #777;
    font-style: italic;
}

section.message .comment .author {
    font-weight: bold;
}

section.message .comment p {
    margin-left: 10px;
    padding-left: 10px;
    border-left: 1px solid #555;
}

section.message .comments form {
    display: grid;
    border-top: 1px solid #555;
    grid-gap: 10px;
    padding: 10px 0;
}

section.message .comments form textarea {
    height: 100px;
}

section.message .comments form input {
    min-height: 25px;
}

section.message .comments form .ok {
    font-weight: bold;
    padding: 10px 0;
}

section.diff {
    grid-area: diff;
    z-index: 0;
}

.clone {
    padding: 10px 5px;
    display: grid;
    grid-template-columns: auto 1fr auto;
    align-items: center;
    grid-gap: 5px;
}
.clone .cmd {
    background: #111;
    padding: 5px;
}

.cmd-flash {
    animation: cmd-flash 0.3s;
}

@keyframes cmd-flash {
    0% {
        background-color: #666;
    }
    100% {
        background-color: #111;
    }
}

section.file {
    grid-area: message;
    z-index: 1;
    display: grid;
    grid-template-columns: 1fr min-content;
    grid-template-rows: min-content 1fr;
    overflow: hidden;
}

.hunk {
    color: #777;
    font-style: italic;
}

details {
    border-left: 4px solid #555;
    padding: .5em .5em 0;
    margin-bottom: .5em;
}

summary {
    border: 1px solid #555;
    border-left: none;
    font-weight: bold;
    margin: -.5em -.5em 0;
    padding: .5em;
    cursor: pointer;
    user-select: none;
    outline: none;
}

summary:hover {
    filter: brightness(1.3);
}

ul {
    list-style-type: square;
}

.file-list li {
    cursor: pointer;
    margin-bottom: .5em;
}

.file-list li:hover {
    text-decoration: underline;
    filter: brightness(1.3);
}

.file-list li.changed {
    font-weight: bold;
    color: #16ac16;
}

.file-close {
    align-self: center;
}

.file-content {
    grid-column: 1/3;
    overflow: auto;
    background: #111111;
}

.overscroll {
    height: 60%;
}

footer {
    grid-area: footer;
    z-index: 0;
    padding: 10px;
    background: #212121;
    display: grid;
    grid-template-columns: repeat(3, min-content) 1fr;
    grid-gap: 10px;
    align-items: center;
}

@media (max-width: 500px) {
    footer {
        grid-template-columns: min-content 1fr 1fr;
    }
    footer > .progress {
        grid-column: 1/4;
    }
}

.progress {
    display: grid;
    height: 10px;
    border-radius: 4px;
    cursor: pointer;
    background: #111;
}

.progress > .fill {
    grid-column: 1;
    grid-row: 1;
    z-index: 0;
    border-radius: 4px;
    background: #444;
    transition: 0.2s;

    width: 0;
}

.progress > .dots {
    grid-column: 1;
    grid-row: 1;
    z-index: 1;
    border-radius: 4px;
    margin: 0 4px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.progress > .dots > .dot {
    height: 6px;
    width: 100%;
    max-width: 6px;
    border-radius: 2px;
    background-color: #212121;
    transition: 0.2s;
}

@media (max-width: 1000px) {
    .progress > .dots > .dot {
        opacity: 0;
    }
}

.progress > .dots > .active {
    background: white;
}

#loading {
    grid-area: footer;
    z-index: 1;

    background: rgba(0,0,0,0.3);
    display: flex;
    align-items: center;
    justify-content: center;
}

#loading > :first-child {
    animation-name: spin;
    animation-duration: 1000ms;
    animation-iteration-count: infinite;
    animation-timing-function: linear;
    margin: 0 10px;
}

@keyframes spin {
    from {
        transform:rotate(0deg);
    }
    to {
        transform:rotate(360deg);
    }
}

/* Reset button */
button {
    border: none;
    margin: 0;
    padding: 0;
    width: auto;
    overflow: visible;

    background: transparent;
    color: inherit;
    font: inherit;
    line-height: normal;
    text-align: inherit;
}

button, .button {
    padding: 0.7em 2.5em;
    border-radius: 2px;
    color:#FFFFFF;
    background-color: #158215;
    box-shadow:inset 0 -0.6em 0 -0.35em rgba(0,0,0,0.3);
    text-align: center;
    cursor: pointer;
    user-select: none;
}

button.narrow, .button.narrow {
    padding-left: 1em;
    padding-right: 1em;
}

button:disabled {
    filter: grayscale();
    cursor: wait;
}

button:hover:enabled, .button:hover {
    filter: brightness(1.3);
}

.loading-msg {
    font-size: 200%;
    padding: 20px;
}

body:not(.loading) > .loading-msg {
    display: none;
}
