/* ═══════════════════════════════════════════════════════════════════════
   Toolbar форматирования контента — TZ_EDITOR_v4.md T-13/T-14/T-15.

   Sticky-панель над композером с иконками B/I/H1-3/¶/•/1./❝/⟨⟩/🔗/⚓/↶↷.
   Работает над выделением в любом contenteditable-bubble.
   ═══════════════════════════════════════════════════════════════════════ */

.cw-toolbar-mount {
  display: block;
  margin: 0 0 6px 0;
}

.cw-toolbar {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 2px;
  padding: 5px 8px;
  background: rgba(20, 18, 14, 0.78);
  border: 1px solid rgba(245, 158, 11, 0.18);
  border-radius: 8px;
  position: sticky;
  top: 4px;
  z-index: 50;
  backdrop-filter: blur(6px);
}

.cw-tb-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  padding: 0;
  background: transparent;
  border: 1px solid transparent;
  border-radius: 4px;
  color: rgba(255, 255, 255, 0.70);
  cursor: pointer;
  transition: background 100ms ease, color 100ms ease, border-color 100ms ease;
}
.cw-tb-btn:hover {
  background: rgba(245, 158, 11, 0.10);
  color: rgba(252, 211, 77, 0.95);
  border-color: rgba(245, 158, 11, 0.25);
}
.cw-tb-btn:active {
  background: rgba(245, 158, 11, 0.18);
}
.cw-tb-btn:focus-visible {
  outline: 2px solid rgba(245, 158, 11, 0.75);
  outline-offset: 1px;
}
.cw-tb-btn--text {
  width: auto;
  padding: 0 7px;
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: 0.04em;
}
.cw-tb-sep {
  display: inline-block;
  width: 1px;
  height: 18px;
  background: rgba(245, 158, 11, 0.18);
  margin: 0 4px;
}

/* Dropdown H4-H6 */
.cw-tb-dropdown {
  position: relative;
  display: inline-block;
}
.cw-tb-dropdown-menu {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  z-index: 60;
  min-width: 160px;
  padding: 4px;
  background: rgba(28, 24, 18, 0.97);
  border: 1px solid rgba(245, 158, 11, 0.30);
  border-radius: 6px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.55);
}
.cw-tb-menu-item {
  display: block;
  width: 100%;
  padding: 6px 10px;
  text-align: left;
  background: transparent;
  border: none;
  border-radius: 4px;
  color: rgba(255, 255, 255, 0.86);
  font-size: 12px;
  cursor: pointer;
  transition: background 100ms ease;
}
.cw-tb-menu-item:hover { background: rgba(245, 158, 11, 0.12); }

/* Popover для модалов «Ссылка» / «Якорь» */
.cw-toolbar-popover {
  position: absolute;
  z-index: 200;
  width: 320px;
  padding: 12px;
  background: rgba(28, 24, 18, 0.98);
  border: 1px solid rgba(245, 158, 11, 0.40);
  border-radius: 8px;
  box-shadow: 0 14px 50px rgba(0, 0, 0, 0.65);
  font-size: 12px;
  color: rgba(255, 255, 255, 0.85);
}
.cw-toolbar-popover-title {
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-size: 10.5px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgba(245, 158, 11, 0.75);
  margin-bottom: 10px;
}
.cw-toolbar-popover-row {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-bottom: 8px;
}
.cw-toolbar-popover-row span {
  font-size: 10.5px;
  color: rgba(255, 255, 255, 0.55);
}
.cw-toolbar-popover-row input {
  background: rgba(0, 0, 0, 0.40);
  border: 1px solid rgba(245, 158, 11, 0.30);
  border-radius: 4px;
  color: rgba(255, 255, 255, 0.95);
  padding: 6px 9px;
  font-size: 12px;
  outline: none;
}
.cw-toolbar-popover-row input:focus {
  border-color: rgba(245, 158, 11, 0.75);
}
.cw-toolbar-popover-checkbox {
  display: flex;
  align-items: center;
  gap: 6px;
  margin: 6px 0 10px;
  cursor: pointer;
  font-size: 11.5px;
}
.cw-toolbar-popover-actions {
  display: flex;
  justify-content: flex-end;
  gap: 6px;
  margin-top: 8px;
}
.cw-toolbar-btn-primary,
.cw-toolbar-btn-secondary {
  padding: 6px 14px;
  border-radius: 4px;
  font-size: 11.5px;
  cursor: pointer;
  transition: background 100ms ease;
}
.cw-toolbar-btn-primary {
  background: rgba(245, 158, 11, 0.20);
  border: 1px solid rgba(245, 158, 11, 0.50);
  color: rgba(252, 211, 77, 0.95);
}
.cw-toolbar-btn-primary:hover { background: rgba(245, 158, 11, 0.30); }
.cw-toolbar-btn-secondary {
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.20);
  color: rgba(255, 255, 255, 0.70);
}
.cw-toolbar-btn-secondary:hover { background: rgba(255, 255, 255, 0.06); }

/* Tabs внутри anchor-popover */
.cw-toolbar-popover-tabs {
  display: flex;
  gap: 2px;
  margin-bottom: 10px;
  border-bottom: 1px solid rgba(245, 158, 11, 0.20);
}
.cw-toolbar-tab {
  background: transparent;
  border: none;
  padding: 6px 10px;
  font-size: 11px;
  color: rgba(255, 255, 255, 0.55);
  cursor: pointer;
  border-bottom: 2px solid transparent;
}
.cw-toolbar-tab.is-active {
  color: rgba(252, 211, 77, 0.95);
  border-bottom-color: rgba(245, 158, 11, 0.60);
}
.cw-toolbar-popover-hint {
  font-size: 10.5px;
  color: rgba(255, 255, 255, 0.45);
  margin-top: 4px;
  line-height: 1.45;
}
.cw-toolbar-popover-hint code {
  background: rgba(245, 158, 11, 0.12);
  padding: 1px 4px;
  border-radius: 3px;
  color: rgba(252, 211, 77, 0.90);
}
