body {
	margin: 0;
	font-family: 'Segoe UI', 'Tahoma', 'Geneva', 'Verdana', 'sans-serif';
	background: var(--color-background);
	color: var(--color-text);
	display: flex;
	justify-content: center;
	text-align: center;
	flex-direction: column;
	width: 100dvw;
	height: 100dvh;
}

.container {
	width: 100%;
	min-width: 280px;
	max-height: 100%;
	flex: 1;
	display: flex;
	min-height: 0;
	margin-left: auto;
	margin-right: auto;
	margin-bottom: auto;
}

.card {
	width: 80%;
	background: var(--color-card);
	padding: 10px;
	box-shadow: 0 8px 20px rgba(0, 0, 0, 0.12);
	display: flex;
	flex-direction: column;
	gap: 5px;
	overflow: hidden;
	min-height: 0;
	flex: 1;
}

#chat-window {
	background: var(--color-items);
	border: 1px solid var(--color-border);
	padding: 12px;
	font-size: 1rem;
	text-align: left;
	flex: 1;
	overflow-y: auto;
	min-height: 0;
	color: var(--color-text);
	overscroll-behavior: contain;
}

#message-box{
    display: flex;
	align-items: stretch;
	border-top: 1px solid var(--color-border);
	background: transparent;
}

#message-box textarea {
	resize: vertical;
	border: 1px solid var(--color-border);
	background: var(--color-items);
	color: var(--color-text);
	margin: 0px;
	margin-left:3px;
    width:100%;
	height:1.5rem;
	min-height: 1.5em;
	max-height: 200px;
	box-sizing: border-box;
	font-family: inherit;
	font-size: 14px;
	line-height: 1.4em;
	margin-right:4px;
	resize:none;
}

.sidebar {
	width: 20%;
	max-width: 250px;
	background: var(--color-card);
	margin-right: 5px;
	margin-left:5px;
	box-shadow: 0 8px 20px rgba(0, 0, 0, 0.12);
}

.btn {
	padding: 3px;
    margin: 3px;
	border: 1px solid var(--color-border);
	cursor: pointer;
	font-weight: 600;
	background: var(--color-button);
	transition: transform .12s ease, opacity .12s ease, background .12s ease;
	color: var(--color-text);
	font-size:medium;
}

.left:hover {
	transform: translateX(3px);
	background: var(--color-button-h);
	opacity: 0.98;
}

.right:hover {
	transform: translateX(-3px);
	background: var(--color-button-h);
	opacity: 0.98;
}

.up:hover {
	transform: translateY(-3px);
	background: var(--color-button-h);
	opacity: 0.98;
}

#main-image{
    width: 100%;
    height:auto;
    cursor:pointer;
}

.sidebar-item{
    display:flex;
    margin:2px;
}

#chat-header{
    text-align: left; 
    display: flex;
}

#chat-footer{
	display:flex;
	flex-direction: column;
}

#upload-indicator{
	height:1.5rem; 
	background: var(--color-button-h);
	background-repeat: no-repeat;
	color:var(--color-text);
	text-align: left;
	border: 1px solid var(--color-border);
	margin-left: 3px;
	display:none;
}

#sidebar-button{
    text-align: left; 
    width:30px;
}

#chat-header-search{
    margin-left:auto;
}

#search-button{
    background:none;
    border:none;
}

#send-button{
    height:100%;
	margin:0px;
	padding:0px;
}

#profile-picture-input-label{
    width:100%;
}

#sidebar-button:hover, #search-button:hover{
	cursor:pointer;
}

#search-bar{
	background: var(--color-button);
	border: 1px solid var(--color-border);
	color: var(--color-text);
}

#files-input-label{
	width:25px;
}

#add-channel-item, #delete-channel-item, #invite-code-item, #theme-toggle-item, #notification-item{
    display:flex;
    flex-direction: column;
}

h3 {
	color: var(--color-text);
	margin-top: 0px;
	margin-bottom: 0px;
}

h2 {
	color: var(--color-text);
	margin-top: 0px;
	margin-bottom: 0px;
}

.subitem{
	display:flex;
	margin:3px;
}

#channel-name, #delete-channel-name, #invite-code{
	width:100%; 
	margin-right:5px;
}

.sidebar-items{
	margin:3px;
	background: var(--color-items);
	border: 1px solid var(--color-border);
}

.vc-user-icon{
	width:40px;
	height:40px; 
	margin-right: 2px;
}

.post-user-icon{
	width:1rem;
	height:1rem; 
	margin-right: 2px;
}

.volume-slider{
	-webkit-appearance: none;
	appearance: none;
	width: 100%;
	height: 10px;
	background: var(--color-button);
	outline: none;
	opacity: 0.7; 
	-webkit-transition: .2s;
	transition: opacity .2s;
	margin-top:auto;
	margin-bottom: auto;
	border-radius: 0px;
	margin: 0px;
}

.volume-slider:hover {
 	opacity: 1;
}

.volume-slider::-webkit-slider-thumb {
	-webkit-appearance: none;
	appearance: none;
	width: 15px;
	height: 15px;
	background: var(--color-button-h);
	cursor: pointer;
	border-radius: 0px;
}

.volume-slider::-moz-range-thumb {
	width: 15px;
	height: 15px;
	background: var(--color-button-h);
	cursor: pointer;
	border-radius: 0px;
}

.channel-join-button{
	margin-left: auto; 
	padding: 8px;
}

.channel-users{
	background: var(--color-card)
}

.vc-user, .vc-user-info{
	text-align: left;
	width:100%;
}

.vc-user-username, .vc-user-info{
	margin-top:auto;
	margin-bottom:auto;
}

.channel-name{
	margin-top: auto; 
	margin-bottom: auto;
}

.channel-main, .vc-user{
	border-bottom: 1px solid var(--color-border);
}

.user{
	display:block;
	border-bottom: 1px solid var(--color-border);
}

.user-icon{
	width:25px;
	height:25px; 
	margin-top:auto;
	margin-bottom:auto;
	margin-right:10px;
}

.chat-post {
	background-color: var(--color-card);
	margin-bottom: 5px;
	padding: 10px;
	border-radius: 5px;
	width: fit-content;
	max-width:90vw
}

.post-username{
	display:flex;
	border-bottom:1px solid var(--color-border);
	min-width:200px;
}

.post-date{
	margin-left:auto;
}

@media (max-width: 700px) {
	.container {
		width: 100%;
		padding-right: 0px;
		padding-left: 0px;
		padding-top:0px;
		max-height: 100%;
		flex-direction: column;
	}

	.message-box textarea {
		min-height: 64px;
	}

	.sidebar {
		display: none;
		width: 100%;
		max-width: 100%;
	}

	.card {
		width: 100%;
		padding:0px;
		overflow-y:auto;
		min-height: 500px;
		padding-bottom: env(safe-area-inset-bottom);
	}

	.card:focus-within {
		padding-bottom: 0;
	}

	body, html{
		overscroll-behavior: initial;
	}
	#sidebar-r {
		order: -1; /* Move right sidebar to the top */
		width: 100%; /* Full width when stacked */
	}
	.sidebar{
		margin:0px;
	}
	#main-image{
		display:none;
	}
	#settings-content, #channels, #user-list{
		display:none;
	}
	.sidebar-items{
		margin:0
	}
	.post-date{
		display:none;
	}
	.post-username{
		min-width: 0px;
	}
	.theme-toggle{
		display:none;
	}
}

.sidebar-item-header{
	display:flex;
	justify-content: space-between;
	margin:4px;
}

.sidebar-item-header:hover, .user-info-row:hover, .channel:hover{
	cursor:pointer;
}

.file-input{
	text-align: left;
	justify-content: center;
	align-items: center;
	display:flex
}

img {
	width: 100%;
	max-width: 500px;
	max-height: 500px;
}

.post-content {
	white-space: pre-wrap;
	word-wrap: break-word;
	overflow-wrap: anywhere;
}