jinn-tap {
    display: grid;
    grid-template-rows: min-content 1fr;
    grid-template-columns: 1fr minmax(220px, 460px);
    grid-template-areas:
        "toolbar aside"
        "editor aside";
    column-gap: 1rem;
    row-gap: .5rem;
    height: fit-content;
	/* Add a bit of space under the viewport to allow one to scroll a bit beyond the end of the
   document */
	margin-bottom:50vh
}

jinn-tap[sidebar] {
    grid-template-columns: 1fr;
}

jinn-tap > nav {
    grid-area: toolbar;
    position: sticky;
    top: 0;
    background-color: var(--jinn-tap-background-color, white);
}

.jinn-tap-aside .user-info {
    font-size: 0.75rem;
}

jinn-tap .editor-area, jinn-tap .code-area {
    grid-area: editor;
    min-height: 1rem;
}

jinn-tap .code-area {
    text-wrap: wrap;
}

jinn-tap .jinn-tap-aside {
    grid-area: aside;
    background: var(--jinn-tap-background-color, white);
    padding: 20px;
    max-height: fit-content;
    position: sticky;
    top: 0;
    z-index: 10;
}

.jinn-tap-aside .attribute-panel > div {
    overflow-y: auto;
}

.jinn-tap-aside .attribute-panel fieldset {
    display: grid;
    grid-template-columns: min-content 1fr;
    grid-auto-rows: min-content;
    align-items: center;
    column-gap: 1rem;
    row-gap: 0.5rem;
    border: none;
    padding-left: 0;
    padding-right: 0;
    margin: 0;
}

.jinn-tap-aside .attribute-panel fieldset label {
    display: block;
    padding-right: 1rem;
}

.jinn-tap-aside .attribute-panel fieldset input,
.jinn-tap-aside .attribute-panel fieldset select {
    display: block;
    margin: 0;
}

.jinn-tap-aside .attribute-panel details {
    margin-top: 1rem;
}

.jinn-tap-aside .attribute-panel footer {
    display: flex;
    justify-content: flex-end;
    margin-top: 1rem;
}

.jinn-tap-aside pb-authority-lookup {
    overflow-y: auto;
    height: 20rem;
}

.jinn-tap-aside .occurrences {
    margin-top: 1rem;
    overflow-y: auto;
}

.jinn-tap-aside .occurrences [role="group"] {
    float: right;
    width: fit-content;
}

.jinn-tap-aside .occurrences ul {
    height: 20rem;
    overflow-y: auto;
    margin: 0;
    padding: 0;
}

.jinn-tap-aside .occurrences li {
    list-style: none;
}

.jinn-tap-toolbar .toolbar .disabled {
    opacity: 0.5;
    cursor: not-allowed;
    pointer-events: none;
}

.jinn-tap-toolbar .toolbar details i {
    padding-right: 0.5rem;
}

jinn-tap .ProseMirror {
    outline: none;
    height: 100%;
}

/* Collaboration cursor styles */
.collaboration-carets__caret {
    position: relative;
    margin-left: 1px;
    border-left: 1px solid;
    border-right: 1px solid;
    border-radius: 2px;
}

.collaboration-carets__label {
    position: absolute;
    top: -1.5em;
    left: -1px;
    font-size: 12px;
    font-style: normal;
    font-weight: 600;
    line-height: normal;
    user-select: none;
    white-space: nowrap;
    color: white;
    padding: 2px 6px;
    border-radius: 3px;
    pointer-events: none;
    transform: translateX(-50%);
    animation: fadeOut 1.5s forwards;
    animation-delay: 0s;
}

@keyframes fadeOut {
    0% {
        opacity: 1;
    }
    50% {
        opacity: 1;
    }
    100% {
        opacity: 0;
    }
}

.collaboration-carets__caret:hover .collaboration-carets__label {
    animation: none;
    opacity: 1;
}

.jinn-tap.overlay {
    border: 2px dotted var(--jinn-tap-overlay-color, rgb(255, 123, 0));
}
