body > header {
	min-height: 5em;
}
#chat-header a {
    position: absolute;	
}
#chat-header h1 {
    margin: auto;	
}
#chat-header img {
    transform: translateY(6px);	
}
#chat-header div {
    display: flex;
    grid-gap: 1em;
    color: #d10000;
}
#paper-countdown {
    font-weight: bold;	
}
#chat-header p {
    max-width: 18em;	
}
#chat {
    display: flex;
    height: calc(100% - 81px);	
}
#conversations {
    display: flex;
    flex-direction: column;
    background: white;
    width: 32%;
    min-width: 32%;
    margin-right: 0.5em;
    border-top: 1px solid #e0e0e0;
    border-right: 1px solid #e0e0e0;
    overflow-y: hidden;
}
#conversations > header {
    background: #1b0860;	
} 
#conversations > header > h2 {
    color: #f1f1f1;
    text-align: center;
}
#conversations > fieldset {
	padding: 0;
	margin: 0;
	border: none;
	display: contents;
}

#new-conversation-button {
	border: none;
	background: none;
	font-size: unset;
	color: #1b0860;
	text-decoration: underline;
	padding: 0;
	margin: 0.75em;
	cursor: pointer;
}

#conversations > fieldset > ol {
    padding: 0;
    margin: 0;
    list-style-type: none;
    overflow-y: auto;
}
.conversation {
    display: flex;
    border-bottom: 1px solid #e0e0e0;
    margin: 0;
    font-size: 18px;
    padding: 0;
}

.conversation input:checked + label {
	outline: 3px solid #1b0860;
	outline-offset: -3px;
}
.conversation label {
    flex-direction: column;
    overflow: hidden;
    position: relative;
    grid-gap: 0.5em;	
    padding: 1em 1em 1.25em 2em;
    cursor: pointer;
    width: 100%;
    transition-duration: 0.7ms;
    transition-property: "background";
}
.conversation label:hover {
    background: #eee;
}


.conversation label > span {
    overflow: hidden;
    text-overflow: ellipsis;	
    white-space: nowrap;
}

.conversation label > span:first-child {
	font-size: 16px;
	opacity: 0.7;
}

.conversation label > span:nth-child(2) > span:first-child {
    font-weight: bold;	
}
.conversation button {
    position: absolute; 	
    right: 0.75em;
    top: 1em;
    border: none;
    background: none;
    cursor: pointer;
    background-image: url('/librsc/img/star-filled-navy.png');
    height: 20px;
    width: 20px;
    background-size: contain;
    display: none;	
}
#conversations > p {
    margin: 1em 1.75em;
    text-align: center;
    font-style: italic;
    line-height: 1.75;	
} 
#chat main {
    display: flex;
    flex-direction: column;
    position: relative;
    flex-grow: 1;
    border-left: 1px solid #e0e0e0;
    border-top: 1px solid #e0e0e0; 
    position: relative;
    max-width: 100%;
    overflow-x: hidden;
}
#chat main > * {
	transition: opacity 0.2s;
}
#changing-screen {
	position: absolute;
	top: 0;
	right: 0;
	bottom: 0;
	left: 0;
	background: black;
	opacity: 0;
	transition: opacity 0.1s, transform 0.1s;
}
#chat main:not(.changing) #changing-screen {
	opacity: 0;
	z-index: -1;
}
#chat main.changing > *:not(#changing-screen) {
	opacity: 0;
}

.has-starred #starred-nav {
	display: flex;
}

/*.chat-message sup a.citation:before {
    content: "[";
}

.chat-message sup a.citation:after {
    content: "]";
}*/

.chat-message sup a.citation {
    /* font-weight: bold; */
    background-color: #0002;
    color: black;
    font-size: 0.9em;
    padding-left: 2px;
    padding-right: 2px;
    border-radius: 5px;
}

.chat-message sup a.citation:visited {
    color: purple;
}
#chat-thread {
    display: flex;
    flex-direction: column;
    flex-grow: 1;
    overflow-y: scroll;
}
#scroll-buddy {
	display: flex;
	height: 4em;
	min-height: 4em;
}

#research_mode_label { 
    font-size: 0.8em;
    align-self: center;
    width: 5em;
    text-align: center;
}

#prompt-entry {
    display: flex;
    width: 100%;
    justify-content: flex-end;
    padding: 0 3em 0 0.5em;
    background: #e0e0e0;
    border-top: 5px solid #d5b900;
}
#prompt-entry fieldset {
    display: flex;
    width: 100%;
    margin: 0;
    padding: 0;
    border: none;	
}	
#chat textarea {
    flex-grow: 1;
    resize: none;
    border-radius: 0;	
}
#chat input[type=submit] {
    background: #1b0860;
    color: white;
    border: none;
    padding: 1em 1.75em;
    font-weight: bold;	
}

#starred-nav {
	display: none;
	max-width: 100%;
	overflow: hidden;
	min-height: 3.5em;
	border-bottom: 2px solid #f1f1f1;
}

#starred-nav > ol {
	margin: 0;
	padding: 0;
	background: #1b0860; 
	color: white;
	list-style-type: none;
	display: flex;
	flex-direction: column;
	width: 100%;
	overflow: hidden;
	position: relative;
}

#starred-nav li {
	margin: 0;
	overflow: hidden;
	white-space: nowrap;
	text-overflow: ellipsis;
	max-width: 100%;
	overflow: hidden;
	display: flex;
	padding: 0.75em 3em 0.75em 1em;
	grid-gap: 1em;
	align-items: center;
	transition: transform 0.3s;
	position: absolute;
	height: 100%;
}

#starred-nav li:not(.active-pin) {
	transform: translateY(-100%);	
}

#starred-nav button {
	border: none;
	background: none;
	color: white;
	text-decoration: underline;
	cursor: pointer;
	font-size: unset;
	overflow: hidden;
	white-space: nowrap;
	text-overflow: ellipsis;
	max-width: 100%;
}

#starred-nav button:not(:first-of-type) {
	flex-shrink: 0;
}

#chat-thread > ol {
    list-style-type: none;
    display: flex;
    flex-direction: column;
    padding: 0;
    margin: 0;
    align-items: flex-start;
    grid-gap: 2em;
    padding: 0.5em 2em  0.5em 0.5em;
    flex-grow: 1;
}
#chat .chat-message {
    padding: 0.75em 2em;
    background: white;
    margin: 0;
    max-width: 83.33%;	
}
#chat .chat-message.from-me {
    background: #1b0860;
    color: white;
    align-self: flex-end;	
}
.chat-message > span > br:first-child, 
.chat-message > span > br:nth-child(2) {
	display: none;
}
.saved-chat-window {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: #f1f1f1;
    display: flex;
    flex-direction: column;	
}
#chat main .saved-chat-window ol {
    padding-top: 1em;	
}
.saved-chat-window button {
    bottom: 0;
    left: 0;
    right: 0;
    background: white;
    border: none;
    text-align: center;
    padding: 1em 0;
    font-size: 1.125em;
    color: #1b0860;
    font-weight: bold;
    font-variant: small-caps;
    cursor: pointer;
    border-top: 5px solid #d5b900;	
}
.chat-message {
    position: relative;
    border-radius: 3px;
    font-size: 18px;	
}
.chat-message.waiting:not(.from-me) {
    width: 100%;	
}
.chat-message .buttons {
    position: absolute;
    right: -3.5em;
    bottom: 0;
    display: flex;
    flex-direction: column;
    grid-gap: 0.25em;
}
.chat-message button {
    border: none;
    background: none;
    cursor: pointer;
    height: 32px;
    width: 32px;
    background-size: contain;	
}
.chat-message.from-me .buttons {
    right: unset;
    left: -3.5em;
    display: none;
}

.chat-message .star-button {
    background-image: url('/librsc/img/star-outline-navy.png');
}

.chat-message .thought-button {
    background-image: url('/librsc/img/brain.png');	
}

.chat-message.starred .star-button, 
.chat-message.from-me.starred + li .star-button {
    background-image: url('/librsc/img/star-filled-navy.png');
}
.chat-message.waiting .star-button,
.chat-message.from-me .thought-button {
    display: none;	
}
.timer {
    background: linear-gradient(to right, #d10000 50%, white 50%);
    border-radius: 100%;
    position: relative;
    animation-name: timer;
    animation-duration: var(--timer-duration, 120s);
    animation-timing-function: steps(240, start);
    mask: radial-gradient(transparent 50%,#000 50%);
    display: flex;
    height: 48px;
    width: 48px;
    margin: 0.5em auto;
}
.timer::before {
    content: "";
    height: 100%;
    left: 0;
    position: absolute;
    top: 0;
    width: 49%;
    animation-name: mask;
    animation-duration: var(--timer-duration, 120s);
    animation-timing-function: steps(120, start);
    animation-fill-mode: forwards;
    transform-origin: 100% 50%;
}
:root {
    --timer-duration: 120s;
}
.chat-message:not(.from-me) + .chat-message:not(.from-me) {
    margin-top: -1em !important;	
}
.thought-node {
    border: 1px solid #d5b900;
    padding: 0.75em;
    margin: 0.75em 0;
    margin-bottom: 1.5em;
    display: flex;
    flex-direction: column;
    background: #d5b90024;
    grid-gap: 0.5em;
    max-height: 40em;
}
.thought-title {
    display: flex;
    align-items: center;
    grid-gap: 0.25em;
    text-decoration: underline;	
    cursor: pointer;
}

.thought-body {
    overflow-y: auto;	
}
.chat-message:not(.waiting,.show-thoughts) .thought-body {
    display: none;
}
.waiting .brain {
	animation: think 3s infinite linear;
}
.response-placeholder, .meta-thought {
	opacity: 0.7;
	font-style: italic;
}
.subthought-node {
	background: hsla(0,0%,0%,0.7);
	color: hsl(52,100%,90%);
	height: 1.25em;
	width: 0.75em;
	display: inline-block;
	margin: 0 0.125em;
	cursor: pointer;
}
.subthought-node:not(.open) * {
	display: none;
}

.subthought-node.open {
	display: flex;
	width: unset;
	height: unset;
	margin: 0.5em 0;
	padding: 0.75em;
	font-size: 16px !important;
	min-height: 4em;
}
.subthought-node.waiting {
	animation: blink 1s infinite;
}
.blink:not(.open) {
	animation: flash 0.1s;
}

a.citation {
    /* font-weight: bold; */
    background-color: #0004;
    color: black;
    font-size: 0.9em;
    border-radius: 5px;
}

a.citation:visited {
    color: purple;
}

@keyframes blink {
	0% {
		opacity: 1;	
	} 5% {
		opacity: 0.5;	
	} 10% {
		opacity: 1;	
	}	100% {
		opacity: 1;	
	}
}
@keyframes flash {
	0% {
		opacity: 1;	
	} 50% {
		opacity: 0.5;	
	}	100% {
		opacity: 1;	
	}
}
@keyframes think {
	0% {	
		opacity: 1;
	}
	50% {
		opacity: 0.5;	
	}
	100% {
		opacity: 1;	
	}
}
@keyframes timer {
    0% {
        transform: rotate(0deg);
    }
    100% {
        transform: rotate(360deg);
    }
}
@keyframes mask {
    0% {
        background: white;
        transform: rotate(0deg);
    }
    50% {
	        background: white;
        transform: rotate(-180deg);
    }
    50.01% {
        background: #d10000;
        transform: rotate(0deg);
    }
    100% {
        background: #d10000;
        transform: rotate(-180deg);
    }
}