/* Top bar of the Figma-style workspace: brand | breadcrumb | Canvas-Preview switch, You + photo, theme switch, Contact.
   The divider after the brand lines up with the Layers panel edge below it. */

.dba-topbar {
	position: sticky;
	top: var(--dba-adminbar);
	z-index: var(--dba-z-header);
	display: flex;
	align-items: center;
	height: var(--dba-bar-h);
	background: var(--dba-surface);
	border-bottom: 1px solid var(--dba-line);
}

.dba-topbar__brand {
	display: flex;
	align-items: center;
	flex: none;
	width: var(--dba-panel-w);
	height: 100%;
	padding-inline: 1.125rem;
	border-right: 1px solid var(--dba-line);
}

.dba-topbar__home {
	display: flex;
	align-items: center;
	gap: 0.75rem;
	font-weight: 600;
	font-size: 1.0625rem;
	letter-spacing: -0.01em;
	text-decoration: none;
	white-space: nowrap;
}

.dba-topbar__home:hover {
	color: inherit;
}

.dba-crumbs {
	display: flex;
	align-items: center;
	gap: 0.5rem;
	padding-left: 1.5rem;
	font-size: 0.9375rem;
	white-space: nowrap;
}

.dba-crumbs__root {
	color: var(--dba-muted);
	text-decoration: none;
}

.dba-crumbs__root:hover {
	color: var(--dba-ink);
}

.dba-crumbs__sep {
	width: 0.9rem;
	height: 0.9rem;
	color: var(--dba-muted);
}

.dba-crumbs__current {
	font-weight: 600;
}

.dba-topbar__tools {
	display: flex;
	align-items: center;
	gap: 0.875rem;
	margin-left: auto;
	padding-right: 1.25rem;
}

.dba-modes {
	display: inline-flex;
	padding: 0.1875rem;
	background: var(--dba-canvas);
	border: 1px solid var(--dba-line);
	border-radius: 0.625rem;
}

.dba-modes button {
	padding: 0.4rem 1rem;
	border: 0;
	border-radius: 0.45rem;
	background: transparent;
	color: var(--dba-muted);
	font-size: 0.9375rem;
	line-height: 1.2;
	cursor: pointer;
}

.dba-modes button[aria-pressed="true"] {
	background: var(--dba-surface);
	color: var(--dba-ink);
	font-weight: 600;
	box-shadow: var(--dba-shadow-s);
}

.dba-modes button:not([aria-pressed="true"]):hover {
	color: var(--dba-ink);
}

/* You + my photo (overlapping circles, like people in a Figma file) */
.dba-people {
	display: flex;
	align-items: center;
}

.dba-people__you,
.dba-people__me {
	display: grid;
	place-items: center;
	width: 2.25rem;
	height: 2.25rem;
	overflow: hidden;
	border: 2px solid var(--dba-surface);
	border-radius: 50%;
	font-size: 0.75rem;
	font-weight: 600;
	line-height: 1;
}

.dba-people__you {
	font-size: 0.6875rem;
	position: relative;
	z-index: 0;
	margin-right: -0.3125rem;
	background: var(--dba-accent);
	color: var(--dba-accent-ink);
}

.dba-people__me {
	position: relative;
	z-index: 1;
	background: var(--dba-accent-soft);
	color: var(--dba-accent);
}

.dba-people__me img {
	display: block;
	width: 100%;
	height: 100%;
	object-fit: cover;
	object-position: center;
}

/* Light / dark switch */
.dba-iconbtn {
	display: grid;
	place-items: center;
	width: 2.25rem;
	height: 2.25rem;
	padding: 0;
	border: 0;
	border-radius: var(--dba-radius-s);
	background: transparent;
	color: var(--dba-ink);
	cursor: pointer;
	transition: background-color var(--dba-dur-s) var(--dba-ease);
}

.dba-iconbtn:hover {
	background: var(--dba-canvas);
}

.dba-iconbtn .dba-icon {
	width: 1.25rem;
	height: 1.25rem;
}

.dba-iconbtn__sun,
:root[data-theme="dark"] .dba-iconbtn__moon {
	display: none;
}

:root[data-theme="dark"] .dba-iconbtn__sun {
	display: block;
}

/* Contact button */
.dba-topbar__contact {
	justify-content: center;
	padding: 0.6rem 1.15rem;
	font-size: 0.9375rem;
}

/* Hover help for the icon buttons in the top bar and the left panel: what it does, and its keyboard shortcut.
   (The cursor tag is switched off over the top bar and the panel, so this is the only hint there.) */
.dba-iconbtn[data-tip] {
	position: relative;
}

.dba-iconbtn[data-tip]::after,
.dba-layers-open[data-tip]::after {
	content: attr(data-tip);
	position: absolute;
	top: calc(100% + 0.5rem);
	left: 50%;
	z-index: 80;
	padding: 0.32rem 0.55rem;
	border-radius: 0.3rem;
	background: var(--dba-ink);
	color: var(--dba-surface);
	font-size: 0.6875rem;
	font-weight: 500;
	line-height: 1.2;
	white-space: nowrap;
	opacity: 0;
	transform: translate(-50%, -3px);
	pointer-events: none;
	transition: opacity 0.15s, transform 0.2s;
}

/* Buttons near an edge: the help opens toward the inside */
.dba-iconbtn[data-tip-pos="end"]::after {
	right: 0;
	left: auto;
	transform: translateY(-3px);
}

.dba-iconbtn[data-tip]:hover::after,
.dba-iconbtn[data-tip]:focus-visible::after,
.dba-layers-open[data-tip]:hover::after,
.dba-layers-open[data-tip]:focus-visible::after {
	opacity: 1;
	transform: translate(-50%, 0);
	transition-delay: 0.3s;
}

.dba-iconbtn[data-tip-pos="end"]:hover::after,
.dba-iconbtn[data-tip-pos="end"]:focus-visible::after {
	transform: translateY(0);
}

@media (prefers-reduced-motion: reduce) {
	.dba-iconbtn[data-tip]::after,
	.dba-layers-open[data-tip]::after {
		transition: none;
	}
}

/* Brand logo in the top bar: the dark logo in the light theme, the white one in the dark theme */
.dba-brandlogo {
	display: block;
	width: auto;
	height: 1.75rem;
}

.dba-brandlogo--dark,
:root[data-theme="dark"] .dba-brandlogo--light {
	display: none;
}

:root[data-theme="dark"] .dba-brandlogo--dark {
	display: block;
}
