#navbar {
	/* make room for the window controls */
	padding-left: 75px;
	display: flex;
	height: 2.3333em;
	align-items: center;
	transition: 0.2s background-color;
	max-width: 100vw;
	-webkit-user-select: none;
	position: relative;
	outline: none;
	-webkit-app-region: drag;
	z-index: 2;
}

/* there are no window controls in fullscreen, so we don't need any padding */

body.fullscreen #navbar,
body.notMac #navbar {
	padding-left: 0;
}

/* when the tab-group is white, we need a line to separate it from the webviews */

#navbar:before {
	content: "";
	width: 100vw;
	height: 1px;
	position: absolute;
	bottom: 0;
	left: 0;
	background: rgba(0, 0, 0, 0.075);
	transition: 0.2s;
}

/* dark colors don't need to be darkened as much for contrast */

.dark-theme #navbar:before {
	background: rgba(0, 0, 0, 0.04);
}
.dark-theme.is-edit-mode #navbar:before {
	background: none;
}

/* tab layout */

#navbar #tabs {
	display: flex;
	flex: 1;
	/* https://github.com/w3c/csswg-drafts/issues/92 - don't make the scrollbar height affect the layout */
	overflow: overlay;
}
.tab-item {
	flex: 1;
	min-width: 125px;
	transition: .15s min-width, 0.2s transform;
	padding: 0 1em;
	font-size: 0.8em;
	line-height: 36px;
	height: 36px;
	overflow: hidden;
	word-break: break-all;
}
.tab-item:not(.active):hover {
	background-color: rgba(255, 255, 255, 0.1);
}

/* icons */

.tab-item .tab-icon-area {
	float: right;
}
.tab-item i {
	font-size: 0.8em;
	padding: 0 0.66em;
	vertical-align: middle;
	width: 1em;
	box-sizing: content-box;
}
.tab-item.active:not(:only-child) {
	background: rgba(0, 0, 0, 0.05);
}
.dark-theme .tab-item.active:not(:only-child) {
	background: rgba(255, 255, 255, 0.2);
}
.tab-item.selected {
	min-width: 100%;
	/* remove the white transparent-ness */
	background: none;
	padding-left: 9px;
}
.tab-item.fade {
	opacity: 0.5;
}

/* style tab scrollbar */

#navbar #tabs::-webkit-scrollbar {
	height: 0.2em;
}
#navbar #tabs::-webkit-scrollbar-track {
	background-color: rgba(0, 0, 0, 0.1);
}
#navbar #tabs::-webkit-scrollbar-thumb {
	background-color: rgba(0, 0, 0, 0.3);
}
.dark-theme #navbar #tabs::-webkit-scrollbar-track {
	background-color: rgba(255, 255, 255, 0.3);
}
.dark-theme #navbar #tabs::-webkit-scrollbar-thumb {
	background-color: rgba(255, 255, 255, 0.8);
}

/* when an input is selected, hide other tabs */

.is-edit-mode .tab-item:not(.selected) {
	min-width: 0;
	max-width: 0;
	width: 0;
	height: 0;
	padding: 0;
	overflow: hidden;
}

/* the background isn't necessary when there is only one tab */

.is-edit-mode .tab-item {
	background: none !important;
}

/* show either the view or edit contents */

.tab-item .tab-edit-contents {
	display: none;
}
.tab-item.selected .tab-edit-contents {
	display: flex;
	height: 100%;
	align-items: center;
}
.tab-item.selected .tab-view-contents {
	display: none;
}

/* tab inputs */

.tab-item .tab-input {
	line-height: 1.15em;
	font-size: 1.15em;
	-webkit-appearance: none;
	background: none;
	border: none;
	color: inherit;
	flex: 1;
	height: 1.5em;
	outline: none;
	-webkit-user-select: auto;
	-webkit-app-region: no-drag;
}
.tab-item .tab-input::-webkit-input-placeholder {
	color: inherit;
	opacity: 0.5;
	line-height: 1.25em;
}

/* show the overlay in edit mode */

#overlay {
	display: none;
}

body.is-edit-mode #overlay {
	display: block;
	position: fixed;
	top: 0;
	left: 0;
	width: 100vw;
	height: 100vh;
	background: rgba(255, 255, 255, 0.5);
	z-index: 1;
	pointer-events: none;
}
body.dark-mode #overlay {
	background: rgba(0, 0, 0, 0.4);
}
/* hide the lock icon unless its the current tab */

.tab-item:not(.active) .icon-tab-not-secure {
	display: none;
}
.tab-item .tab-view-contents .title {
	font-size: 15px;
}

/* buttons */

.navbar-action-button {
	padding: 1em;
}
.navbar-action-button + .navbar-action-button {
	padding-left: 0.5em;
}

/* reader button */

.tab-item .reader-button {
	display: none;
	padding-left: 0;
}
.tab-item.active .reader-button.can-reader {
	display: inline-block;
}
.tab-item.active .reader-button.is-reader {
	display: inline-block;
}

/* when the tab is hovered, hide info buttons and show the close button */

.tab-item.jshover .tab-info-icon {
	display: none;
}
.tab-item .tab-close-button {
	display: none;
}
.tab-item.jshover .tab-close-button {
	display: inline-block;
}

/* hide other tabs in focus mode */

body.is-focus-mode .tab-item:not(.active) {
	display: none;
}
body.is-focus-mode .navbar-action-button {
	display: none;
}

/* since only one tab is shown in focus mode, the highlight isn't needed */

body.is-focus-mode .tab-item {
	background: none !important;
}
