@font-face {
	font-family: "Creato Display";
	src: url("fonts/CreatoDisplay-Thin.otf") format("opentype");
	font-weight: 100;
	font-style: normal;
}

@font-face {
	font-family: "Creato Display";
	src: url("fonts/CreatoDisplay-ThinItalic.otf") format("opentype");
	font-weight: 100;
	font-style: italic;
}

@font-face {
	font-family: "Creato Display";
	src: url("fonts/CreatoDisplay-Light.otf") format("opentype");
	font-weight: 300;
	font-style: normal;
}

@font-face {
	font-family: "Creato Display";
	src: url("fonts/CreatoDisplay-LightItalic.otf") format("opentype");
	font-weight: 300;
	font-style: italic;
}

@font-face {
	font-family: "Creato Display";
	src: url("fonts/CreatoDisplay-Regular.otf") format("opentype");
	font-weight: 400;
	font-style: normal;
}

@font-face {
	font-family: "Creato Display";
	src: url("fonts/CreatoDisplay-RegularItalic.otf") format("opentype");
	font-weight: 400;
	font-style: italic;
}

@font-face {
	font-family: "Creato Display";
	src: url("fonts/CreatoDisplay-Medium.otf") format("opentype");
	font-weight: 500;
	font-style: normal;
}

@font-face {
	font-family: "Creato Display";
	src: url("fonts/CreatoDisplay-MediumItalic.otf") format("opentype");
	font-weight: 500;
	font-style: italic;
}

@font-face {
	font-family: "Creato Display";
	src: url("fonts/CreatoDisplay-Bold.otf") format("opentype");
	font-weight: 700;
	font-style: normal;
}

@font-face {
	font-family: "Creato Display";
	src: url("fonts/CreatoDisplay-BoldItalic.otf") format("opentype");
	font-weight: 700;
	font-style: italic;
}

@font-face {
	font-family: "Creato Display";
	src: url("fonts/CreatoDisplay-ExtraBold.otf") format("opentype");
	font-weight: 800;
	font-style: normal;
}

@font-face {
	font-family: "Creato Display";
	src: url("fonts/CreatoDisplay-ExtraBoldItalic.otf") format("opentype");
	font-weight: 800;
	font-style: italic;
}

@font-face {
	font-family: "Creato Display";
	src: url("fonts/CreatoDisplay-Black.otf") format("opentype");
	font-weight: 900;
	font-style: normal;
}

@font-face {
	font-family: "Creato Display";
	src: url("fonts/CreatoDisplay-BlackItalic.otf") format("opentype");
	font-weight: 900;
	font-style: italic;
}

:root {
	--primary-color: rgb(5, 0, 83);
	--primary-hover: rgb(10, 0, 120);
	--light-bg: #f4f4f9;
	--border-color: #d1d1e0;
	--text-color: #1f2937;
	--text-light: #6b7280;
	--user-msg-bg: #006443;
	--assistant-msg-bg: #0e6894;
}

* {
	box-sizing: border-box;
	margin: 0;
	padding: 0;
}

html {
	height: 100%;
	height: 100dvh;
}

body {
	font-family: "Creato Display", sans-serif;
	line-height: 1.5;
	color: var(--text-color);
	max-width: 1200px;
	margin: 0 auto;
	padding: 0.5rem;
	height: 100%;
	height: 100dvh;
	overflow: hidden;
	display: flex;
	flex-direction: column;
}

header {
	text-align: center;
	margin-bottom: 0.5rem;
	padding: 0.5rem 1.5rem;
	background-color: var(--primary-color);
	border-radius: 4px;
}

h1 {
	font-size: 1.25rem;
	color: white;
}

header p {
	color: rgba(255, 255, 255, 0.7);
	font-size: 0.85rem;
}

.chat-toolbar {
	display: flex;
	justify-content: flex-end;
	gap: 0.5rem;
	margin-bottom: 0.35rem;
}

#summarize-button {
	padding: 0.4rem 0.85rem;
	background-color: #0e6894;
	color: white;
	border: 2px solid #0e6894;
	border-radius: 4px;
	cursor: pointer;
	font-family: "Creato Display", sans-serif;
	font-size: 0.85rem;
	transition: background-color 0.2s, border-color 0.2s;
}

#summarize-button:hover {
	background-color: #0a5478;
	border-color: #0a5478;
}

#summarize-button:disabled {
	opacity: 0.5;
	cursor: not-allowed;
}

#new-conversation-button {
	padding: 0.4rem 0.85rem;
	background-color: white;
	color: var(--primary-color);
	border: 2px solid var(--primary-color);
	border-radius: 4px;
	cursor: pointer;
	font-family: "Creato Display", sans-serif;
	font-size: 0.85rem;
	transition: background-color 0.2s, color 0.2s;
}

#new-conversation-button:hover {
	background-color: var(--primary-color);
	color: white;
}

#history-button {
	padding: 0.4rem 0.85rem;
	background-color: white;
	color: var(--primary-color);
	border: 2px solid var(--primary-color);
	border-radius: 4px;
	cursor: pointer;
	font-family: "Creato Display", sans-serif;
	font-size: 0.85rem;
	transition: background-color 0.2s, color 0.2s;
}

#history-button:hover {
	background-color: var(--primary-color);
	color: white;
}

.history-panel {
	display: none;
	border: 1px solid var(--border-color);
	border-radius: 8px;
	background-color: white;
	margin-bottom: 0.5rem;
	max-height: 280px;
	overflow-y: auto;
}

.history-panel.visible {
	display: block;
}

.history-empty {
	padding: 1rem;
	color: var(--text-light);
	font-size: 0.9rem;
	text-align: center;
}

.history-item {
	display: flex;
	align-items: center;
	padding: 0.65rem 1rem;
	cursor: pointer;
	border-bottom: 1px solid var(--border-color);
	transition: background-color 0.15s;
}

.history-item:last-child {
	border-bottom: none;
}

.history-item:hover {
	background-color: var(--light-bg);
}

.history-item.active {
	border-left: 3px solid var(--primary-color);
	background-color: var(--light-bg);
}

.history-item-info {
	flex: 1;
	display: flex;
	flex-direction: column;
	gap: 0.15rem;
	overflow: hidden;
}

.history-item-title {
	font-size: 0.9rem;
	color: var(--text-color);
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}

.history-item.active .history-item-title {
	color: var(--primary-color);
	font-weight: 600;
}

.history-item-date {
	font-size: 0.75rem;
	color: var(--text-light);
}

.history-item-delete {
	margin-left: 0.75rem;
	padding: 0.1rem 0.4rem;
	background: none;
	border: none;
	color: var(--text-light);
	font-size: 1.1rem;
	cursor: pointer;
	border-radius: 4px;
	transition: color 0.15s, background-color 0.15s;
	flex-shrink: 0;
}

.history-item-delete:hover {
	color: #c0392b;
	background-color: #fdecea;
}

.chat-container {
	display: flex;
	flex-direction: column;
	flex: 1;
	min-height: 0;
	border: 1px solid var(--border-color);
	border-radius: 8px;
	overflow: hidden;
}

.chat-messages {
	flex: 1;
	overflow-y: auto;
	padding: 0.6rem;
	background-color: var(--light-bg);
}

.message {
	margin-bottom: 0.5rem;
	padding: 0.5rem 0.75rem;
	border-radius: 8px;
	max-width: 80%;
}

.message p,
.message li,
.message h1,
.message h2,
.message h3,
.message div {
	margin: 0 0 0.25rem 0;
	overflow-wrap: anywhere;
	color: white;
}

.message ul,
.message ol {
	padding-left: 1.25rem;
	margin: 0 0 0.25rem 0;
}

.user-message {
	background-color: var(--user-msg-bg);
	align-self: flex-end;
	margin-left: auto;
}

.assistant-message {
	background-color: var(--assistant-msg-bg);
	align-self: flex-start;
}

.message-input {
	display: flex;
	padding: 0.5rem;
	border-top: 1px solid var(--border-color);
	background-color: white;
}

#user-input {
	flex: 1;
	padding: 0.5rem 0.75rem;
	border: 1px solid var(--border-color);
	border-radius: 4px;
	font-family: inherit;
	resize: none;
	min-height: 38px;
	font-size: 0.9rem;
}

#record-button {
	margin-left: 0.5rem;
	padding: 0 0.75rem;
	background-color: white;
	color: var(--primary-color);
	border: 2px solid var(--primary-color);
	border-radius: 4px;
	cursor: pointer;
	font-size: 1.2rem;
	transition: background-color 0.2s, color 0.2s;
}

#record-button:hover {
	background-color: var(--primary-color);
	color: white;
}

#record-button.recording {
	background-color: #c0392b;
	border-color: #c0392b;
	color: white;
	animation: pulse 1s infinite;
}

#record-button:disabled {
	opacity: 0.5;
	cursor: not-allowed;
}

@keyframes pulse {
	0%, 100% { opacity: 1; }
	50% { opacity: 0.5; }
}

#send-button {
	margin-left: 0.5rem;
	padding: 0 1rem;
	background-color: var(--primary-color);
	color: white;
	border: none;
	border-radius: 4px;
	cursor: pointer;
	transition: background-color 0.2s;
	font-family: "Creato Display", sans-serif;
}

#send-button:hover {
	background-color: var(--primary-hover);
}

#send-button:disabled {
	background-color: var(--text-light);
	cursor: not-allowed;
}

.typing-indicator {
	display: none;
	font-style: italic;
	color: var(--text-light);
	padding: 0.4rem 0.75rem;
}

.typing-indicator.visible {
	display: block;
}



@media (max-width: 600px) {
	body {
		padding: 0.5rem;
	}

	header {
		padding: 0.75rem 1rem;
		margin-bottom: 1rem;
	}

	h1 {
		font-size: 1.2rem;
	}

	.chat-toolbar {
		flex-wrap: wrap;
	}

	#summarize-button,
	#new-conversation-button,
	#history-button {
		flex: 1 1 auto;
		font-size: 0.78rem;
		padding: 0.35rem 0.5rem;
	}


	.message {
		max-width: 95%;
	}

	.message-input {
		padding: 0.5rem;
	}

	#user-input {
		font-size: 0.95rem;
	}

	footer {
		font-size: 0.75rem;
		margin-top: 0.5rem;
	}
}
