/* <Toolbar /> — lm-toolbar-* convention, v5 visual parity; the picker
   dropdown chrome comes from the composed Contextmenu
   (contextmenu/style.css + modal/style.css) */
.lm-toolbar {
    display: flex;
    margin: 0;
    background: #f9f9f9;
    width: 100%;
    position: fixed;
    bottom: 0;
    left: 0;
    box-shadow: 0 -1px 2px rgba(0, 0, 0, 0.1);
    border-radius: 0;
    z-index: 1;
    justify-content: space-evenly;
    align-items: center;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
    padding: 8px 0 8px 0;
    text-align: center;
    box-sizing: border-box;
}

.lm-toolbar[data-visible="false"] {
    display: none;
}

/* v5 set the per-item attribute but shipped no rule for it */
.lm-toolbar-item[data-visible="false"],
.lm-toolbar-picker[data-visible="false"] {
    display: none;
}

.lm-toolbar-item[data-disabled="true"],
.lm-toolbar-picker[data-disabled="true"] {
    opacity: 0.5;
    pointer-events: none;
}

/* Fixed bottom bar (no data-position — the default): every item takes an
   EQUAL track (content-sized items made the space-evenly gaps depend on
   the label widths — nothing lined up). Scoped off the left rail, whose
   full-height column would stretch flex:1 items vertically. */
.lm-toolbar:not([data-position]) .lm-toolbar-item {
    flex: 1 1 0;
    min-width: 0;
    display: flex;
    justify-content: center;
}

.lm-toolbar-item a {
    text-decoration: none;
    color: var(--lm-secondary-color, #303030);
    display: flex;
    flex-direction: column;
    align-items: center;
    flex: 1;
    min-width: 0;
    font-size: 0.9em;
    cursor: pointer;
}

/* labels never widen their track — clip, keep the icon on the grid */
.lm-toolbar-item a span {
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.lm-toolbar img {
    width: 30px;
}

.lm-toolbar img[src=""] {
    display: none;
}

/* Dividers: v5 only styled them inside the static bar — base rule added */
.lm-toolbar-divisor {
    width: 1px;
    height: 24px;
    background-color: #ccc;
    margin: 0 5px;
}

/* Color items: the icon carries a swatch underline showing the current
   value; activation opens the Color block panel in a fixed popover
   anchored under the item (load @lemonadejs/color/style.css) */
.lm-toolbar-color {
    position: relative;
}

.lm-toolbar-color .lm-toolbar-swatch {
    display: block;
    width: 18px;
    height: 3px;
    margin: -2px auto 2px;
    border-radius: 2px;
    border: 1px solid var(--lm-border-color-light, #e8e8e8);
}

.lm-toolbar-color-pop {
    position: fixed;
    z-index: 40;
    background: var(--lm-background-color, #fff);
    border: 1px solid var(--lm-border-color, #d8d8d8);
    border-radius: var(--lm-radius, 6px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.12);
    padding: 4px;
}

/* Pickers: v5 shipped no styles for them at all */
.lm-toolbar-picker-header {
    cursor: pointer;
    padding: 5px 10px;
    border-radius: var(--lm-radius, 6px);
    font-size: 0.9em;
    white-space: nowrap;
    color: var(--lm-secondary-color, #303030);
    /* fixed-width headers (item.width) clip long labels cleanly */
    box-sizing: border-box;
    overflow: hidden;
    text-overflow: ellipsis;
    text-align: left;
}

.lm-toolbar-picker-header:hover,
.lm-toolbar-picker-header:focus {
    background-color: var(--lm-background-color-highlight, #ebebeb);
}

.lm-toolbar-picker-label {
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* invisible zero-height stack of ALL the option titles: the header takes
   the width of the longest one, so a label change never moves the bar */
.lm-toolbar-picker-sizer {
    display: block;
    height: 0;
    overflow: hidden;
    visibility: hidden;
}

.lm-toolbar-picker-sizer span {
    display: block;
}

.lm-toolbar[data-position="static"] {
    position: unset;
    justify-content: flex-start;
    padding: 2px;
}

.lm-toolbar[data-position="static"] .lm-toolbar-item {
    padding: 5px;
}

.lm-toolbar[data-position="static"] .lm-toolbar-item[data-selected="true"] {
    background-color: var(--lm-background-color-highlight, #ebebeb);
    border-radius: var(--lm-radius, 6px);
}

.lm-toolbar[data-position="static"] .lm-toolbar-item i {
    font-size: 18px;
    width: 24px;
    height: 24px;
    line-height: 24px;
    transform: rotate(0.03deg);
}

.lm-toolbar[data-position="static"] .lm-toolbar-divisor {
    width: 1px;
    height: 24px;
    background-color: #ccc;
    margin: 0 5px;
}

.lm-toolbar[data-position="left"] {
    top: 0;
    width: 60px;
    height: 100%;
    flex-direction: column;
    justify-content: start;
    padding: 8px 0 8px 0;
    position: unset;
}

.lm-toolbar[data-position="left"] .lm-toolbar-divisor {
    width: 24px;
    height: 1px;
    margin: 5px 0;
}

.lm-toolbar[data-position="left"] .lm-toolbar-item img {
    margin-bottom: 30px;
}

.lm-toolbar[data-position="left"] .lm-toolbar-item {
    display: block;
    margin: 5px;
}

.lm-toolbar[data-position="left"] .lm-toolbar-item a {
    display: block;
    /* rail labels ride under a 24px icon — 0.9em read oversized there */
    font-size: 11px;
}

.lm-toolbar[data-position="left"] .lm-toolbar-item i {
    width: 24px;
    background-color: var(--lm-background-color, #fff);
    padding: 8px;
    border-radius: 30px;
}

.lm-toolbar[data-position="left"] .lm-toolbar-item i:empty {
    display: none;
}

.lm-toolbar[data-position="left"] .lm-toolbar-item[data-selected="true"] i {
    background-color: var(--lm-secondary-color, #303030);
    color: #fff;
}

.lm-toolbar[data-position="left"] .lm-toolbar-item[data-gap="true"] {
    flex: 1;
}
