/* ═══════════════════════════════════════════════════════════════════════════
   COMPOSE — Toolbar v4
   Google Docs philosophy: horizontal row of controls.
   Dropdowns for style/font, icon buttons for formatting, dividers between groups.
   Toolbar lane inside the shared app header on every viewport.
   ═══════════════════════════════════════════════════════════════════════════ */
/* Shared styles */
.toolbar-inner {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  height: 100%;
  min-width: 0;
  padding-inline: var(--header-inline-pad);
  overflow-x: auto;
  overflow-y: visible;
  scrollbar-width: none;
  gap: 0;
  width: 100%;
}
.toolbar-inner::-webkit-scrollbar { display: none; }
#toolbar-row {
  justify-content: center;
}
#toolbar-row::before,
#toolbar-row::after {
  content: '';
  flex: 0 0 var(--header-inline-pad);
}
#toolbar-row .toolbar-inner {
  width: auto;
  flex: 0 1 auto;
  max-width: calc(100% - (var(--header-inline-pad) * 2));
}
/* Scroll fade */
.toolbar-scroll-wrap {
  position: relative;
  flex: 1 1 0;
  overflow-x: hidden;
  overflow-y: visible;
  height: 100%;
  display: flex;
  align-items: center;
}
/* ── Toolbar button ──────────────────────────────────────────────────── */
.tb-btn {}
.tb-style-picker {
  flex: 0 0 auto;
  position: relative;
  z-index: 1;
}
.tb-style-field {
  position: relative;
  display: flex;
  align-items: center;
}
.tb-style-select {
  display: block;
  width: auto;
  min-width: 144px;
  max-width: 184px;
  padding: 0 34px 0 12px;
  border: 1px solid transparent;
  font-size: 12.5px;
  font-weight: 500;
  color: var(--text-sec);
  font-family: var(--font-ui);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  text-align: start;
  appearance: none;
  -webkit-appearance: none;
  background: transparent;
  cursor: pointer;
}
.tb-style-select:focus-visible {
  border-color: var(--border-focus);
}
.tb-style-chevron {
  position: absolute;
  right: 12px;
  width: 14px;
  height: 14px;
  flex-shrink: 0;
  opacity: 0.8;
  pointer-events: none;
}
.tb-style-select option {
  color: var(--text);
}
/* Wide variant for labelled items */
.tb-btn--wide {
  width: auto;
  padding: 0 8px;
  font-size: 12px;
  font-weight: 500;
  gap: 4px;
  color: var(--text-sec);
  font-family: var(--font-ui);
  white-space: nowrap;
  flex-shrink: 0;
}
/* ── Divider between toolbar groups ─────────────────────────────────── */
.tb-divider {
  flex: 0 0 1px;
  height: 16px;
  background: color-mix(in srgb, var(--border) 72%, transparent);
  margin: 0 6px;
  align-self: center;
  flex-shrink: 0;
}
/* ── Context groups ──────────────────────────────────────────────────── */
.tb-group { display: contents; }
.tb-group[hidden] { display: none; }
.tb-context-label {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--accent);
  padding: 0 8px;
  align-self: center;
  white-space: nowrap;
  flex-shrink: 0;
}
/* ── Right-side sticky: sidebar toggle ───────────────────────────────── */
.tb-end {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  padding-left: var(--header-action-gap);
  margin-left: auto;
  flex-shrink: 0;
}
/* ── Tooltips via data-tip (JS-powered rich tooltips) ────────────────── */
[data-tip] { position: relative; }
/* Toolbar tooltips intentionally render without a caret.
   The hover state already provides sufficient feedback, and removing the
   pseudo-element eliminates Safari/iPad header artifacts entirely. */
[data-tip]::after {
  content: none !important;
  display: none !important;
}
/* Rich tooltip bubble injected by JS */
.tb-tooltip {
  position: fixed;
  /* Always dark background regardless of theme — ensures contrast on both */
  background: var(--tooltip-bg);
  color: var(--tooltip-fg);
  font-size: 11.5px;
  font-weight: 500;
  font-family: var(--font-ui);
  padding: 5px 10px;
  border-radius: var(--r-md);
  white-space: nowrap;
  pointer-events: none;
  opacity: 0;
  transition: opacity var(--t-fast) var(--ease);
  z-index: var(--z-tip);
  letter-spacing: -0.01em;
  display: flex;
  align-items: center;
  gap: 8px;
  box-shadow: 0 2px 8px rgba(0,0,0,.25);
}
.tb-tooltip.is-visible { opacity: 1; }
/* Divider between label and shortcut group */
.tb-tooltip-shortcut {
  display: inline-flex;
  align-items: center;
  gap: 2px;
}
/* Each key token */
.tb-tooltip kbd {
  display: inline-block;
  background: rgba(255,255,255,0.14);
  border: 1px solid rgba(255,255,255,0.28);
  border-bottom-width: 2px;
  border-radius: 3px;
  padding: 0 8px;
  font-family: var(--font-ui);
  font-size: 10px;
  font-weight: 700;
  line-height: 16px;
  letter-spacing: 0;
  color: rgba(255,255,255,0.90);
}
/* ── Style buttons (P / H1 / H2 / H3) — now all SVG icons ───────────── */
.tb-btn--style {
  width: var(--header-action-size);
  padding: 0;
  font-family: var(--font-ui);
}
.tb-style-label {
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1;
}
.tb-btn--style svg { width: 18px; height: 18px; }
/* ── Highlight button ─────────────────────────────────────────────────── */
.tb-highlight-wrap {
  display: inline-flex;
  align-items: center;
}
.tb-highlight-main {
  width: var(--header-action-size);
  border-radius: var(--r-md);
}
.tb-highlight-swatch {
  display: none;
}
.tb-highlight-main svg {
  position: static;
  z-index: 1;
}
@media (max-width: 920px) {
  #toolbar-row::before,
  #toolbar-row::after {
    flex-basis: var(--header-inline-pad-compact);
  }
  .toolbar-inner {
    padding-inline: var(--header-inline-pad-compact);
  }
  #toolbar-row .toolbar-inner {
    max-width: calc(100% - (var(--header-inline-pad-compact) * 2));
  }
  .tb-style-select {
    min-width: 132px;
    max-width: 168px;
  }
}
.tb-btn[data-premium-locked="true"]{position:relative}

