/* @import url("https://fonts.googleapis.com/css?family=Roboto+Mono:400,400i,500,700&display=swap&subset=cyrillic,cyrillic-ext,greek,greek-ext,latin-ext"); */
@import url("https://cdn.jsdelivr.net/npm/fontsource-roboto-mono@3.0.3/400.css");
@import url("https://cdn.jsdelivr.net/npm/fontsource-roboto-mono@3.0.3/500-normal.css");
@import url("https://cdn.jsdelivr.net/npm/fontsource-roboto-mono@3.0.3/700-normal.css");

/* @import url("https://fonts.googleapis.com/css?family=Alegreya+Sans:400,400i,500,500i,700,700i&display=swap&subset=cyrillic,cyrillic-ext,greek,greek-ext,latin-ext,vietnamese"); */
@import url("https://cdn.jsdelivr.net/npm/fontsource-alegreya-sans@3.0.10/400.css");
@import url("https://cdn.jsdelivr.net/npm/fontsource-alegreya-sans@3.0.10/500.css");
@import url("https://cdn.jsdelivr.net/npm/fontsource-alegreya-sans@3.0.10/700.css");

@import url("juliamono.css");
@import url("vollkorn.css");
/* @import url("https://fonts.googleapis.com/css2?family=Lato&display=swap"); */
@import url("https://cdn.jsdelivr.net/npm/fontsource-lato@3.0.9/400.css");

/* VARIABLES */

:root {
    --pluto-cell-spacing: 17px;
    /* use the value "contextual" to enable contextual ligatures `document.documentElement.style.setProperty('--pluto-operator-ligatures', 'contextual');`
        for julia mono see here: https://cormullion.github.io/pages/2020-07-26-JuliaMono/#contextual_and_stylistic_alternates_and_ligatures */
    --pluto-operator-ligatures: none;
}

/* GENERAL PAGE LAYOUT */
html {
    font-size: 17px;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0px;
    overflow-anchor: none;
    position: relative;

    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
}

main {
    flex: 1;

    max-width: calc(700px + 25px + 6px); /* 700px + both paddings */
    padding-top: 20px;
    padding-bottom: 4rem;
    padding-left: 25px;
    padding-right: 6px;
    align-content: center;
    width: 100%;
}

/* | main=25px+700px+6px=731px | pluto-helpbox=350px - 500px | */
/* min-width: 731px+ */

@media screen and (min-width: calc(700px + 25px + 6px + 350px)) and (max-width: calc(700px + 25px + 6px + 500px)) {
    body:not(.disable_ui) main {
        margin-left: 0px;
        align-self: flex-start;
    }
}
@media screen and (min-width: calc(700px + 25px + 6px + 500px)) and (max-width: calc(700px + 25px + 6px + 500px + 500px)) {
    body:not(.disable_ui) main {
        margin-right: 500px;
        align-self: flex-end;
    }
}

pluto-notebook {
    display: block;
}

/* STANDARD HTML ELEMENTS */

/* (can be overriden by custom style) */

pluto-output {
    font-family: "Alegreya Sans", sans-serif;
    font-size: 1em;
    font-weight: 400;
    color: hsl(0, 0%, 25%);
}

pluto-output h1,
pluto-output h2,
pluto-output h3,
pluto-output h4,
pluto-output h5,
pluto-output h6 {
    font-family: "Vollkorn", serif;
    font-feature-settings: "lnum", "pnum";
    font-weight: 600;
    color: hsl(0, 0%, 12%);
    margin-block-start: 1rem;
    margin-block-end: 0rem;
}

pluto-output h1,
pluto-output h2 {
    font-weight: 700;
    margin-block-start: 2rem;
}

pluto-output h1:first-child,
pluto-output h2:first-child {
    margin-block-start: calc(2rem - var(--pluto-cell-spacing));
}

pluto-output h1 {
    font-size: 2.2rem;
    border-bottom: 3px solid rgba(0, 0, 0, 0.15);
    margin-bottom: 0.5rem;
}

pluto-output h2 {
    font-size: 1.8rem;
    border-bottom: 2px dotted rgba(0, 0, 0, 0.15);
    margin-bottom: 0.5rem;
}

pluto-output h1:empty,
pluto-output h2:empty {
    border-bottom: none;
}

pluto-output h3 {
    font-size: 1.6rem;
    /* border-bottom: 2px dotted rgba(0,0,0,.15); */
}

pluto-output h4 {
    font-size: 1.4rem;
}

pluto-output h5 {
    font-size: 1.2rem;
}

pluto-output h6 {
    font-size: 1rem;
}

pluto-output h3:first-child,
pluto-output h4:first-child,
pluto-output h5:first-child,
pluto-output h6:first-child {
    margin-block-start: 0px;
}

pluto-output br,
pluto-output p {
    margin-block-start: 0px;
    margin-block-end: var(--pluto-cell-spacing);
    word-spacing: 0.053em;
    line-height: 1.45em;
}

pluto-output p:first-child {
    margin-block-start: 0px;
}

/* I actually just want to get rid of the margin-block-start on the p tag,
    but css doesn't allow that. So I have to move the list up, instead of not moving it up */
pluto-output li p + ul,
pluto-output li p + ol {
    margin-block-start: calc(var(--pluto-cell-spacing) * -1);
}
pluto-output p:last-child {
    margin-block-end: 0px;
}

pluto-output img,
pluto-output video {
    max-width: 100%;
}

a {
    color: black;
    font-weight: bold;
}

pluto-output code {
    font-family: JuliaMono, monospace;
    font-size: 0.75em; /* not rem */
    font-variant-ligatures: none;
}

pluto-output.rich_output code {
    padding: 3px;
    border-radius: 8px;
    background-color: #f2f2f2;
}
pluto-output.rich_output pre code {
    padding: 0px;
}

pluto-output pre {
    display: inline-block;
    margin: 0px;
    white-space: pre-wrap;
    word-break: break-all;
    tab-size: 4;
    -moz-tab-size: 4; /* https://bugzilla.mozilla.org/show_bug.cgi?id=737785 */
    font-family: JuliaMono, monospace;
    font-variant-ligatures: none;
}

pluto-output hr {
    border: none;
    border-top: 3px solid rgba(0, 0, 0, 0.15);
    margin-left: 0;
    margin-right: 0;
}

pluto-output blockquote {
    margin-left: 1rem;
    margin-right: 1rem;
}

pluto-output.rich_output pre,
pluto-output blockquote {
    margin-block-start: 0px;
    margin-block-end: var(--pluto-cell-spacing);
    display: block;
    padding: 15px;

    border-radius: 15px;
    background-color: #f2f2f2;
    color: #555;
}

pluto-output div.admonition {
    border-radius: 8px;
    margin-block-start: 1em;
    margin-block-end: 1em;
}
pluto-output div.admonition .admonition-title {
    font-family: "Vollkorn", sans-serif;
    font-feature-settings: "lnum", "pnum";
    color: white;
    font-weight: 600;
    margin-block-end: 0px;
    padding-left: 0.3em;
}
pluto-output div.admonition .admonition-title ~ * {
    margin-block-end: 0.5em;
    margin-block-start: 0.5em;
    padding-left: 0.5em;
    transition: filter linear 0.1s;
}

pluto-output div.admonition {
    background: rgba(68, 149, 28, 0.2);
    border: 5px solid rgb(158, 200, 137);
}
pluto-output div.admonition .admonition-title {
    background: rgb(158, 200, 137);
    margin: -1px; /* Fixes a rendering glitch in Chrome */
}
pluto-output div.admonition.note,
pluto-output div.admonition.info,
pluto-output div.admonition.hint {
    background: rgba(50, 115, 200, 0.2);
    border: 5px solid rgb(148, 182, 226);
}
pluto-output div.admonition.note .admonition-title,
pluto-output div.admonition.info .admonition-title,
pluto-output div.admonition.hint .admonition-title {
    background: rgb(148, 182, 226);
}
pluto-output div.admonition.warning {
    background: rgba(162, 148, 30, 0.2);
    border: 5px solid rgb(207, 199, 138);
}
pluto-output div.admonition.warning .admonition-title {
    background: rgb(207, 199, 138);
}
pluto-output div.admonition.danger {
    background: rgba(200, 67, 50, 0.2);
    border: 5px solid rgb(226, 157, 148);
}
pluto-output div.admonition.danger .admonition-title {
    background: rgb(226, 157, 148);
}

pluto-output div.admonition.hint .admonition-title ~ * {
    filter: blur(0.25em);
}
pluto-output div.admonition.hint:hover .admonition-title ~ *,
pluto-output div.admonition.hint:focus-within .admonition-title ~ * {
    filter: blur(0em);
}

pluto-output div.footnote {
    margin-block-start: 1em;
    margin-block-end: 1em;
}

pluto-output div.footnote p.footnote-title::before {
    content: "[";
}
pluto-output div.footnote p.footnote-title::after {
    content: "]: ";
}
pluto-output a.footnote,
pluto-output div.footnote p.footnote-title {
    font-family: "Roboto Mono", monospace;
    font-size: 0.75rem;
    font-weight: 700;
    margin-block-end: 0px;
    letter-spacing: -0.05em;
    /* font-variant: small-caps; */
}

pluto-output div.footnote p.footnote-title ~ * {
    margin-left: 0.1em;
    padding-left: 0.4em;
    border-left: 5px solid rgba(23, 115, 119, 0.15);
    padding-bottom: var(--pluto-cell-spacing);
    margin-block-end: 0px;
}
pluto-output div.footnote p:last-child {
    padding-bottom: 0px;
}

pluto-output.scroll_y {
    max-height: 80vh;
    max-height: 400px;
    overflow: auto;
}

pluto-output table {
    border-collapse: collapse;
    border: 2px solid rgba(0, 0, 0, 0.2);
    border-left: none;
    border-right: none;
    margin: 0 auto;
    margin-block-start: var(--pluto-cell-spacing);
    margin-block-end: var(--pluto-cell-spacing);
}

pluto-output table > thead {
    border-bottom: 1px solid rgba(0, 0, 0, 0.2);
}

pluto-output table > tbody td {
    font-family: JuliaMono, monospace;
    font-size: 0.75rem;
    font-variant-ligatures: none;
}

pluto-output table td,
pluto-output table th {
    padding: 0.2rem 0.5rem;
}

pluto-output table > tbody tr:hover {
    background-color: rgba(224, 203, 158, 0.15);
}
pluto-output table pre {
    white-space: pre;
}
/* HEADER */

body > header {
    /* position: absolute;
    top: 0px; */
    width: 100%;
    min-height: 60px;

    z-index: 5;
    background-color: white;
    transform: translateY(0px);
    transition: background-color 0.5s ease-in-out, transform 0.25s cubic-bezier(0.18, 0.89, 0.49, 1.13);
    border-bottom: solid 1px rgba(0, 0, 0, 0.1);

    font-family: "Roboto Mono", monospace;
    font-weight: 400;
    font-size: 0.75rem;
}

body > header.show_export {
    position: sticky;
    top: 0;
    transform: translateY(130px);
}

aside#export {
    position: absolute;
    top: 0;
    width: 100%;
    height: 130px;
    background: rgb(60, 67, 101);
    color: rgba(255, 255, 255, 0.7);
    transform: translateY(-100%);
}
aside#export::before {
    content: "";
    position: absolute;
    bottom: 100%;
    left: 0;
    right: 0;
    height: 100px;
    background: inherit;
}
aside#export div#container {
    flex-direction: row;
    display: flex;
    max-width: 1000px;
    padding-right: 20px;
    margin: 0 auto;
}
header aside#export div#container {
    /* to prevent the div from taking up horizontal page when the export pane is closed. On small screen this causes overscroll on the right. */
    overflow-x: hidden;
}
header.show_export aside#export div#container {
    overflow-x: auto;
}
a.export_card {
    margin: 20px 5px;
    flex: 0 0 auto;
    width: 160px;
    height: 90px;

    border: 5px solid transparent;
    background: rgba(255, 255, 255, 0.8);
    border-radius: 8px;
    color: rgba(0, 0, 0, 0.7);
    box-shadow: 0px 2px 10px #00000029;
    text-decoration: none;
}
div.export_title {
    height: 90px;
    flex: 0 0 auto;
    border-radius: 8px;
    text-orientation: sideways-right;
    /* Not supported by Chrome: */
    /* writing-mode: sideways-lr; */
    writing-mode: vertical-lr;
    transform: rotate(180deg);

    margin-top: 10px;
    font-weight: 700;
    font-size: 1rem;
}
a.export_card header {
    margin-block: 0px;
    font-family: "Vollkorn", sans;
    font-feature-settings: "lnum", "pnum";
    font-size: 1rem;
}
a.export_card section {
    color: rgba(0, 0, 0, 0.5);
    font-weight: 500;
}
aside#export button.toggle_export {
    margin-left: auto;
    height: 60px;
}
body.loading button.toggle_export,
body.static_preview button.toggle_export {
    display: none;
}

nav#at_the_top h1 {
    color: black;
    letter-spacing: 2px;
}

nav#at_the_top {
    margin: 0 auto;
    max-width: 1000px;
    padding-left: 20px;
    padding-right: 20px;
    flex-wrap: wrap;
    min-height: 60px;
    display: flex;
    flex-direction: row;
    z-index: 10;
}

nav#at_the_top > * {
    flex: 0 0 auto;
    align-self: center;
    margin: 10px 0px;
}

nav#at_the_top > a {
    margin-right: 5rem;
}

nav#at_the_top img {
    height: 39px;
    margin-bottom: -8px;
}

nav#at_the_top h1 {
    font-weight: 700;
    font-size: 1.8rem;
    display: inline;
    border-bottom: none;
}

nav#at_the_top img#logo-small {
    display: none;
}

@media (max-width: 680px) {
    nav#at_the_top img#logo-small {
        display: unset;
    }
    nav#at_the_top img#logo-big {
        display: none;
    }
    nav#at_the_top > a {
        margin-right: 1rem;
    }
}

nav#at_the_top > pluto-filepicker {
    width: 0px;
    flex-grow: 1;

    display: flex;
    flex-direction: row;
}

nav#at_the_top > pluto-filepicker .CodeMirror {
    height: calc(1rem + 4px + 4px + 4px);
    display: inline-block;
    min-width: 10rem;
    opacity: 0.6;
    font-style: normal;
    font-weight: 500;
    font-family: inherit;
    font-size: 0.8rem;
    letter-spacing: 1px;
    background: none;
    border: 2px solid #818181;
    border-radius: 3px;
    border-right: none;
    border-top-right-radius: 0;
    border-bottom-right-radius: 0;
}

nav#at_the_top > pluto-filepicker .CodeMirror-scroll {
    overflow: hidden !important;
}

nav#at_the_top > pluto-filepicker button {
    cursor: pointer;
}

button.toggle_export {
    border: none;
    background: none;
    cursor: pointer;
    opacity: 0.5;
}
button.toggle_export span {
    display: block;
    content: " " !important;
    background-size: 25px 25px;
    height: 25px;
    width: 25px;
}

nav#at_the_top button.toggle_export span {
    background-image: url(https://cdn.jsdelivr.net/gh/ionic-team/ionicons@5.0.0/src/svg/shapes-outline.svg);
}
aside#export button.toggle_export span {
    background-image: url(https://cdn.jsdelivr.net/gh/ionic-team/ionicons@5.0.0/src/svg/close-outline.svg);
    filter: invert();
}
nav#at_the_top:after {
    margin-left: auto;
    align-self: center;
}

li.file.new.CodeMirror-hint:before {
    content: "👉";
    color: black;
}

li.file.CodeMirror-hint:before {
    content: "📄";
    color: black;
}

li.dir.CodeMirror-hint:before {
    content: "📁";
    color: black;
}

@media (any-pointer: fine) {
    nav#at_the_top > pluto-filepicker .CodeMirror {
        border: 2px solid transparent;
        border-right: none;
        transition: border 0.15s ease-in-out;
    }
    nav#at_the_top > pluto-filepicker button {
        opacity: 0;
        transition: opacity 0.15s ease-in-out;
    }
    header:hover > nav#at_the_top > pluto-filepicker .CodeMirror,
    header:focus-within > nav#at_the_top > pluto-filepicker .CodeMirror {
        border: 2px solid #818181;
        border-right: none;
    }
    header:hover > nav#at_the_top > pluto-filepicker button,
    header:focus-within > nav#at_the_top > pluto-filepicker button {
        opacity: 1;
    }
}

body.binder > header > nav#at_the_top > pluto-filepicker > * {
    display: none;
}

body.binder.loading > header {
    background-color: hsl(51deg 64% 90% / 50%);
    position: sticky;
    top: 0;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

body.loading > header {
    background-color: hsla(290, 10%, 80%, 0.5);
}

body.disconnected > header {
    background-color: rgba(255, 169, 114, 0.56);
    position: sticky;
    top: 0;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

nav:after {
    font-size: 1rem;
    font-weight: 500;
    padding: 5px 10px;
    margin: 5px;
    background: white;
    border-radius: 10px;
    z-index: 1;
}

body.disconnected > header > nav#at_the_top:after {
    content: "Reconnecting...";
}

body.loading > header > nav:after {
    content: "Loading...";
}
body.binder.loading > header > nav:after {
    content: "Loading binder...";
}

loading-bar {
    height: 6px;
    width: 10vw;
    background-color: #b1c9dd;
    position: fixed;
    top: 0px;
    display: block;
    transition: width cubic-bezier(0.14, 0.71, 0, 0.99) 10s, opacity linear 0.5s;
    opacity: 0;
    pointer-events: none;
}

#binder_spinners {
    width: 100%;
    height: 100%;
    display: block;
    position: absolute;
    overflow: hidden;

    opacity: 0;
    transition: opacity 1s ease-in-out;
    pointer-events: none;
}

body.binder.loading #binder_spinners {
    opacity: 0.25;
}
body.binder.loading loading-bar {
    opacity: 1;
}

binder-spinner#ring_1 {
    border-top-color: #f5a252;
    width: 300px;
    height: 300px;
    margin-left: calc(-0.5 * 300px);
    margin-top: calc(-0.5 * 300px);
    animation-duration: 2s;
}
binder-spinner#ring_2 {
    border-top-color: #579aca;
    width: 380px;
    height: 380px;
    margin-left: calc(-0.5 * 380px);
    margin-top: calc(-0.5 * 380px);
    animation-duration: 3s;
}
binder-spinner#ring_3 {
    border-top-color: #e56581;
    width: 460px;
    height: 460px;
    margin-left: calc(-0.5 * 460px);
    margin-top: calc(-0.5 * 460px);
    animation-duration: 4s;
}
binder-spinner {
    top: 117px;
    left: 80vw;
    position: absolute;
    border: 25px solid transparent;
    display: block;
    border-radius: 100%;
    animation: spin 4s linear infinite;
}

@keyframes spin {
    0% {
        transform: rotate(0deg);
    }
    100% {
        transform: rotate(360deg);
    }
}

button#launch_binder {
    /* position: absolute; */
    position: fixed;

    top: 10px;
    right: 30px;
    /* width: 153.2px; */
    /* height: 60px; */
    padding: 7px 20px;
    background: #fffdf7;
    border: 3px solid #3f448c5e;
    border-radius: 30px;
    z-index: 20;
    box-shadow: 0px 0px 20px 0px #ffffff;
    cursor: pointer;
    font-size: 14px;
    font-style: italic;
    font-family: "Roboto Mono";
    letter-spacing: -0.2px;
    color: #0000009c;
    white-space: nowrap;
}
body.code_differs button#launch_binder {
    position: fixed;
    animation: wiggle 0.3s ease-in-out 0s 1;
}

@keyframes wiggle {
    0% {
        transform: rotate(0deg);
    }
    30% {
        transform: rotate(10deg);
    }
    70% {
        transform: rotate(-10deg);
    }
    100% {
        transform: rotate(0deg);
    }
}

button#launch_binder img {
    margin: -8px;
    margin-left: 0px;
    font-style: normal;
    color: black;
    font-weight: 900;
}

/* PREAMBLE */

main > preamble {
    display: flex;
    position: relative;
    height: 20px;
}

main > preamble > button {
    display: none;
    right: 0px;
}

main > preamble > button > span::after {
    content: "Submit all changes";
    display: block;
    padding-right: 20px;

    background-size: 17px 17px;
    background-image: url(https://cdn.jsdelivr.net/gh/ionic-team/ionicons@5.0.0/src/svg/sync-circle-outline.svg);
    background-repeat: no-repeat;
    background-position-x: right;
    background-position-y: 1px;
}

body.code_differs > main > preamble > button {
    display: block;
}

/* CELL */

pluto-cell {
    display: block;
    /* CodeMirror line height (defined by their JS somehow) + 1px border top + 1px border bottom */
    min-height: calc(23px + 1px + 1px);
    margin-top: var(--pluto-cell-spacing);
    position: relative;
}

pluto-output {
    display: block;
    padding-left: 10px;
    padding-right: 10px;
    align-items: baseline;
    overflow-x: auto;

    background-color: white;
}

.scroll_y {
    overflow-y: auto;
    max-height: 80vh;
}

pluto-output:focus {
    outline: none;
}

pluto-output:not(.rich_output) {
    display: flex;
    flex-wrap: wrap;
    padding-top: 3px;
    padding-bottom: 3px;
}

pluto-output > assignee {
    font-family: JuliaMono, monospace;
    font-size: 0.75rem;
    font-variant-ligatures: none;
}

pluto-output > assignee::after {
    content: "\a0=\a0";
    opacity: 0.6;
}

pluto-output > assignee:empty {
    display: none;
}

pluto-output > div {
    flex-shrink: 0;
    overflow-y: hidden;
}

pluto-output:not(.rich_output) > div > pre {
    display: flex;
}

/* SELECTION */

pluto-cell.selected {
    background: rgba(40, 78, 189, 0.24);
    border-radius: 0 3px 3px 0;
}

pluto-cell.selected > pluto-input > div.CodeMirror,
pluto-cell.selected > pluto-output {
    opacity: 0.7;
}

main {
    cursor: vertical-text;
}
pluto-cell {
    cursor: auto;
}

/* SCROLLBAR FIREFOX */

pluto-output > div {
    scrollbar-width: thin;
    scrollbar-color: transparent transparent;
}

pluto-cell:hover > pluto-output > div {
    scrollbar-color: rgba(0, 0, 0, 0.15) rgba(0, 0, 0, 0.05);
}

/* SCROLLBAR CHROME */

pluto-output > div::-webkit-scrollbar {
    height: 6px;
    background: transparent;
}

pluto-output > div::-webkit-scrollbar-thumb {
    background: transparent;
}

pluto-cell:hover > pluto-output > div::-webkit-scrollbar {
    background: rgba(0, 0, 0, 0.05);
}

pluto-cell:hover > pluto-output > div::-webkit-scrollbar-thumb {
    background: rgba(0, 0, 0, 0.15);
}

/* CELL INPUT */

pluto-input .CodeMirror {
    height: auto !important;
    width: auto;
    z-index: 2;
    border-bottom-right-radius: 4px;
    border: 1px solid rgba(0, 0, 0, 0.1);
    border-left: none;
    transition: border 0.15s ease-in-out;
}

pluto-input .CodeMirror-scroll {
    min-height: 0px;
}

pluto-input .CodeMirror-empty {
    color: rgba(0, 0, 0, 0.15);
}

pluto-cell.code_folded > pluto-input {
    display: none;
}

pluto-cell.code_differs > pluto-input {
    display: unset;
}

pluto-cell.code_differs > pluto-input > .CodeMirror {
    border: 1px solid hsla(46, 70%, 37%, 0.68);
    border-left: none;
}

/* UI */

preamble > button,
pluto-cell > button,
pluto-input > button,
pluto-runarea > button,
pluto-shoulder > button,
nav#slide_controls > button {
    position: absolute;
    margin: 0px;
    padding: 1px;
    opacity: 50%;
    border: none;
    background: none;
    cursor: pointer;
    /* color: hsl(204, 86%, 35%); */
    color: black;
    font-family: "Segoe UI Emoji", "Roboto Mono", monospace;
    font-size: 0.75rem;
    z-index: 3;
    /* CodeMirror is 2 */
}

/* CELL SHOULDER */

pluto-shoulder {
    position: absolute;
    /* top: 0px; */
    /* bottom: 0px; */
    left: -2000px;
    width: 2000px;
    cursor: move;
    display: flex;
    flex-direction: row;
    justify-content: flex-end;
    align-items: flex-start;
    /* Add an invisible border around the shoulder, to make it easier to click on. (The are between two cells is divided in two, each half belongs to the closest pluto-cell.) */
    top: calc(0px - 0.5 * var(--pluto-cell-spacing));
    bottom: calc(0px - 0.5 * var(--pluto-cell-spacing));
    border-top: calc(0.5 * var(--pluto-cell-spacing)) solid rgba(0, 0, 0, 0);
    border-bottom: calc(0.5 * var(--pluto-cell-spacing)) solid rgba(0, 0, 0, 0);
}

pluto-shoulder:hover {
    background: rgba(0, 0, 0, 0.05);
    background-clip: padding-box;
}

pluto-shoulder > button {
    flex: 0 0 auto;
    position: sticky;
    top: 0px;
    margin-top: 4px;
    margin-right: 5px;
    padding: 0px 1px;
}

pluto-cell:focus-within > pluto-shoulder > button {
    /* we use padding instead of 4px extra margin to move the eye to the left so that the hitbox becomes grows - you want to be able to double click the button */
    padding-right: 4px;
}

/* pluto-cell.code_folded.inline-output > pluto-shoulder > button {
    margin-top: 3px;
} */

pluto-shoulder > button > span::after {
    background-image: url(https://cdn.jsdelivr.net/gh/ionic-team/ionicons@5.0.0/src/svg/eye-outline.svg);
}

pluto-cell.code_folded > pluto-shoulder > button > span::after {
    background-image: url(https://cdn.jsdelivr.net/gh/ionic-team/ionicons@5.0.0/src/svg/eye-off-outline.svg);
}

/* TRAFFIC LIGHT */

pluto-trafficlight {
    /* --patternHeight is derived from the pattern length (16px) div sin(45deg) = 16px * sqrt(2)  */
    --patternHeight: 22.62741699797px;
    box-sizing: content-box;
    margin-right: -1px; /* fix a visual glitch of imperfect alignment */
    width: 4px;
    position: absolute;
    left: -4px;
    top: 0px;
    bottom: 0px;
    pointer-events: none;
    border-top-left-radius: 4px;
    border-bottom-left-radius: 4px;
    border-left-color: rgba(0, 0, 0, 0.1);
    background: rgba(0, 0, 0, 0.1);
    overflow: hidden;
}

pluto-trafficlight::after {
    content: "";
    /* Calc needs units everywhere to work */
    top: calc(0px - 2 * var(--patternHeight));
    left: 0;
    width: 100%;
    height: calc(100% + 2 * var(--patternHeight));
    position: absolute;
}

/* in ascending order of severity: */
/* we need the :not(.___) to fix our CSS selector specificity when `body.disable_ui` */
body:not(.___) pluto-cell.code_folded > pluto-trafficlight {
    background: none;
}

@media screen and (any-pointer: fine) {
    body:not(.disable_ui) pluto-cell:hover > pluto-trafficlight {
        background: rgba(0, 0, 0, 0.1);
        transition: background 0.05s ease-in;
    }
}

body:not(.___) pluto-cell:focus-within > pluto-trafficlight {
    border-left-width: 4px;
    border-left-style: solid;
    margin-left: -4px;
    background-clip: content-box;
    background-color: rgba(0, 0, 0, 0.1);
}

body:not(.___) pluto-cell.selected > pluto-trafficlight {
    background: rgba(40, 78, 189, 0.4);
    border-left-color: rgba(40, 78, 189, 0.4);
    background-clip: content-box;
}

body:not(.___) pluto-cell.code_differs > pluto-trafficlight {
    background: hsla(46, 70%, 37%, 0.68);
    border-left-color: hsla(46, 70%, 37%, 0.68);
    background-clip: content-box;
}

body:not(.___) pluto-cell.errored > pluto-trafficlight {
    background: hsla(0, 70%, 80%, 0.7);
    border-left-color: hsla(0, 70%, 80%, 0.7);
    background-clip: content-box;
}

body:not(.___) pluto-cell.queued > pluto-trafficlight::after {
    background: repeating-linear-gradient(-45deg, rgba(0, 0, 0, 0), rgba(0, 0, 0, 0) 8px, rgba(0, 0, 0, 0.1) 8px, rgba(0, 0, 0, 0.1) 16px);
    background-clip: content-box;
    animation: 1s linear 0s infinite running scrollbackground;
    background-size: 4px var(--patternHeight);
}

body:not(.___) pluto-cell.running > pluto-trafficlight::after {
    background: repeating-linear-gradient(-45deg, rgba(0, 0, 0, 0.1), rgba(0, 0, 0, 0.1) 8px, rgba(0, 0, 0, 0.2) 8px, rgba(0, 0, 0, 0.2) 16px);
    background-clip: content-box;
    animation: 1s linear 0s infinite running scrollbackground;
    background-size: 4px var(--patternHeight);
}

body:not(.___) pluto-cell.queued.errored > pluto-trafficlight::after {
    background: repeating-linear-gradient(
        -45deg,
        hsla(0, 70%, 80%, 0.7),
        hsla(0, 70%, 80%, 0.7) 8px,
        hsla(0, 70%, 80%, 0.05) 8px,
        hsla(0, 70%, 80%, 0.05) 16px
    );
    background-clip: content-box;
    animation: 1s linear 0s infinite running scrollbackground;
    background-size: 4px var(--patternHeight); /* 16 * sqrt(2) */
}

body:not(.___) pluto-cell.running.errored > pluto-trafficlight::after {
    background: repeating-linear-gradient(-45deg, hsla(0, 100%, 80%, 1), hsla(0, 100%, 80%, 1) 8px, hsla(0, 70%, 80%, 0.7) 8px, hsla(0, 70%, 80%, 0.7) 16px);
    background-clip: content-box;
    animation: 1s linear 0s infinite running scrollbackground;
    background-size: 4px var(--patternHeight); /* 16 * sqrt(2) */
}

pluto-cell.drop_target {
    position: relative;
}

pluto-cell.drop_target pluto-input::after {
    position: absolute;
    top: 0;
    left: 0;
    height: 100%;
    width: 100%;
    color: black;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2;
    background-color: rgba(255, 255, 255, 0.75);
    content: "+ Drop file here";
}

pluto-cell.drop_target.saving_file pluto-input::after {
    content: "The 💾 File you dropped is being saved... ";
    color: white;
    background-color: rgba(3, 92, 151, 0.75);
}

pluto-cell.drop_target.drop_invalid pluto-input::after {
    background-color: #ece5e5bf;
    color: rgba(0, 0, 0, 0.85);
    content: "Try dropping your file in an empty cell!";
}

/* Define --patternHeight for this keyframes animation to work! */
@keyframes scrollbackground {
    0% {
        transform: translateY(0px);
    }
    100% {
        transform: translateY(calc(var(--patternHeight)));
    }
}

/* BUTTONS */

pluto-cell > button > span,
pluto-input > button > span {
    pointer-events: none;
}

@media screen and (any-pointer: fine) {
    pluto-cell > button,
    pluto-input > button,
    pluto-runarea > button,
    pluto-shoulder > button,
    pluto-cell > pluto-runarea {
        opacity: 0;
        /* to make it feel smooth: */
        transition: opacity 0.25s ease-in-out;
    }
    button.toggle_export,
    pluto-cell:hover > button,
    pluto-cell:hover > pluto-input > button,
    pluto-cell > pluto-runarea > button,
    pluto-cell:hover > pluto-shoulder > button {
        opacity: 0.25;
        transition: opacity 0.25s ease-in-out;
    }
    button.toggle_export:hover,
    preamble > button:hover,
    pluto-cell > button:hover,
    pluto-cell > pluto-input > button:hover,
    pluto-cell > pluto-runarea > button:hover,
    pluto-cell > pluto-shoulder > button:hover,
    pluto-cell:hover > pluto-runarea {
        opacity: 1;
        /* to make it feel snappy: */
        transition: opacity 0.05s ease-in-out;
    }
}

@media screen and (any-pointer: coarse) {
    pluto-cell > button,
    pluto-cell > pluto-runarea {
        opacity: 0;
        /* to make it feel smooth: */
        transition: opacity 0.25s ease-in-out;
    }
    pluto-input > button,
    pluto-shoulder > button {
        opacity: 0.25;
    }
    pluto-cell:focus-within > button,
    pluto-cell:focus-within > pluto-input > button,
    pluto-cell:focus-within > pluto-runarea,
    pluto-cell:focus-within > pluto-shoulder > button {
        opacity: 0.25;
    }
    pluto-cell > button:focus-within,
    pluto-cell > pluto-input > button:focus-within pluto-cell > pluto-runarea > button:focus-within,
    pluto-cell > pluto-shoulder > button:focus-within,
    pluto-cell > pluto-runarea {
        opacity: 1;
        /* to make it feel snappy: */
        transition: opacity 0.05s ease-in-out;
    }
}

pluto-cell > button > span::after,
pluto-input > button > span::after,
pluto-runarea > button > span::after,
pluto-shoulder > button > span::after {
    display: block;
    content: " " !important;
    background-size: 17px 17px;
    height: 17px;
    width: 17px;
}

pluto-cell > button.add_cell {
    left: -12px;
}

pluto-cell > button.add_cell.before {
    margin-top: calc(-19px - 0.5 * (var(--pluto-cell-spacing) - 19px)) !important;
}

pluto-cell > button.add_cell.after {
    bottom: 1px;
    margin-bottom: calc(-20px - 0.5 * (var(--pluto-cell-spacing) - 19px));
}

pluto-cell > button.add_cell > span::after {
    /* background-image: url(https://cdn.jsdelivr.net/gh/ionic-team/ionicons@5.0.0/src/svg/add-circle-outline.svg); */
    background-image: url(https://cdn.jsdelivr.net/gh/ionic-team/ionicons@5.0.0/src/svg/add-outline.svg);
}

pluto-input > button.delete_cell {
    /* top: 3px; */
    /* left: -26px; */
    right: 0px;
    padding: 5px;
}

pluto-input > button.delete_cell > span::after {
    background-image: url(https://cdn.jsdelivr.net/gh/ionic-team/ionicons@5.0.0/src/svg/close-circle-outline.svg);
}

/* RUNAREA */

pluto-runarea {
    margin-right: 3px;
    display: block;
    height: 17px;
    position: absolute;
    right: 0px;
    min-width: 75px;
    background-color: hsl(0, 0%, 97%);
    /* border: 2px solid hsla(0, 0%, 0%, 0.1); */
    border-bottom-left-radius: 5px;
    border-bottom-right-radius: 5px;
    border-top: none;
}

pluto-runarea > span {
    display: inline-block;
    position: absolute;
    top: 1px;
    left: 22px;
    width: 45px;

    font-family: "Roboto Mono", monospace;
    font-size: 0.6em;
    font-style: italic;
    color: hsl(353, 5%, 64%);
    text-align: center;
}

pluto-runarea > button.runcell {
    top: -1px;
    left: 1px;
}

pluto-runarea > button.runcell > span::after {
    background-image: url(https://cdn.jsdelivr.net/gh/ionic-team/ionicons@5.0.0/src/svg/caret-forward-circle-outline.svg);
}

pluto-cell.running > pluto-runarea > button.runcell > span::after,
pluto-cell.queued > pluto-runarea > button.runcell > span::after {
    background-image: url(https://cdn.jsdelivr.net/gh/ionic-team/ionicons@5.0.0/src/svg/stop-circle-outline.svg);
}

pluto-cell.code_folded > pluto-runarea {
    display: none;
}

pluto-cell.code_differs > pluto-runarea {
    display: block;
}

pluto-cell:focus-within > pluto-runarea,
pluto-cell.code_differs > pluto-runarea {
    opacity: 100%;
}

pluto-cell.code_differs > pluto-runarea > button {
    animation-name: 👀;
    animation-duration: 4s;
    animation-iteration-count: infinite;
}

@keyframes 👀 {
    0%,
    80%,
    100% {
        transform: scale(1);
        opacity: 50%;
    }
    90% {
        transform: scale(1.2);
        opacity: 100%;
    }
}

/* DRAG DROP */

dropruler {
    position: absolute;
    display: none;
    left: 0px;
    right: 0px;
    height: 4px;
    margin-top: calc(-2px - 0.5 * var(--pluto-cell-spacing));
    background: rgba(0, 0, 0, 0.5);
}

/* LIVE DOCS */

#helpbox-wrapper {
    display: none;
    position: sticky;
    bottom: 0px;
    height: 0px;
    width: 100%;
    z-index: 5;
}

@media (min-width: 500px) {
    #helpbox-wrapper {
        display: block;
    }
}
pluto-helpbox {
    bottom: 0px;
    right: 20px;
    position: absolute;
    display: flex;
    flex-direction: column;
    width: calc(100vw - 50px - (700px + 25px + 6px)); /* compat */
    width: calc(max(min(100vw - 50px - (700px + 25px + 6px), 450px), 300px));
    height: 70vh; /* compat */
    height: min(70vh, 900px);
    /* overflow: hidden; */
    background-color: white;
    /* border: 2px solid darkgray; */
    border-right: none;
    border-bottom: none;
    border-top-left-radius: 9px;
    border-top-right-radius: 9px;
    box-shadow: 0 0 11px 0px #00000010;
}
pluto-helpbox > header {
    display: flex;
    padding: 15px;
    background-color: #eef1f7;
    color: hsl(230, 14%, 11%);
    font-family: "Roboto Mono", monospace;
    font-weight: 700;
    border-top-left-radius: 6px;
    border-top-right-radius: 6px;
    /* border-top: 4px solid #8a8a8a; */
}
pluto-helpbox > header::before {
    content: "📖 ";
    margin-right: 10px;
}
/* pluto-helpbox.loading>header::before{
    content: "⌛ ";
    margin-right: 10px;
} */
pluto-helpbox.hidden > header::before {
    content: "📚 ";
    margin-right: 10px;
}
pluto-helpbox > header > input {
    flex-grow: 1;
    background-color: inherit;
    color: inherit;
    font-family: inherit;
    font-weight: inherit;
    font-size: inherit;
    border: none;
}
pluto-helpbox.notfound > header > input {
    color: rgb(139, 139, 139);
}
pluto-helpbox > header > input:focus {
    outline: none;
}
pluto-helpbox > header > button {
    border: none;
    background: none;
    cursor: pointer;

    /* for bigger hitbox */
    margin: -15px;
    border: 15px solid transparent;
}
pluto-helpbox > header > button > span {
    display: block;
    content: " " !important;
    background-size: 1em 1em;
    height: 1em;
    width: 1em;
    background-image: url("https://cdn.jsdelivr.net/gh/ionic-team/ionicons@5.0.0/src/svg/chevron-down-outline.svg");
}
pluto-helpbox.hidden {
    height: initial;
    cursor: pointer;
}
pluto-helpbox.hidden > section {
    display: none;
}

/* NOTE */
/* We try to match the visual style of Documenter.jl, so we have copied over some rules from */
/* https://docs.julialang.org/en/v1/assets/themes/documenter-light.css */
/* see https://github.com/JuliaDocs/Documenter.jl for author information */

pluto-helpbox {
    font-family: "Lato", -apple-system, BlinkMacSystemFont, "Segoe UI", "Helvetica Neue", "Helvetica", "Arial", sans-serif;
    line-height: 1.5;
}
pluto-helpbox pre,
pluto-helpbox code {
    /* from https://docs.julialang.org/en/v1/assets/themes/documenter-light.css */
    font-family: "Roboto Mono", "SFMono-Regular", "Menlo", "Consolas", "Liberation Mono", "DejaVu Sans Mono", monospace;
    font-size: 0.875em;
}
pluto-helpbox pre code {
    font-size: 1em;
}

pluto-helpbox > section {
    height: 100%;
    overflow: auto;
    padding: 10px;
}
pluto-helpbox > section h1,
pluto-helpbox > section h2,
pluto-helpbox > section h3,
pluto-helpbox > section h4,
pluto-helpbox > section h5,
pluto-helpbox > section h6 {
    font-family: inherit;
    border-bottom: none;
    font-size: 1rem;
}
pluto-helpbox > section h1 {
    font-size: 1.3rem;
}
pluto-helpbox > section pre {
    padding: 0.7rem 0.5rem;
    -webkit-overflow-scrolling: touch;
    overflow-x: auto;
    background: whitesmoke;
    border: 1px solid #dbdbdb;
    white-space: pre;
    word-wrap: normal;
}
/* pluto-helpbox > section code {
    background-color: whitesmoke;
    padding: 0.1em;
} */
pluto-helpbox > section hr {
    border: none;
    border-top: 3px solid rgba(0, 0, 0, 0.15);
}

/* FOOTER */

footer {
    width: 100%;
    height: 3.5rem;
    font-family: "Roboto Mono", monospace;
    font-size: 0.75rem;
    background-color: #d7dcd3;
    color: #333333;
    z-index: 7;
}

footer form {
    height: 1.5rem;
    display: flex;
    flex-direction: row;
    justify-content: flex-end;
}

footer form > * {
    flex: 0 0 auto;
}

footer form > a,
footer form > label {
    align-self: center;
}

footer form > label {
    margin-right: 1em;
}

footer form > a {
    margin-right: 1em;
}

footer a {
    color: black;
    opacity: 0.6;
    font-weight: 700;
}

@media (max-width: 650px) {
    footer form > label {
        display: none;
    }
}

footer input {
    margin: 0px;
    border: 2px solid #818181;
    font-family: inherit;
    font-size: inherit;
    border-radius: 3px 0 0 3px;
    padding: 3px;
    border-right: none;
}

body > header pluto-filepicker button,
footer button {
    margin: 0px;
    background: #896c6c;
    border-radius: 0 3px 3px 0;
    border: 2px solid #896c6c;
    color: white;
    /* border: none; */
    font-family: inherit;
    font-weight: 600;
    font-size: 0.75rem;
}

#info {
    max-width: 9400px;
    margin: 0 auto;
    padding: 1rem;
    text-align: right;
}

/* UNDO DELETED CELL */

nav#undo_delete {
    z-index: 20;
    display: block;
    position: fixed;
    bottom: 0px;
    left: 0px;
    margin: 0.75rem;
    padding: 0.5rem;

    font-family: "Roboto Mono", monospace;
    font-size: 0.75rem;

    background: white;
    border-radius: 3px;

    box-shadow: 00px 00px 10px 2px #0003;
    opacity: 1;
    transition: 0.2s linear box-shadow, 0.2s ease-out margin-bottom, 0.05s linear opacity;
}

nav#undo_delete.hidden {
    margin-bottom: 0px;
    box-shadow: 00px 00px 10px -5px #0003;
    opacity: 0;
    pointer-events: none;
}

@keyframes shadow-fadeout {
    0% {
        box-shadow: 00px 00px 10px 2px #0003;
        opacity: 1;
    }
    80% {
        opacity: 1;
    }
    100% {
        opacity: 0;
    }
}

/* PRESENTATION MODE */

body.presentation pluto-output h1,
body.presentation pluto-output h2 {
    margin-top: 100vh;
}
body.presentation pluto-notebook {
    padding-bottom: 100vh;
}
body.presentation #helpbox-wrapper {
    display: none !important;
}

body > nav#slide_controls {
    display: none;
}
body.presentation > nav#slide_controls {
    display: flex;
    position: fixed;
    bottom: 0px;
    right: 0px;
    z-index: 10;
}

body > nav#slide_controls > button {
    position: static;
    padding: 5px;
}

body > nav#slide_controls > button > span::after {
    content: " " !important;
    display: block;
    height: 30px;
    width: 30px;
    background-size: 30px 30px;
}
body > nav#slide_controls > button.prev > span::after {
    background-image: url(https://cdn.jsdelivr.net/gh/ionic-team/ionicons@5.0.0/src/svg/arrow-back-outline.svg);
}
body > nav#slide_controls > button.next > span::after {
    background-image: url(https://cdn.jsdelivr.net/gh/ionic-team/ionicons@5.0.0/src/svg/arrow-forward-outline.svg);
}

/* CODEMIRROR HINTS */

.CodeMirror-hints {
    max-height: calc(20 * 16px);
    box-sizing: content-box;
}

li.CodeMirror-hint {
    /* this is the line height rounded to an integer to prevent jiggle */
    height: 16px;
    /* font-size: 16px; */
    line-height: 16px;
}

li.CodeMirror-hint.c_notexported {
    color: rgba(0, 0, 0, 0.5);
}
li.CodeMirror-hint-active.c_notexported {
    color: white;
}

li.CodeMirror-hint::before {
    content: "⚫";
    color: transparent;
    margin-right: 0.5em;
    opacity: 1;
}

/* CODEMIRROR STYLE */

/*
Based on "Paraíso (Light)" by Jan T. Sott:
    Color scheme by Jan T. Sott (https://github.com/idleberg/Paraiso-CodeMirror)
    Inspired by the art of Rubens LP (http://www.rubenslp.com.br)
*/

ul.CodeMirror-hints {
    padding: 0;
    margin-left: -1.5em;
}

pluto-input .CodeMirror,
ul.CodeMirror-hints {
    font-family: JuliaMono, monospace !important;
    font-variant-ligatures: none;
    font-size: 0.75em;
}

.cm-s-default.CodeMirror {
    background: hsla(46, 90%, 98%, 1);
    color: #41323f;
}

.cm-s-default.CodeMirror pre.CodeMirror-line,
.cm-s-default.CodeMirror pre.CodeMirror-line-like {
    font-variant-ligatures: none;
}

.cm-s-default div.CodeMirror-selected {
    background: #d9dfef;
}

.cm-s-default .CodeMirror-line::selection,
.cm-s-default .CodeMirror-line > span::selection,
.cm-s-default .CodeMirror-line > span > span::selection {
    background: #d9dfef;
}

.cm-s-default .CodeMirror-line::-moz-selection,
.cm-s-default .CodeMirror-line > span::-moz-selection,
.cm-s-default .CodeMirror-line > span > span::-moz-selection {
    background: #d9dfef;
}

.cm-s-default .CodeMirror-gutters {
    /* background: hsla(46, 90%, 98%, 1); */
    background: transparent;
    border-right: solid 1px hsla(0, 0%, 0%, 0);
}

pluto-cell.code_differs .cm-s-default .CodeMirror-gutters {
    /* background: hsla(46, 70%, 88%, 1); */
    background-color: rgba(214, 172, 35, 0.2);
}

.cm-s-default .CodeMirror-guttermarker {
    color: black;
}

.cm-s-default .CodeMirror-guttermarker-subtle {
    color: #8d8687;
}

.cm-s-default .CodeMirror-linenumber {
    color: #8d86875e;
}

.cm-s-default .CodeMirror-linenumber::before {
    content: "⋅";
    font-size: 0.75rem;
}

.cm-s-default .CodeMirror-linenumber {
    font-size: 0px;
}

.cm-s-default .CodeMirror-linenumber:hover {
    font-size: 0.75rem;
}

.cm-s-default .CodeMirror-linenumber:hover::before {
    font-size: 0px;
}

.cm-s-default .CodeMirror-cursor {
    border-left: 1.5px solid #776e71;
}

.cm-s-default span.cm-comment {
    color: #e96ba8;
    font-style: italic;
}

.cm-s-default span.cm-atom {
    color: #815ba4;
}

li.CodeMirror-hint.c_Number::before,
.cm-s-default span.cm-number {
    color: #815ba4;
}

.cm-s-default span.cm-property,
.cm-s-default span.cm-attribute {
    color: #48b685;
}

.cm-s-default span.cm-keyword {
    color: #ef6155;
}

li.CodeMirror-hint.c_String::before,
.cm-s-default span.cm-string {
    color: #ce7d0a;
}

.cm-s-default span.cm-operator {
    font-variant-ligatures: var(--pluto-operator-ligatures);
}

li.CodeMirror-hint.c_Any::before,
pluto-output > assignee,
.cm-s-default span.cm-variable {
    color: #5668a4;
    font-weight: 700;
}

.cm-s-default span.cm-builtin {
    color: #5e7ad3;
    font-weight: 700;
}

.cm-s-default span.cm-variable-2 {
    color: #06b6ef;
}

li.CodeMirror-hint.c_Function::before,
.cm-s-default span.cm-def {
    color: #f99b15;
}

li.CodeMirror-hint.c_Array::before,
.cm-s-default span.cm-bracket {
    color: #41323f;
}

.cm-s-default span.cm-tag {
    color: #ef6155;
}

.cm-s-default span.cm-link {
    color: #815ba4;
}

.cm-s-default span.cm-error {
    background: #ef6155;
    color: #f7f7f7;
}

.cm-s-default .CodeMirror-activeline-background {
    background: #cfd1c4;
}

div.CodeMirror span.CodeMirror-matchingbracket {
    color: unset;
}

pluto-input:focus-within .cm-s-default .CodeMirror-matchingbracket {
    color: black !important;
    font-weight: 700;
    background-color: #1b4bbb21;
    border-radius: 2px;
}

.cm-s-default.CodeMirror-empty {
    color: rgba(0, 0, 0, 0.2);
    font-style: italic;
}
