#header {
  grid-area: header;
  /* position: fixed;
  top: 0;
  width: 100%; */

  background: transparent;
  display: flex;
  padding: 0 var(--panel-padding);

  gap: 1em;

  align-items: center;
  justify-content: start;

  /* border-right: 1px solid var(--border-main-color); */

  z-index: 99999;
}

#mainlogo {
  transform: translate(0.5em, -2px);
}

.flx {
  display: flex;
  align-items: center;
  height: 100%;
  width: auto;
}

.headericon {
  height: auto;
  width: 8em;
  padding: 0.75em 0;
  color: var(--power-primary-color);
}

@media (prefers-color-scheme: dark) {
  .headericon {
    filter: invert(1);
  }
}

#logozone {
  cursor: pointer;
  /* Safari can't handle width auto here*/
  width: 15ch;
}

#current-name {
  border: 1px solid transparent;
  box-shadow: 0 0 1em rgba(0, 0, 0, 0.3);
  border-radius: var(--inner-border-radius);
  margin-left: 0.5em;
  flex: 0 4 auto;
  width: fit-content;
  min-width: 12ch;
  max-width: min(52ch, 46vw);

  display: flex;
  align-items: center;
  gap: 0;
  padding-right: 0.125em;

  .icon.edit {
    font-size: 0.95em;
    color: #fff;
    opacity: 0.33;
    transition: opacity var(--spd-insp) ease;
  }
  .name-edit-button {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 1.5em;
    aspect-ratio: 1;
    border-radius: var(--inner-border-radius);
    color: #fff;
    cursor: pointer;
    flex: 0 0 1.5em;
  }
  .name-edit-button:hover,
  .name-edit-button:focus-visible {
    background-color: rgba(255, 255, 255, 0.08);
    .icon.edit {
      opacity: 1;
    }
  }
  label {
    margin-bottom: 0;
  }
  #current-name-block {
    flex: 0 1 auto;
    min-width: 0;
    max-width: calc(100% - 1.5em);
  }
  input {
    background: transparent;
    color: #fff;
    font-weight: 600;
    font-size: 0.9em;
    padding-left: 0.5em;
    field-sizing: content;
    min-width: 0;
    width: auto;
    max-width: 100%;

    transition: border-color var(--spd-insp) ease;
  }
  &:has(input:focus) {
    border-color: var(--power-ui01-color);
    .icon.edit {
      opacity: 1;
    }
  }
}

#linked-objects {
  display: flex;
  flex-direction: column;
  gap: 0;
  margin: 0;
}

.linked-object {
  padding: 0.2em 0 0.2em 2em;
  position: relative;
  display: grid;
  align-items: center;
  grid-template-columns: 1fr auto;
}
.linked-object.multiple {
  grid-template-columns: 1fr;
}
.linked-object.multiple::before {
  top: 0.2em;
  transform: translateY(50%);
}
.linked-object.multiple .children {
  margin: 0;
  max-height: 0em;
  opacity: 0;
  pointer-events: none;
  transition:
    opacity var(--spd-insp) ease,
    max-height var(--spd-insp) ease;
}

.linked-object.opened .children {
  margin: 0.25em 0;
  max-height: 90em;
  opacity: 1;
  pointer-events: all;
}

.linked-object-name {
  font-size: 0.8em;
  font-weight: 700;

  max-width: 15ch;
  overflow: hidden;
  text-overflow: ellipsis;
  overflow: hidden;
  white-space: nowrap;

  display: flex;
  align-items: start;
  justify-content: start;
  margin: 0 0.75em 0 0;
  cursor: default;
  color: light-dark(black, white);
}
.linked-object-name.clickable {
  cursor: pointer;
}

.linked-object-name .nb-children {
  display: flex;
  align-items: center;
  justify-content: center;
  aspect-ratio: 1;
  width: 1.5em;

  background-color: var(--c-dark-bg);
  color: var(--text-on-dark);
  border-radius: 50em;
  opacity: 0.66;
  font-size: 0.7em;
  font-weight: 800;
  padding: 0.1em;
}

.empty .linked-object-name {
  font-weight: 400;
  font-style: italic;
  font-family: var(--display-font);
  color: color-mix(in srgb, currentColor 45%, transparent);
}

.linked-object::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 0.3em;
  transform: translateY(-50%);
  width: 0.525em;
  aspect-ratio: 1;
  background-color: light-dark(var(--c-dark-bg), var(--c-bright-bg));

  border-radius: 50em;
}
.linked-object.empty::before {
  opacity: 0.5;
}
.linked-object.linked-product::before,
.linked-object.linked-products::before {
  background-color: #ffc800;
}
.linked-object.linked-viewer::before {
  background-color: var(--power-primary-color);
}

.linked-object:not(:first-of-type)::after {
  content: '';
  position: absolute;
  top: 0px;
  left: 0.6em;
  transform-origin: top center;
  transform: translateX(-100%) translateY(-0.3em);
  width: 1px;
  height: 0.6em;
  background: color-mix(in srgb, currentColor 35%, transparent);
}

.linked-asset.empty::after,
#linked-objects:has(.linked-viewer.empty) .linked-asset::after,
.linked-products.empty::after,
#linked-objects:has(.linked-asset.empty) .linked-products::after {
  background: repeating-linear-gradient(
    0deg,
    color-mix(in srgb, currentColor 50%, transparent) 0px,
    color-mix(in srgb, currentColor 50%, transparent) 0.13em,
    transparent 0.13em,
    transparent 0.26em
  );
}

.linked-object.linked-asset,
.linked-object.linked-viewer {
  cursor: pointer;
}

.linked-object-buttons .icon {
  font-size: 1em;
  color: light-dark(black, white);
}

.linkb {
  color: var(--text-primary);
  display: flex;
  align-items: center;
  opacity: 0.5;
  transition: opacity var(--spd-insp) ease;
}
.linkb:hover {
  opacity: 1;
}
